Predictive Chemistry wikidb https://predictivestatmech.org/wiki/Main_Page MediaWiki 1.27.4 first-letter Media Special Talk User User talk Predictive Chemistry Predictive Chemistry talk File File talk MediaWiki MediaWiki talk Template Template talk Help Help talk Category Category talk Sandbox 0 2 2 2013-03-24T15:17:45Z 10.0.0.1 0 Created page with "[[File:Example.jpg]]" wikitext text/x-wiki [[File:Example.jpg]] 8176489735940a790fa2cddcd6686998960df38d File:Example.jpg 6 3 3 2013-03-24T15:20:51Z WikiAdmin 1 an example / test image. wikitext text/x-wiki an example / test image. e6872b1735740b2345e348ec9f68be8193de845f MediaWiki:Sidebar 8 4 5 2013-03-24T17:05:32Z WikiAdmin 1 Created page with "* navigation ** mainpage|mainpage-description ** Research|research ** Publications|publications ** currentevents-url|currentevents * SEARCH * TOOLBOX * LANGUAGES" wikitext text/x-wiki * navigation ** mainpage|mainpage-description ** Research|research ** Publications|publications ** currentevents-url|currentevents * SEARCH * TOOLBOX * LANGUAGES b25742672bebc58c7ebf704bb8ea172e3cfda942 6 5 2013-03-24T17:09:18Z WikiAdmin 1 wikitext text/x-wiki * navigation ** mainpage|mainpage-description ** Research|Research ** Publications|Publications ** currentevents-url|currentevents * SEARCH * TOOLBOX * LANGUAGES 3170cecf9c29b8bec5b37c19c2a6854fa69900a8 33 6 2013-06-23T22:26:09Z WikiAdmin 1 wikitext text/x-wiki * navigation ** mainpage|mainpage-description ** Research|Research ** Publications|Publications ** Courses ** HowTo ** Code ** currentevents-url|currentevents * SEARCH * TOOLBOX * LANGUAGES e23e0b887f0f6ed5620157b3c4feeeacab8cf1eb 34 33 2013-06-23T22:26:38Z WikiAdmin 1 wikitext text/x-wiki * navigation ** mainpage|mainpage-description ** Research|Research ** Publications|Publications ** Courses|Courses ** HowTo|HowTo ** Code|Code ** currentevents-url|currentevents * SEARCH * TOOLBOX * LANGUAGES d489418b52dba1e461341c260c7c33547f89b669 File:Dmroge InfoNonequ2011.pdf 6 7 9 2013-04-06T18:48:46Z David M. Rogers 2 http://dx.doi.org/10.1007/s10955-011-0358-9 We show how the interpretation of thermodynamic states as representing system information leads naturally to thermodynamic cycles and the first and second laws of thermodynamics as well as similar formulations wikitext text/x-wiki http://dx.doi.org/10.1007/s10955-011-0358-9 We show how the interpretation of thermodynamic states as representing system information leads naturally to thermodynamic cycles and the first and second laws of thermodynamics as well as similar formulations for nontrivial nonequilibrium problems. The logical development of the theory also leads naturally to correct indistinguishability factors in the partition function. fa8f2bc9a8c414375d8e79e632449203766e0d8e Publications 0 8 10 2013-04-06T19:25:34Z David M. Rogers 2 Created page with "* David M. Rogers, Dian Jiao, Lawrence Pratt, and Susan B. Rempe. "Local Structural Methods for Molecular Solvation?" Annu. Rep. Comp. Chem. 8, 2012. * David M. Rogers and Susan…" wikitext text/x-wiki * David M. Rogers, Dian Jiao, Lawrence Pratt, and Susan B. Rempe. "Local Structural Methods for Molecular Solvation?" Annu. Rep. Comp. Chem. 8, 2012. * David M. Rogers and Susan B. Rempe. "Irreversible Thermodynamics." J. Phys., Conf. Series, 2012. * David M. Rogers, Thomas L. Beck, and Susan B. Rempe. [[Media:Dmroge_InfoNonequ2011.pdf|"An Information Theory Approach to Nonlinear, Nonequilibrium Thermodynamics."]] [http://dx.doi.org/10.1007/s10955-011-0358-9|J. Stat. Phys. 145(2):385-409, 2011] We show how the interpretation of thermodynamic states as representing system information leads naturally to thermodynamic cycles and the first and second laws of thermodynamics as well as similar formulations for nontrivial nonequilibrium problems. The logical development of the theory also leads naturally to correct indistinguishability factors in the partition function. * Sameer Varma, David M. Rogers, Lawrence R. Pratt, and Susan B. Rempe. "Perspectives on Ion Selectivity: Design Principles for K+ Selectivity in Membrane Transport." [http://jgp.rupress.org/content/137/6/479.full|J. Gen. Physiol., 137(6):479-488, 2011.] We review the development of models for understanding the physical basis of selectivity for K+ ions over Na+, its sibling only one row behind, in membrane channels and transporters. Although the problem is subtle because of the morass of competing effects, we emphasize work analyzing the systematic influence of the environment on tipping local binding site structure toward selective configurations. * David M. Rogers and Susan B. Rempe. “Probing the Thermodynamics of Competitive Ion Binding Using Minimum Energy Structures.” J. Phys. Chem. B, in press 2011. We presented an extension of the Quasi-Chemical theory for quantifying the impact of local structure on ion complexation thermodynamics. The theory can be simply represented using a set of thermodynamic cycles involving binding site structural and compositional states as reaction intermediates. * Susan B. Rempe and David M. Rogers; et. al. “Computational and experimental platform for understanding and optimizing water flux and salt rejection in nanoporous membranes.” [http://prod.sandia.gov/techlib/access-control.cgi/2010/106735.pdf|Sandia Technical Report, SAND2010-6735, 2010.] We summarize work on designing polymer coatings for salt exclusion in water transporting nanopores. In this work, I collected available molecular dynamics results for these systems and performed a novel energy efficiency analysis able to relate atomistic and experimental scales as well as identify important design goals and chemical principles for material performance. * [http://etd.ohiolink.edu/view.cgi?acc_num=ucin1251832030|''''Using Bayes' Theorem for Free Energy Calculations''''] We investigated the central quantity of free energies in a Bayesian context and provide estimators for solvation free energies as well as optimal potential of mean force approximations to model polymer coarse-grained dynamics from atomistic simulations. * Zhen Zhao, David M. Rogers and Thomas L. Beck. "Polarization and Charge Transfer in the Hydration of Chloride Ions." [http://link.aip.org/link/?JCP/132/014502/1|J. Chem. Phys., 132:014502, 2010.] Dr. Zhao's ab-initio analysis of the charge distribution in water-ion clusters highlighted the importance of many-body water-water interactions and charge transfer effects in determining cluster structural and energetic properties. These are still challenging to represent in modern polarizable forcefields and have implications for anion properties at interfaces. * David M. Rogers and Thomas L. Beck. "Quasi-Chemical and Structural Analysis of Polarizable Anion Hydration." [http://link.aip.org/link/?JCP/132/014505/1|J. Chem. Phys., 132:014505, 2010.] The role of polarizability in forcefield-based models of ions and water was examined. Utilizing some of our recent developments on quasi-chemical theory, we have been able to quantify the tightened, asymmetric nature of the ion's local solvation waters induced by increased polarizability as well as the exact effects of polarization on the solvation free energy. The results suggest some potential problems and diagnostics for such models. * David M. Rogers and Thomas L. Beck. [http://forcesolve.sourceforge.net/|Force Solve] (Sourceforge, Chicago IL, 2008). This force matching software implements and tests coarse-graining for general molecular systems in a mere 4000 lines of code. It is able to parametrize coarse Hamiltonians from atomic trajectory data given arbitrary definitions of coarse united-atom type models as well as carry out short Langevin Dynamics simulations on the coarse scale. The program's main drawbacks are its slow speed and high memory usage due to its simplistic design, attributable to the interpreted nature of python. * David M. Rogers and Thomas L. Beck. "Resolution and Scale Independent Nonparametric Function Matching Using a String Energy Penalized Spline Prior." 2008. [http://arxiv.org/abs/1003.4741|arXiv:1003.4741v1] (stat.ML). Fresh insight is provided into long-standing mathematical issues surrounding computational modeling of continuous functions from a few sampled data points. The present research lays the groundwork for predicting the behavior of complicated many-body systems using advanced regression techniques. 09c58a013b69bcae1972224d3e6dd6a884bed915 Main Page 0 9 14 2013-04-06T19:35:19Z David M. Rogers 2 moved [[Main Page]] to [[Root]]:&#32;myob wikitext text/x-wiki #REDIRECT [[Root]] 4a69a79dd66cb178e36bc64f3fb4f7044465538f 16 14 2013-04-21T04:03:05Z WikiAdmin 1 wikitext text/x-wiki Welcome to the home-page David M. Rogers' research group in Multiscale Chemical Physics at the University of South Florida. We are actively defining and understanding new physics at the nanoscale right now, most of which is shown through the [[Research]] and [[Publications]] links. If you'd like to leave a message, please send it by email to predictivestatmech (domain) gmail.com. ad0a0a8f4d3b4a30af767f2462e3d31c6b3829ab 24 16 2013-04-30T03:30:52Z David M. Rogers 2 wikitext text/x-wiki Welcome to the David M. Rogers' research group in Multiscale Chemical Physics at the University of South Florida. We are actively defining and understanding new physics at the nanoscale right now, most of which is shown through the [[Research]] and [[Publications]] links. If you'd like to leave a message, please send it by email to predictivestatmech (domain) gmail.com. 41bd51c14d6307388c214795dc117be195f339b7 Predictive Chemistry:Current events 4 10 15 2013-04-06T19:38:15Z David M. Rogers 2 Created page with "* David M. Rogers presented "Solute Partitioning and Transport through Natural and Biomimetic Membranes," at the 2013 ACS National Meeting, Thursday, April 11 2013." wikitext text/x-wiki * David M. Rogers presented "Solute Partitioning and Transport through Natural and Biomimetic Membranes," at the 2013 ACS National Meeting, Thursday, April 11 2013. 18c7c6003078ab349230a904adb435e61915b146 30 15 2013-06-23T21:05:09Z David M. Rogers 2 wikitext text/x-wiki * Monday, August 26 2013: USF Autumn Semester First Day of Classes * Thursday, April 11 2013: David M. Rogers presented "Solute Partitioning and Transport through Natural and Biomimetic Membranes," at the 2013 ACS National Meeting. == Calendars == * [http://www.registrar.usf.edu/enroll/regist/calendt.php USF Calendar] f38e80060f2bc2ed9f57f5eec9beef27b8caf75e 31 30 2013-06-23T21:07:42Z David M. Rogers 2 wikitext text/x-wiki * Monday, August 26 2013: USF Autumn Semester First Day of Classes * [http://nano.anl.gov/users/call_for_proposals.html Argonne Center for Nanoscale Materials Proposal Deadline] * Thursday, April 11 2013: David M. Rogers presented "Solute Partitioning and Transport through Natural and Biomimetic Membranes," at the 2013 ACS National Meeting. == Calendars == * [http://www.registrar.usf.edu/enroll/regist/calendt.php USF Calendar] e7769a89aa45e3e8e26a9b8813b5c003afceb299 32 31 2013-06-23T21:12:02Z David M. Rogers 2 wikitext text/x-wiki * Monday, August 26 2013: USF Autumn Semester First Day of Classes * Friday, July 12, 2013: Argonne Center for Nanoscale Materials [http://nano.anl.gov/users/call_for_proposals.html Proposal Deadline] * Thursday, July 4, 2013: Independence Day - celebrate by supporting [https://www.eff.org/ EFF] * Thursday, April 11 2013: David M. Rogers presented "Solute Partitioning and Transport through Natural and Biomimetic Membranes," at the 2013 ACS National Meeting. == Calendars == * [http://www.registrar.usf.edu/enroll/regist/calendt.php USF Calendar] 5059c67889716fdd490ee12f14c1f8fed2962d95 Research 0 11 17 2013-04-22T02:25:25Z David M. Rogers 2 Created page with "= Nonequilibrium Statistical Mechanics = The first law of thermodynamics states that energy can flow into a system both as heat and work. The second law states that heat divide…" wikitext text/x-wiki = Nonequilibrium Statistical Mechanics = The first law of thermodynamics states that energy can flow into a system both as heat and work. The second law states that heat divided by temperature is a particularly pernicious quantity. It represents an increase in something like a debt which can never be bought down, only exported somewhere else. Recent discoveries in nonequilibrium statistical mechanics have centered around the microscopic origins of this 'irreversibility.' We have uncovered surprising new connections to observable information. For example, energy rejected from a process, but not used to do work, has to be counted as heat. The more statistical information we have about a process, the more avenues we have to extract some of that energy, shifting it under the heading of 'work.' We are investigating these microscopic processes through simulations on nanoscale energy conversion devices. = Local Free Energy Methods = Molecule partitioning underlies drug activity, separation and extraction, and solid/liquid phase stability. A variety of factors come together to determine the part of a solution that a molecule will take up residence, and more than one explanation is possible. The most useful of these for designing new molecular and solvent structures is a local picture, where a free energy for moving a molecule to different points in solution acts like a voltage probe in an electric circuit. The energy required for moving a molecule to any point in solution can be divided into molecular packing, direct energetic interaction with a surrounding set of ligands, and long-range solvent polarization terms. We are building models for these components that will greatly simplify the process of designing better devices using molecular information. 4b63fd525e61dacd7ec9606c9d85e149d7ab6b41 HowTo:VirtualMachine 0 12 18 2013-04-27T20:20:11Z David M. Rogers 2 Created page with "Virtual machines run a whole operating system, complete with kernel, but can share a physical machine, be powered on/off and transported in software. Their flexibility and abilit…" wikitext text/x-wiki Virtual machines run a whole operating system, complete with kernel, but can share a physical machine, be powered on/off and transported in software. Their flexibility and ability to be customized makes them a core component of most cloud computing platforms. Here, I document my descent into running one of these on a 32-bit Intel(R) Atom(TM) N455 running 32-bit Ubuntu 12.03. Almost all these commands must be run as root, due to unnecessarily restrictive issues with users not being able to mount filesystems in linux. The lecture about being a smart super-user goes as follows # You can permanently destroy your system as root, requiring a re-install from CD - you have been warned. # check the man-pages for all commands you run as root, measure twice and cut once. sudo /bin/bash aptitude -P install xen-linux-system Brctl wants to get 'in the loop' right ontop of the NIC, and multiplex from there, not by some magic decision on which incoming connections to forward to which domain. So the 'addif' won't work if you're currently connected. There are two easy options. The first (non-functional with wlan0 for me) is to let it get 'in the loop' by adding to /etc/network/interfaces: <syntaxhighlight lang="bash"> iface wlan0 inet manual auto xenbr0 iface xenbr0 inet manual pre-up iw wlan0 set 4addr on bridge_ports wlan0 # effectively runs: # brctl addbr xenbr0 # brctl addif xenbr0 wlan0 # iw dev wlan0 set 4addr on </syntaxhighlight> By the way, you should be able to update that without rebooting, using service networking restart This one didn't work for me due some problem with iwconfig getting/setting network state for the wireless radio when wlan0 had been hijacked. The second is to use simple NAT for outgoing-initiated only network access. Comment in /etc/xen/xend-config.sxp: <syntaxhighlight lang="bash"> #(network-script network-bridge) #(vif-script vif-bridge) </syntaxhighlight> Add/uncomment in /etc/xen/xend-config.sxp: (network-script network-nat) (vif-script vif-nat) Uncomment (or write into) /etc/sysctl.conf <syntaxhighlight lang="bash"> net.ipv4.ip_forward = 1 #net.ipv4.conf.eth0.proxy_arp = 1 </syntaxhighlight> The second one is not required for nat, but is a gotcha for bridging, since the guest needs to respond to ARPs to get its name out there. Make available now (this first cmd not required on reboot). sysctl -p /etc/sysctl.conf iptables -t nat -A POSTROUTING -o wlan0 -j MASQUERADE And check up on it. iptables -t nat -S POSTROUTING That one, for me, showed a bunch of routing rules to forward traffic over ethernet, so I used iptables -t nat -D POSTROUTING 1 a few times. To forward, e.g., port 80 on your machine to the virtual host, use: iptables -t nat -A PREROUTING -p tcp --dport 80 --dst $MY_IP -j DNAT --to-destination 10.0.0.10:80 where $MY_IP is the one listed under "inet addr:" from ifconfig wlan0. The Xen installers wanted to make sure you did your homework, so you have to change the boot load order of grub to start linux_xen rather than linux first. Following along from: http://wiki.xen.org/wiki/Xen_Beginners_Guide mv /etc/grub.d/{20,09}_linux_xen update-grub2 Yes, you really need the xen-tools for this next bit. aptitude install xen-tools reiserfsprogs Without the following, you would soon see cryptic package verification runes on a quest for magic rings. apt-get install debian-keyring debian-archive-keyring We're on a shoestring budget from an HP mini laptop, so we put our block devices on a file. There are some distro-finding errors, combined with some subtle networking errors that force on us the last few rows of options here. <syntaxhighlight lang="bash"> xen-create-image --hostname=lamp --memory=512mb --vcpus=2 \ --fs=reiserfs --dir=$PWD --size=3Gb --force --keep \ --pygrub --dist=squeeze --mirror=http://cdn.debian.net/debian/ \ --gateway=10.0.0.1 --ip=10.0.0.10 --netmask=255.255.255.0 </syntaxhighlight> The error log is at /var/log/xen-tools/lamp.log. If it fails, you probably have a few loop-devices still mounted. losetup -a umount /dev/loop0 Without specifying a mirror, I got: E: Failed getting release file http://us.archive.ubuntu.com/ubuntu/dists/squeeze/Release The problem is that Ubuntu has its own /etc/apt-sources list, which does not jive with the base Debian distribution. For some reason, /usr/bin/xen-create-image left that out on line 1351: <syntaxhighlight lang="bash"> > # Default distribution is Debian Stable > $CONFIG{ 'dist' } = 'stable'; < $CONFIG{ 'mirror' } = ''; > $CONFIG{ 'mirror' } = 'http://cdn.debian.net/debian/'; </syntaxhighlight> To get around it, I just had to remind it of its own documentation. The --dir option has to be a full pathname, since it's put into the /etc/xen/lamp.cfg file. Anyway, if the image is created, write down the root password, or you'll have to mount -o loop=/dev/loop0 domains/lamp/disk.iso /mnt And /mnt/etc/shadow to copy a known password hash. If all goes well, you should have a new cfg file in /etc/xen. xm create -c /etc/xen/lamp.cfg Now you can fuss with networking. There are some instructions here: [http://wiki.xen.org/wiki/Network_Configuration_Examples_%28Xen_4.1%2B%29] [http://wiki.kartbuilding.net/index.php/Xen_Networking] It's not clear from the walk-throughs, but dhcp won't work out of the box, since xen's dhcp management consists of trying to fix-up the ISC DHCP server's configuration (if you've already happend to set that up for 10.0.0.x). I hadn't put in all the options to xen-create-image, so I had to run (from the host) ifconfig vif1.0 10.0.0.1 netmask 255.255.255.0 route add -net 10.0.0.0 netmask 255.255.255.0 vif1.0 (from the guest) ifconfig eth0 10.0.0.10 netmask 255.255.255.0 before a ping 10.0.0.10 could reach the guest, and route add default gw 10.0.0.1 before the guest could reach the world (remember the masquerade filter was working above). You can also check that there are some rules for the new bridged-nat device by iptables -L -- Troubles with NetworkManager -- If, like me, you are using NetworkManager for configuring wifi, you should know that it's becoming more evil. It's started taking over bind's job (in /etc/NetworkManager/NetworkManager.conf [/etc/nm-system-settings.conf on older versions]): dns=dnsmasq leading to a loopback address in /etc/resolv.conf that destroys domU's name resolution. Even worse, it continually cries dhclient on your shiny new vifx.y interfaces, leading to your connection breaking as it tries to install packages (mysql-server5.1 is particlarly problematic - hint: --force remove-reinstreq). The first symptom is that the ipv4 address of vif1.0 periodically disappears, leaving only a v6 addr. Like the do not call list, it also only allows 'removal' from the managed list. unmanaged-devices=mac:00:16:3e:xx:xx:xx (where the last xx -s are replaced by the appropriate mac, as specified in /etc/xen/lamp.cfg). I would wish it did wildcard or partial matches, but it doesn't even do multiple mac addresses, since it happily started up dhclients on a mis-mac-ed vif that I decided to semicolon append to that list. Incidentally, the vif's macs seem to change to fe:ff:ff:ff:ff:ff after awhile, even when I fixed this... You can try to add vif's mac and restart it with: <syntaxhighlight lang="bash"> pkill -HUP NetworkManager # or service network-manager restart </syntaxhighlight> and kill its dhclient, found with ps ax | grep dhcp But the thing seems to keep ignoring its config., so I did the next-best thing, and stopped NetworkManager. service network-manager stop chkconfig network-manager off and followed some great advice for pre-empting nm altogether. [http://www.sevenforge.com/2009/07/28/connecting-to-wpa-wifi-on-the-command-line/] I also switched to wicd for wireless admin: aptitude install wicd-gtk It seems much less presumptuous and heavy-handed, controlling one interface, and using group-based access control. [https://launchpad.net/wicd] [https://wiki.archlinux.org/index.php/Wicd] -- Troubles with NetworkManager End (ideally) -- Manually changing the guest's resolv.conf will stay put, despite the doom-saying in its header, but to make the gateway changes permanent, we need the following in /etc/xen/lamp.cfg: vif = [ 'ip=10.0.0.10,mac=00:16:3E:6C:BE:F3' ] You can now complete the acronym stack via debian's package manager! aptitude install apache2 mysql-server libapache2-mod-php5 libapache2-mod-gnutls a2enmod gnutls and do stupid tricks like navigating to http://10.0.0.10/ from your host's browser. 30f5c814540c2146559314f227d3ba042c97d3a2 19 18 2013-04-27T22:43:34Z David M. Rogers 2 wikitext text/x-wiki Virtual machines run a whole operating system, complete with kernel, but can share a physical machine, be powered on/off and transported in software. Their flexibility and ability to be customized makes them a core component of most cloud computing platforms. Here, I document my descent into running one of these on a 32-bit Intel(R) Atom(TM) N455 running 32-bit Ubuntu 12.03. Almost all these commands must be run as root, due to unnecessarily restrictive issues with users not being able to mount filesystems in linux. The lecture about being a smart super-user goes as follows # You can permanently destroy your system as root, requiring a re-install from CD - you have been warned. # check the man-pages for all commands you run as root, measure twice and cut once. sudo /bin/bash aptitude -P install xen-linux-system Brctl wants to get 'in the loop' right ontop of the NIC, and multiplex from there, not by some magic decision on which incoming connections to forward to which domain. So the 'addif' won't work if you're currently connected. There are two easy options. The first (non-functional with wlan0 for me) is to let it get 'in the loop' by adding to /etc/network/interfaces: <syntaxhighlight lang="bash"> iface wlan0 inet manual auto xenbr0 iface xenbr0 inet manual pre-up iw wlan0 set 4addr on bridge_ports wlan0 # effectively runs: # brctl addbr xenbr0 # brctl addif xenbr0 wlan0 # iw dev wlan0 set 4addr on </syntaxhighlight> By the way, you should be able to update that without rebooting, using service networking restart This one didn't work for me due some problem with iwconfig getting/setting network state for the wireless radio when wlan0 had been hijacked. The second is to use simple NAT for outgoing-initiated only network access. Comment in /etc/xen/xend-config.sxp: <syntaxhighlight lang="bash"> #(network-script network-bridge) #(vif-script vif-bridge) </syntaxhighlight> Add/uncomment in /etc/xen/xend-config.sxp: (network-script network-nat) (vif-script vif-nat) Uncomment (or write into) /etc/sysctl.conf <syntaxhighlight lang="bash"> net.ipv4.ip_forward = 1 #net.ipv4.conf.eth0.proxy_arp = 1 </syntaxhighlight> The second one is not required for nat, but is a gotcha for bridging, since the guest needs to respond to ARPs to get its name out there. Make available now (this first cmd not required on reboot). sysctl -p /etc/sysctl.conf iptables -t nat -A POSTROUTING -o wlan0 -j MASQUERADE And check up on it. iptables -t nat -S POSTROUTING That one, for me, showed a bunch of routing rules to forward traffic over ethernet, so I used iptables -t nat -D POSTROUTING 1 a few times. To forward, e.g., port 80 on your machine to the virtual host, use: iptables -t nat -A PREROUTING -p tcp --dport 80 --dst $MY_IP -j DNAT --to-destination 10.0.0.10:80 where $MY_IP is the one listed under "inet addr:" from ifconfig wlan0. The Xen installers wanted to make sure you did your homework, so you have to change the boot load order of grub to start linux_xen rather than linux first. Following along from: http://wiki.xen.org/wiki/Xen_Beginners_Guide mv /etc/grub.d/{20,09}_linux_xen update-grub2 Yes, you really need the xen-tools for this next bit. aptitude install xen-tools reiserfsprogs Without the following, you would soon see cryptic package verification runes on a quest for magic rings. apt-get install debian-keyring debian-archive-keyring We're on a shoestring budget from an HP mini laptop, so we put our block devices on a file. There are some distro-finding errors, combined with some subtle networking errors that force on us the last few rows of options here. <syntaxhighlight lang="bash"> xen-create-image --hostname=lamp --memory=512mb --vcpus=2 \ --fs=reiserfs --dir=$PWD --size=3Gb --force --keep \ --pygrub --dist=squeeze --mirror=http://cdn.debian.net/debian/ \ --gateway=10.0.0.1 --ip=10.0.0.10 --netmask=255.255.255.0 </syntaxhighlight> The error log is at /var/log/xen-tools/lamp.log. If it fails, you probably have a few loop-devices still mounted. losetup -a umount /dev/loop0 Without specifying a mirror, I got: E: Failed getting release file http://us.archive.ubuntu.com/ubuntu/dists/squeeze/Release The problem is that Ubuntu has its own /etc/apt-sources list, which does not jive with the base Debian distribution. For some reason, /usr/bin/xen-create-image left that out on line 1351: <syntaxhighlight lang="bash"> > # Default distribution is Debian Stable > $CONFIG{ 'dist' } = 'stable'; < $CONFIG{ 'mirror' } = ''; > $CONFIG{ 'mirror' } = 'http://cdn.debian.net/debian/'; </syntaxhighlight> To get around it, I just had to remind it of its own documentation. The --dir option has to be a full pathname, since it's put into the /etc/xen/lamp.cfg file. Anyway, if the image is created, write down the root password, or you'll have to mount -o loop=/dev/loop0 domains/lamp/disk.iso /mnt And /mnt/etc/shadow to copy a known password hash. If all goes well, you should have a new cfg file in /etc/xen. xm create -c /etc/xen/lamp.cfg Now you can fuss with networking. There are some instructions here: [http://wiki.xen.org/wiki/Network_Configuration_Examples_%28Xen_4.1%2B%29] [http://wiki.kartbuilding.net/index.php/Xen_Networking] It's not clear from the walk-throughs, but dhcp won't work out of the box, since xen's dhcp management consists of trying to fix-up the ISC DHCP server's configuration (if you've already happend to set that up for 10.0.0.x). I hadn't put in all the options to xen-create-image, so I had to run (from the host) ifconfig vif1.0 10.0.0.1 netmask 255.255.255.0 route add -net 10.0.0.0 netmask 255.255.255.0 vif1.0 (from the guest) ifconfig eth0 10.0.0.10 netmask 255.255.255.0 before a ping 10.0.0.10 could reach the guest, and route add default gw 10.0.0.1 before the guest could reach the world (remember the masquerade filter was working above). You can also check that there are some rules for the new bridged-nat device by iptables -L -- Troubles with NetworkManager -- If, like me, you are using NetworkManager for configuring wifi, you should know that it's becoming more evil. It's started taking over bind's job (in /etc/NetworkManager/NetworkManager.conf [/etc/nm-system-settings.conf on older versions]): dns=dnsmasq leading to a loopback address in /etc/resolv.conf that destroys domU's name resolution. Even worse, it continually cries dhclient on your shiny new vifx.y interfaces, leading to your connection breaking as it tries to install packages (mysql-server5.1 is particlarly problematic - hint: --force remove-reinstreq). The first symptom is that the ipv4 address of vif1.0 periodically disappears, leaving only a v6 addr. Like the do not call list, it also only allows 'removal' from the managed list. unmanaged-devices=mac:00:16:3e:xx:xx:xx (where the last xx -s are replaced by the appropriate mac, as specified in /etc/xen/lamp.cfg). I would wish it did wildcard or partial matches, but it doesn't even do multiple mac addresses, since it happily started up dhclients on a mis-mac-ed vif that I decided to semicolon append to that list. Incidentally, the vif's macs seem to change to fe:ff:ff:ff:ff:ff after awhile, even when I fixed this... You can try to add vif's mac and restart it with: <syntaxhighlight lang="bash"> pkill -HUP NetworkManager # or service network-manager restart </syntaxhighlight> and kill its dhclient, found with ps ax | grep dhcp But the thing seems to keep ignoring its config., so I did the next-best thing, and stopped NetworkManager. service network-manager stop chkconfig network-manager off and followed some advice for pre-empting nm altogether. [http://www.sevenforge.com/2009/07/28/connecting-to-wpa-wifi-on-the-command-line/] This didn't entirely work, since Ubuntu is hardwired to use NetworkManager on start-up somehow. I also switched to wicd for wireless admin: aptitude install wicd-gtk It seems much less presumptuous and heavy-handed, controlling one interface, and using group-based access control. [https://launchpad.net/wicd] [https://wiki.archlinux.org/index.php/Wicd] -- Troubles with NetworkManager End (ideally) -- Manually changing the guest's resolv.conf will stay put, despite the doom-saying in its header, but to make the gateway changes permanent, we need the following in /etc/xen/lamp.cfg: vif = [ 'ip=10.0.0.10,mac=00:16:3E:6C:BE:F3' ] You can now complete the acronym stack via debian's package manager! aptitude install apache2 mysql-server libapache2-mod-php5 libapache2-mod-gnutls a2enmod gnutls and do stupid tricks like navigating to http://10.0.0.10/ from your host's browser. 0194ba79f5eca7ef2915c38cb71283a4bf3d3de3 20 19 2013-04-30T02:10:38Z David M. Rogers 2 wikitext text/x-wiki Virtual machines run a whole operating system, complete with kernel, but can share a physical machine, be powered on/off and transported in software. Their flexibility and ability to be customized makes them a core component of most cloud computing platforms. Here, I document my descent into running one of these on a 32-bit Intel(R) Atom(TM) N455 running 32-bit Ubuntu 12.03. Almost all these commands must be run as root, due to unnecessarily restrictive issues with users not being able to mount filesystems in linux. The lecture about being a smart super-user goes as follows # You can permanently destroy your system as root, requiring a re-install from CD - you have been warned. # check the man-pages for all commands you run as root, measure twice and cut once. sudo /bin/bash aptitude -P install xen-linux-system Brctl wants to get 'in the loop' right ontop of the NIC, and multiplex from there, not by some magic decision on which incoming connections to forward to which domain. So the 'addif' won't work if you're currently connected. There are two easy options. The first (non-functional with wlan0 for me) is to let it get 'in the loop' by adding to /etc/network/interfaces: <source lang="bash"> iface wlan0 inet manual auto xenbr0 iface xenbr0 inet manual pre-up iw wlan0 set 4addr on bridge_ports wlan0 # effectively runs: # brctl addbr xenbr0 # brctl addif xenbr0 wlan0 # iw dev wlan0 set 4addr on </source> By the way, you should be able to update that without rebooting, using service networking restart This one didn't work for me due some problem with iwconfig getting/setting network state for the wireless radio when wlan0 had been hijacked. The second is to use simple NAT for outgoing-initiated only network access. Comment in /etc/xen/xend-config.sxp: <source lang="bash"> #(network-script network-bridge) #(vif-script vif-bridge) </source> Add/uncomment in /etc/xen/xend-config.sxp: (network-script network-nat) (vif-script vif-nat) Uncomment (or write into) /etc/sysctl.conf <source lang="bash"> net.ipv4.ip_forward = 1 #net.ipv4.conf.eth0.proxy_arp = 1 </source> The second one is not required for nat, but is a gotcha for bridging, since the guest needs to respond to ARPs to get its name out there. Make available now (this first cmd not required on reboot). sysctl -p /etc/sysctl.conf iptables -t nat -A POSTROUTING -o wlan0 -j MASQUERADE And check up on it. iptables -t nat -S POSTROUTING That one, for me, showed a bunch of routing rules to forward traffic over ethernet, so I used iptables -t nat -D POSTROUTING 1 a few times. To forward, e.g., port 80 on your machine to the virtual host, use: iptables -t nat -A PREROUTING -p tcp --dport 80 --dst $MY_IP -j DNAT --to-destination 10.0.0.10:80 where $MY_IP is the one listed under "inet addr:" from ifconfig wlan0. The Xen installers wanted to make sure you did your homework, so you have to change the boot load order of grub to start linux_xen rather than linux first. Following along from: http://wiki.xen.org/wiki/Xen_Beginners_Guide mv /etc/grub.d/{20,09}_linux_xen update-grub2 Yes, you really need the xen-tools for this next bit. aptitude install xen-tools reiserfsprogs Without the following, you would soon see cryptic package verification runes on a quest for magic rings. apt-get install debian-keyring debian-archive-keyring We're on a shoestring budget from an HP mini laptop, so we put our block devices on a file. There are some distro-finding errors, combined with some subtle networking errors that force on us the last few rows of options here. <source lang="bash"> xen-create-image --hostname=lamp --memory=512mb --vcpus=2 \ --fs=reiserfs --dir=$PWD --size=3Gb --force --keep \ --pygrub --dist=squeeze --mirror=http://cdn.debian.net/debian/ \ --gateway=10.0.0.1 --ip=10.0.0.10 --netmask=255.255.255.0 </source> The error log is at /var/log/xen-tools/lamp.log. If it fails, you probably have a few loop-devices still mounted. losetup -a umount /dev/loop0 Without specifying a mirror, I got: E: Failed getting release file http://us.archive.ubuntu.com/ubuntu/dists/squeeze/Release The problem is that Ubuntu has its own /etc/apt-sources list, which does not jive with the base Debian distribution. For some reason, /usr/bin/xen-create-image left that out on line 1351: <source lang="bash"> > # Default distribution is Debian Stable > $CONFIG{ 'dist' } = 'stable'; < $CONFIG{ 'mirror' } = ''; > $CONFIG{ 'mirror' } = 'http://cdn.debian.net/debian/'; </source> To get around it, I just had to remind it of its own documentation. The --dir option has to be a full pathname, since it's put into the /etc/xen/lamp.cfg file. Anyway, if the image is created, write down the root password, or you'll have to mount -o loop=/dev/loop0 domains/lamp/disk.iso /mnt And /mnt/etc/shadow to copy a known password hash. If all goes well, you should have a new cfg file in /etc/xen. xm create -c /etc/xen/lamp.cfg Now you can fuss with networking. There are some instructions here: [http://wiki.xen.org/wiki/Network_Configuration_Examples_%28Xen_4.1%2B%29] [http://wiki.kartbuilding.net/index.php/Xen_Networking] It's not clear from the walk-throughs, but dhcp won't work out of the box, since xen's dhcp management consists of trying to fix-up the ISC DHCP server's configuration (if you've already happend to set that up for 10.0.0.x). I hadn't put in all the options to xen-create-image, so I had to run (from the host) ifconfig vif1.0 10.0.0.1 netmask 255.255.255.0 route add -net 10.0.0.0 netmask 255.255.255.0 vif1.0 (from the guest) ifconfig eth0 10.0.0.10 netmask 255.255.255.0 before a ping 10.0.0.10 could reach the guest, and route add default gw 10.0.0.1 before the guest could reach the world (remember the masquerade filter was working above). You can also check that there are some rules for the new bridged-nat device by iptables -L -- Troubles with NetworkManager -- If, like me, you are using NetworkManager for configuring wifi, you should know that it's becoming more evil. It's started taking over bind's job (in /etc/NetworkManager/NetworkManager.conf [/etc/nm-system-settings.conf on older versions]): dns=dnsmasq leading to a loopback address in /etc/resolv.conf that destroys domU's name resolution. Even worse, it continually cries dhclient on your shiny new vifx.y interfaces, leading to your connection breaking as it tries to install packages (mysql-server5.1 is particlarly problematic - hint: --force remove-reinstreq). The first symptom is that the ipv4 address of vif1.0 periodically disappears, leaving only a v6 addr. Like the do not call list, it also only allows 'removal' from the managed list. unmanaged-devices=mac:00:16:3e:xx:xx:xx (where the last xx -s are replaced by the appropriate mac, as specified in /etc/xen/lamp.cfg). I would wish it did wildcard or partial matches, but it doesn't even do multiple mac addresses, since it happily started up dhclients on a mis-mac-ed vif that I decided to semicolon append to that list. Incidentally, the vif's macs seem to change to fe:ff:ff:ff:ff:ff after awhile, even when I fixed this... You can try to add vif's mac and restart it with: <source lang="bash"> pkill -HUP NetworkManager # or service network-manager restart </source> and kill its dhclient, found with ps ax | grep dhcp But the thing seems to keep ignoring its config., so I did the next-best thing, and stopped NetworkManager. service network-manager stop chkconfig network-manager off and followed some advice for pre-empting nm altogether. [http://www.sevenforge.com/2009/07/28/connecting-to-wpa-wifi-on-the-command-line/] This didn't entirely work, since Ubuntu is hardwired to use NetworkManager on start-up somehow. I also switched to wicd for wireless admin: aptitude install wicd-gtk It seems much less presumptuous and heavy-handed, controlling one interface, and using group-based access control. [https://launchpad.net/wicd] [https://wiki.archlinux.org/index.php/Wicd] -- Troubles with NetworkManager End (ideally) -- Manually changing the guest's resolv.conf will stay put, despite the doom-saying in its header, but to make the gateway changes permanent, we need the following in /etc/xen/lamp.cfg: vif = [ 'ip=10.0.0.10,mac=00:16:3E:6C:BE:F3' ] You can now complete the acronym stack via debian's package manager! aptitude install apache2 mysql-server libapache2-mod-php5 libapache2-mod-gnutls a2enmod gnutls and do stupid tricks like navigating to http://10.0.0.10/ from your host's browser. 20de1d1bfc99be04dd8b5927ce60c52f604d5b27 HowTo 0 13 21 2013-04-30T02:25:32Z David M. Rogers 2 Created page with "I'm constantly finding that life is like a bunch of little projects, sandwiching a few much larger projects. Here's some free advice for the little projects. [[HowTo:CleanUpUbu…" wikitext text/x-wiki I'm constantly finding that life is like a bunch of little projects, sandwiching a few much larger projects. Here's some free advice for the little projects. [[HowTo:CleanUpUbuntu|Clean Up Ubuntu 12]] [[HowTo:VirtualMachine|Build a virtual machine]] e63700f5b67dbb2ba08bc1c19b496e269c336e40 26 21 2013-06-23T07:58:49Z David M. Rogers 2 wikitext text/x-wiki I'm constantly finding that life is like a bunch of little projects, sandwiching a few much larger projects. Here's some free advice for the little projects. * [[HowTo:CleanUpUbuntu|Clean Up Ubuntu 12]] * [[HowTo:VirtualMachine|Build a virtual machine]] c900a368ee35f83d92e4e6c8f758ff7d5abd0aa8 27 26 2013-06-23T16:57:00Z David M. Rogers 2 wikitext text/x-wiki I'm constantly finding that life is like a bunch of little projects, sandwiching a few much larger projects. Here's some free advice for the little projects. * [[HowTo:CleanUpUbuntu|Clean Up Ubuntu 12]] * [[HowTo:VirtualMachine|Build a virtual machine]] * [http://flurdy.com/docs/postfix/ Setup Postfix] * [http://pllab.is.ocha.ac.jp/~asai/cw2011tutorial/ Work With Delimited Continuations] 3fa971a3f1227c055781196929460cd901942346 42 27 2013-08-08T17:39:38Z David M. Rogers 2 wikitext text/x-wiki I'm constantly finding that life is like a bunch of little projects, sandwiching a few much larger projects. Here's some free advice for the little projects. * [[HowTo:CleanUpUbuntu|Clean Up Ubuntu 12]] * [[HowTo:VirtualMachine|Build a virtual machine]] * [[HowTo:GNUOSX|Setup Mac OSX for Linux Development and GNU Programs]] * [http://flurdy.com/docs/postfix/ Setup Postfix] * [http://pllab.is.ocha.ac.jp/~asai/cw2011tutorial/ Work With Delimited Continuations] eed997df8516df21838540b47813facedc9c9b3d HowTo:CleanUpUbuntu 0 14 22 2013-04-30T03:10:58Z David M. Rogers 2 Created page with "= How to clean up a new install of Ubuntu 12 = I didn't upgrade past Ubuntu 10 right away, since I was worried about `cloud' integration and co. But when I finally got a hand-m…" wikitext text/x-wiki = How to clean up a new install of Ubuntu 12 = I didn't upgrade past Ubuntu 10 right away, since I was worried about `cloud' integration and co. But when I finally got a hand-me-down netbook with the unbearable Windows I decided to give it a spin. At first, I thought I was being a bit paranoid when I gave the installed applications list the once-over and followed the list below. Later, I noticed the [http://www.fsf.org/blogs/rms/ubuntu-spyware-what-to-do FSF]'s post on Ubuntu including spyware, and realized that maybe this wasn't such bad advice after all. For new installations, try [trisquel.info Trisquel], it's a totally free distro. == The Beginning == While messing around trying to hack the "dashboard" display (served up to you courtesy of unity-panel-service), I found a bunch of easy settings to mess with under the canonical heading: $ gsettings list-schemas | grep -i canonical and found some very disturbing (auto-started) programs named zeitgeist, whose purpose is apparently to raid the web-browser cache, along with anything else it can get its hands on, and make all that information retreivable through dbus. $ sudo apt-get remove zeitgeist-core Incidentally, I started this mess trying to remove the "Trash" icon from the Unity dash. When asked how to remove the offensive icon, Mark Shuttleworth (Ubuntu's founder) says, ``We have not allowed the removal of the Trash so that we can enable developers to trust that it will always be there.'' [http://askubuntu.com/questions/37776/how-can-i-remove-the-trash-icon-from-the-unity-launcher] == The Plot Thickens == There's an interesting tie-in between zeitgiest and rhythmbox, which ubuntu favors as a music player, and has even integrated its $ sudo apt-get remove unity-scope-{musicstores,video-remote} into. I'm not a big fan of combining an OS and a music store, and would rather pay the $100 to buy a copy of an OS than have any commercial interest taking over my PC. While I'm checking running programs, those "lenses" (fancy start-menus) don't look so attractive when you see they come with individual daemon processes. $ sudo apt-get remove unity-lens-{video,music,files,applications} That's not even mentioning that unity-lens-files is just a fancy interface to the "locate" command. Of course, I don't believe I'll be throwing random personal information into a bucket managed by anyone but myself, so $ sudo apt-get remove ubuntuone-client python-ubuntuone-{client,control-panel,storageprotocol} ubuntuone-couch == What else is running? == Finally, there's a "bamf" daemon that doesn't seem to have any documentation and barely a comment here and there in the code. From the package description: Bamf matches application windows to desktop files. This package contains the daemon used by the library and a gio module that facilitates the matching of applications started through GDesktopAppInfo. It seems bamf is not confined to windows that 'opt-in' to interface with unity. Marco Trevisan wrote a recent code review on Launchpad with a few tantalizing statements: 1737 /* we have a window who is ready to be matched */ 1738 - handle_raw_window (self, window); 1739 + if (bamf_legacy_window_get_window_type (window) != BAMF_WINDOW_DOCK) 1740 + handle_raw_window (self, window); Revert this please, bamf should actually track any window Mhmh... I don't like this: 1760 +void bamf_matcher_register_view_stealing_ref (BamfMatcher *self, BamfView *view); It should be private, while bamf_unity_webapps should signal to the matcher that a new web-app has been opened and that it should match it. Basically I think that bamf_unity_webapps should be a source like BamfLegacyScreen is. while lines 408-411 of bamf-matcher.c <source lang="C"> if (type != BAMF_WINDOW_NORMAL || bamf_legacy_window_get_transient (window)) { /* Child windows can generally easily be recognized by their class */ if (g_strcmp0 (class, "libreoffice-writer") == 0) </source> seems to indicate that the matching can be carried out on libreoffice windows, and ''child'' windows (spawned by the parent window, itself presumably the unholy offspring of the "dash" launcher)! Apparently, bamf is yet another server for building graphical applications and is therefore irremovably hooked into the unity window manager and panel displays. What's odd about this one is that the code singles out openoffice in a few cases and identifies child windows by class names. The application-as-a-server seems to be a common design pattern for the Ubuntu team, but there should definitely be more security around an API designed to peer into other open applications. Should programs be able to automagically "find" each other at all? A related set of packages are defaults in KDE, and form dependencies of the kde-runtime! Go and read the description of these things: $ sudo apt-get purge libnepomuk4 libnepomukdatamanagement4 libnepomukquery4a libnepomuksync4 libnepomukutils4 446fde029c84ba884c13658b0d37ba3d0a5ace97 23 22 2013-04-30T03:11:26Z David M. Rogers 2 /* How to clean up a new install of Ubuntu 12 */ wikitext text/x-wiki = How to clean up a new install of Ubuntu 12 = I didn't upgrade past Ubuntu 10 right away, since I was worried about `cloud' integration and co. But when I finally got a hand-me-down netbook with the unbearable Windows I decided to give it a spin. At first, I thought I was being a bit paranoid when I gave the installed applications list the once-over and followed the list below. Later, I noticed the [http://www.fsf.org/blogs/rms/ubuntu-spyware-what-to-do FSF]'s post on Ubuntu including spyware, and realized that maybe this wasn't such bad advice after all. For new installations, try [http://trisquel.info Trisquel], it's a totally free distro. == The Beginning == While messing around trying to hack the "dashboard" display (served up to you courtesy of unity-panel-service), I found a bunch of easy settings to mess with under the canonical heading: $ gsettings list-schemas | grep -i canonical and found some very disturbing (auto-started) programs named zeitgeist, whose purpose is apparently to raid the web-browser cache, along with anything else it can get its hands on, and make all that information retreivable through dbus. $ sudo apt-get remove zeitgeist-core Incidentally, I started this mess trying to remove the "Trash" icon from the Unity dash. When asked how to remove the offensive icon, Mark Shuttleworth (Ubuntu's founder) says, ``We have not allowed the removal of the Trash so that we can enable developers to trust that it will always be there.'' [http://askubuntu.com/questions/37776/how-can-i-remove-the-trash-icon-from-the-unity-launcher] == The Plot Thickens == There's an interesting tie-in between zeitgiest and rhythmbox, which ubuntu favors as a music player, and has even integrated its $ sudo apt-get remove unity-scope-{musicstores,video-remote} into. I'm not a big fan of combining an OS and a music store, and would rather pay the $100 to buy a copy of an OS than have any commercial interest taking over my PC. While I'm checking running programs, those "lenses" (fancy start-menus) don't look so attractive when you see they come with individual daemon processes. $ sudo apt-get remove unity-lens-{video,music,files,applications} That's not even mentioning that unity-lens-files is just a fancy interface to the "locate" command. Of course, I don't believe I'll be throwing random personal information into a bucket managed by anyone but myself, so $ sudo apt-get remove ubuntuone-client python-ubuntuone-{client,control-panel,storageprotocol} ubuntuone-couch == What else is running? == Finally, there's a "bamf" daemon that doesn't seem to have any documentation and barely a comment here and there in the code. From the package description: Bamf matches application windows to desktop files. This package contains the daemon used by the library and a gio module that facilitates the matching of applications started through GDesktopAppInfo. It seems bamf is not confined to windows that 'opt-in' to interface with unity. Marco Trevisan wrote a recent code review on Launchpad with a few tantalizing statements: 1737 /* we have a window who is ready to be matched */ 1738 - handle_raw_window (self, window); 1739 + if (bamf_legacy_window_get_window_type (window) != BAMF_WINDOW_DOCK) 1740 + handle_raw_window (self, window); Revert this please, bamf should actually track any window Mhmh... I don't like this: 1760 +void bamf_matcher_register_view_stealing_ref (BamfMatcher *self, BamfView *view); It should be private, while bamf_unity_webapps should signal to the matcher that a new web-app has been opened and that it should match it. Basically I think that bamf_unity_webapps should be a source like BamfLegacyScreen is. while lines 408-411 of bamf-matcher.c <source lang="C"> if (type != BAMF_WINDOW_NORMAL || bamf_legacy_window_get_transient (window)) { /* Child windows can generally easily be recognized by their class */ if (g_strcmp0 (class, "libreoffice-writer") == 0) </source> seems to indicate that the matching can be carried out on libreoffice windows, and ''child'' windows (spawned by the parent window, itself presumably the unholy offspring of the "dash" launcher)! Apparently, bamf is yet another server for building graphical applications and is therefore irremovably hooked into the unity window manager and panel displays. What's odd about this one is that the code singles out openoffice in a few cases and identifies child windows by class names. The application-as-a-server seems to be a common design pattern for the Ubuntu team, but there should definitely be more security around an API designed to peer into other open applications. Should programs be able to automagically "find" each other at all? A related set of packages are defaults in KDE, and form dependencies of the kde-runtime! Go and read the description of these things: $ sudo apt-get purge libnepomuk4 libnepomukdatamanagement4 libnepomukquery4a libnepomuksync4 libnepomukutils4 bf5d28fddca16115f3a1bf7682c08fc9f3900410 GradQuantumFall2013 0 15 25 2013-06-14T05:51:10Z David M. Rogers 2 Created page with "<BIG>Graduate Quantum Mechanics</BIG> == Meeting Time == == Grading == Your work will be graded based on homework assignments, two exams, and one student project. == Some Use…" wikitext text/x-wiki <BIG>Graduate Quantum Mechanics</BIG> == Meeting Time == == Grading == Your work will be graded based on homework assignments, two exams, and one student project. == Some Useful Preliminaries == Partial differential equations, linear algebra, Fourier series These will be reviewed in the course, but undergraduate calculus is required. == Textbooks == * Quantum Mechanics: A Modern and Concise Introductory Course, Daniel Bes (Springer, 2007 (2nd ed) or 2012 (3rd ed)) Bes gives an excellent survey of the myriad applications of QM, and is detailed enough to provide all the tools and intuition needed to do the math. It does as well as anyone should expect in getting at the whys and hows of the confusion that is quantum, including various manifestations of the measurement problem. * McQuarrie (Quantum Chemistry, 2nd ed., Univ. Sci. 2007) McQuarrie focuses in on molecular electronic structure, providing a chemistry compliment to Bes' physics-oriented book. It covers what we need to understand molecular computations, including spectroscopy, thermochemistry, Hartree-Fock and Slater determinants, molecular orbitals, density-functional theory. Leung and Marshall have written a solutions manual, Problems and Solutions for McQuarrie's QM, Univ. Sci., 2007. === Other QM Texts === * Pauling (free book on archive.org) ** Early, but presciently maps out the next ~30 y. of developments * Atkins * Griffiths * Levine * Shankar (Principles of QM, 2nd ed., Plenum 1994) ** Introduces Quantization using commutation... * Landau & Lifschitz 3 & 4 * Advanced Quantum Mechanics, Dick Rainer (Springer, 2012) - chem/phys. == Course Outline == # for((i=0;i<120;i+=7)); do date -v8m -v26d -v+"$i"d; done (01) Aug 26 Class intro., failures of classical mechanics, Planck's hypothesis. (02) Sep 2 (Mon. = Labor Day) Review of the Schrodinger equation, Heisenberg states and all that. Basic linear algebra. (03) Sep 9 One-dimensional problems - review of the potential well. New applications for the Helmholtz equation - bound and scattering states. (04) Sep 16 Applications of the Helmholtz equation, continued - tunneling, radioactive decay and diffraction. (05) Sep 23 Review of the harmonic oscillator and hydrogen atom, introduction to multi-particle statistics. (06) Sep 30 Mathematics of rotation and time-dependence. Introduction to spin. (07) Oct 7 Angular momentum, applied to rotational (radio-wave) spectroscopy electronic and nuclear spin in NMR. (08) Oct 14 More about those molecular orbitals, and calculations on the H<math>_2</math> atom. If quantum theory is exact, why do I need to choose a bunch of basis functions? (09) Oct 21 Perturbation theory calculations, also applied to H<math>_2</math>. (10) Oct 28 Electronic (UV) and vibrational (IR) polarizability. (11) Nov 4 Thermochemistry and molecular reactions. (12) Nov 11 (Mon. = Veteran's Day) Statistics of an electron gas. The Kohn-Sham decomposition and the resulting alphabet soup. (13) Nov 18 The continuing quest for the perfect functional. (14) Nov 25 (Fri. Nov 29 = Day after Thanksgiving) Chemical reactions and transition-state theory. (15) Dec 2 (Fri. Dec. 6 = Last Class) Better entanglement for better quantum computers. (16) Dec 9 - final exam week == List of Group Study Topics == # Einstein, Podolsky and Rosen's paradox and Bell's inequality. # Bohm's quantum interpretation of quantum mechanics (see also Bell's later response) # Gaussian-type orbitals, exponents, and integrals for the H<math>_2</math> atom. # calculating electron hopping rates using the non-equilibrium Green's function method # Eyring's transition-state-theory and reaction diagrams using the empirical valence-bond method. # Formulation of QM expectations using path integrals # Numerical solution methods for 1D problems. Choose an interesting topic in groups of no more than 3 students by the sign-up date. 2683d78530d705970eb47d2573b8174a8cde14f5 39 25 2013-06-23T23:44:08Z David M. Rogers 2 /* Meeting Time */ wikitext text/x-wiki <BIG>Graduate Quantum Mechanics</BIG> == Meeting Time == CHM 6938 will meet Mondays and Wednesdays from 10:45am-12:00pm in NES 104 == Grading == Your work will be graded based on homework assignments, two exams, and one student project. == Some Useful Preliminaries == Partial differential equations, linear algebra, Fourier series These will be reviewed in the course, but undergraduate calculus is required. == Textbooks == * Quantum Mechanics: A Modern and Concise Introductory Course, Daniel Bes (Springer, 2007 (2nd ed) or 2012 (3rd ed)) Bes gives an excellent survey of the myriad applications of QM, and is detailed enough to provide all the tools and intuition needed to do the math. It does as well as anyone should expect in getting at the whys and hows of the confusion that is quantum, including various manifestations of the measurement problem. * McQuarrie (Quantum Chemistry, 2nd ed., Univ. Sci. 2007) McQuarrie focuses in on molecular electronic structure, providing a chemistry compliment to Bes' physics-oriented book. It covers what we need to understand molecular computations, including spectroscopy, thermochemistry, Hartree-Fock and Slater determinants, molecular orbitals, density-functional theory. Leung and Marshall have written a solutions manual, Problems and Solutions for McQuarrie's QM, Univ. Sci., 2007. === Other QM Texts === * Pauling (free book on archive.org) ** Early, but presciently maps out the next ~30 y. of developments * Atkins * Griffiths * Levine * Shankar (Principles of QM, 2nd ed., Plenum 1994) ** Introduces Quantization using commutation... * Landau & Lifschitz 3 & 4 * Advanced Quantum Mechanics, Dick Rainer (Springer, 2012) - chem/phys. == Course Outline == # for((i=0;i<120;i+=7)); do date -v8m -v26d -v+"$i"d; done (01) Aug 26 Class intro., failures of classical mechanics, Planck's hypothesis. (02) Sep 2 (Mon. = Labor Day) Review of the Schrodinger equation, Heisenberg states and all that. Basic linear algebra. (03) Sep 9 One-dimensional problems - review of the potential well. New applications for the Helmholtz equation - bound and scattering states. (04) Sep 16 Applications of the Helmholtz equation, continued - tunneling, radioactive decay and diffraction. (05) Sep 23 Review of the harmonic oscillator and hydrogen atom, introduction to multi-particle statistics. (06) Sep 30 Mathematics of rotation and time-dependence. Introduction to spin. (07) Oct 7 Angular momentum, applied to rotational (radio-wave) spectroscopy electronic and nuclear spin in NMR. (08) Oct 14 More about those molecular orbitals, and calculations on the H<math>_2</math> atom. If quantum theory is exact, why do I need to choose a bunch of basis functions? (09) Oct 21 Perturbation theory calculations, also applied to H<math>_2</math>. (10) Oct 28 Electronic (UV) and vibrational (IR) polarizability. (11) Nov 4 Thermochemistry and molecular reactions. (12) Nov 11 (Mon. = Veteran's Day) Statistics of an electron gas. The Kohn-Sham decomposition and the resulting alphabet soup. (13) Nov 18 The continuing quest for the perfect functional. (14) Nov 25 (Fri. Nov 29 = Day after Thanksgiving) Chemical reactions and transition-state theory. (15) Dec 2 (Fri. Dec. 6 = Last Class) Better entanglement for better quantum computers. (16) Dec 9 - final exam week == List of Group Study Topics == # Einstein, Podolsky and Rosen's paradox and Bell's inequality. # Bohm's quantum interpretation of quantum mechanics (see also Bell's later response) # Gaussian-type orbitals, exponents, and integrals for the H<math>_2</math> atom. # calculating electron hopping rates using the non-equilibrium Green's function method # Eyring's transition-state-theory and reaction diagrams using the empirical valence-bond method. # Formulation of QM expectations using path integrals # Numerical solution methods for 1D problems. Choose an interesting topic in groups of no more than 3 students by the sign-up date. 2b0c4d7b5acbf78210b015c9da2b31b6a9d4ad0f 41 39 2013-07-04T21:35:44Z David M. Rogers 2 /* Textbooks */ wikitext text/x-wiki <BIG>Graduate Quantum Mechanics</BIG> == Meeting Time == CHM 6938 will meet Mondays and Wednesdays from 10:45am-12:00pm in NES 104 == Grading == Your work will be graded based on homework assignments, two exams, and one student project. == Some Useful Preliminaries == Partial differential equations, linear algebra, Fourier series These will be reviewed in the course, but undergraduate calculus is required. == Textbooks == * Quantum Mechanics: A Modern and Concise Introductory Course, Daniel Bes (Springer, 2007 (2nd ed) or 2012 (3rd ed)) Bes gives an excellent survey of the myriad applications of QM, and is detailed enough to provide all the tools and intuition needed to do the math. It does as well as anyone should expect in getting at the whys and hows of the confusion that is quantum, including various manifestations of the measurement problem. [http://usf.catalog.fcla.edu/permalink.jsp?24SF020303747 eBook] * McQuarrie (Quantum Chemistry, 2nd ed., Univ. Sci. 2007) McQuarrie focuses in on molecular electronic structure, providing a chemistry compliment to Bes' physics-oriented book. It covers what we need to understand molecular computations, including spectroscopy, thermochemistry, Hartree-Fock and Slater determinants, molecular orbitals, density-functional theory. Leung and Marshall have written a solutions manual, Problems and Solutions for McQuarrie's QM, Univ. Sci., 2007. Both these texts are available at the library, and purchasing them is not required for the course. === Other QM Texts === * Pauling (free book on archive.org) ** Early, but presciently maps out the next ~30 y. of developments * Atkins * Griffiths * Levine * Shankar (Principles of QM, 2nd ed., Plenum 1994) ** Introduces Quantization using commutation... * Landau & Lifschitz 3 & 4 * Advanced Quantum Mechanics, Dick Rainer (Springer, 2012) - chem/phys. * [http://usf.catalog.fcla.edu/permalink.jsp?24SF030655622 Bes, QM 2012 edition] == Course Outline == # for((i=0;i<120;i+=7)); do date -v8m -v26d -v+"$i"d; done (01) Aug 26 Class intro., failures of classical mechanics, Planck's hypothesis. (02) Sep 2 (Mon. = Labor Day) Review of the Schrodinger equation, Heisenberg states and all that. Basic linear algebra. (03) Sep 9 One-dimensional problems - review of the potential well. New applications for the Helmholtz equation - bound and scattering states. (04) Sep 16 Applications of the Helmholtz equation, continued - tunneling, radioactive decay and diffraction. (05) Sep 23 Review of the harmonic oscillator and hydrogen atom, introduction to multi-particle statistics. (06) Sep 30 Mathematics of rotation and time-dependence. Introduction to spin. (07) Oct 7 Angular momentum, applied to rotational (radio-wave) spectroscopy electronic and nuclear spin in NMR. (08) Oct 14 More about those molecular orbitals, and calculations on the H<math>_2</math> atom. If quantum theory is exact, why do I need to choose a bunch of basis functions? (09) Oct 21 Perturbation theory calculations, also applied to H<math>_2</math>. (10) Oct 28 Electronic (UV) and vibrational (IR) polarizability. (11) Nov 4 Thermochemistry and molecular reactions. (12) Nov 11 (Mon. = Veteran's Day) Statistics of an electron gas. The Kohn-Sham decomposition and the resulting alphabet soup. (13) Nov 18 The continuing quest for the perfect functional. (14) Nov 25 (Fri. Nov 29 = Day after Thanksgiving) Chemical reactions and transition-state theory. (15) Dec 2 (Fri. Dec. 6 = Last Class) Better entanglement for better quantum computers. (16) Dec 9 - final exam week == List of Group Study Topics == # Einstein, Podolsky and Rosen's paradox and Bell's inequality. # Bohm's quantum interpretation of quantum mechanics (see also Bell's later response) # Gaussian-type orbitals, exponents, and integrals for the H<math>_2</math> atom. # calculating electron hopping rates using the non-equilibrium Green's function method # Eyring's transition-state-theory and reaction diagrams using the empirical valence-bond method. # Formulation of QM expectations using path integrals # Numerical solution methods for 1D problems. Choose an interesting topic in groups of no more than 3 students by the sign-up date. 6fd30251a65076a5011f4a1103d6e49eb5688e3a 45 41 2013-08-22T21:55:14Z David M. Rogers 2 /* Grading */ wikitext text/x-wiki <BIG>Graduate Quantum Mechanics</BIG> == Meeting Time == CHM 6938 will meet Mondays and Wednesdays from 10:45am-12:00pm in NES 104 == Grading == Your work will be graded based on homework assignments and one student project. == Some Useful Preliminaries == Partial differential equations, linear algebra, Fourier series These will be reviewed in the course, but undergraduate calculus is required. == Textbooks == * Quantum Mechanics: A Modern and Concise Introductory Course, Daniel Bes (Springer, 2007 (2nd ed) or 2012 (3rd ed)) Bes gives an excellent survey of the myriad applications of QM, and is detailed enough to provide all the tools and intuition needed to do the math. It does as well as anyone should expect in getting at the whys and hows of the confusion that is quantum, including various manifestations of the measurement problem. [http://usf.catalog.fcla.edu/permalink.jsp?24SF020303747 eBook] * McQuarrie (Quantum Chemistry, 2nd ed., Univ. Sci. 2007) McQuarrie focuses in on molecular electronic structure, providing a chemistry compliment to Bes' physics-oriented book. It covers what we need to understand molecular computations, including spectroscopy, thermochemistry, Hartree-Fock and Slater determinants, molecular orbitals, density-functional theory. Leung and Marshall have written a solutions manual, Problems and Solutions for McQuarrie's QM, Univ. Sci., 2007. Both these texts are available at the library, and purchasing them is not required for the course. === Other QM Texts === * Pauling (free book on archive.org) ** Early, but presciently maps out the next ~30 y. of developments * Atkins * Griffiths * Levine * Shankar (Principles of QM, 2nd ed., Plenum 1994) ** Introduces Quantization using commutation... * Landau & Lifschitz 3 & 4 * Advanced Quantum Mechanics, Dick Rainer (Springer, 2012) - chem/phys. * [http://usf.catalog.fcla.edu/permalink.jsp?24SF030655622 Bes, QM 2012 edition] == Course Outline == # for((i=0;i<120;i+=7)); do date -v8m -v26d -v+"$i"d; done (01) Aug 26 Class intro., failures of classical mechanics, Planck's hypothesis. (02) Sep 2 (Mon. = Labor Day) Review of the Schrodinger equation, Heisenberg states and all that. Basic linear algebra. (03) Sep 9 One-dimensional problems - review of the potential well. New applications for the Helmholtz equation - bound and scattering states. (04) Sep 16 Applications of the Helmholtz equation, continued - tunneling, radioactive decay and diffraction. (05) Sep 23 Review of the harmonic oscillator and hydrogen atom, introduction to multi-particle statistics. (06) Sep 30 Mathematics of rotation and time-dependence. Introduction to spin. (07) Oct 7 Angular momentum, applied to rotational (radio-wave) spectroscopy electronic and nuclear spin in NMR. (08) Oct 14 More about those molecular orbitals, and calculations on the H<math>_2</math> atom. If quantum theory is exact, why do I need to choose a bunch of basis functions? (09) Oct 21 Perturbation theory calculations, also applied to H<math>_2</math>. (10) Oct 28 Electronic (UV) and vibrational (IR) polarizability. (11) Nov 4 Thermochemistry and molecular reactions. (12) Nov 11 (Mon. = Veteran's Day) Statistics of an electron gas. The Kohn-Sham decomposition and the resulting alphabet soup. (13) Nov 18 The continuing quest for the perfect functional. (14) Nov 25 (Fri. Nov 29 = Day after Thanksgiving) Chemical reactions and transition-state theory. (15) Dec 2 (Fri. Dec. 6 = Last Class) Better entanglement for better quantum computers. (16) Dec 9 - final exam week == List of Group Study Topics == # Einstein, Podolsky and Rosen's paradox and Bell's inequality. # Bohm's quantum interpretation of quantum mechanics (see also Bell's later response) # Gaussian-type orbitals, exponents, and integrals for the H<math>_2</math> atom. # calculating electron hopping rates using the non-equilibrium Green's function method # Eyring's transition-state-theory and reaction diagrams using the empirical valence-bond method. # Formulation of QM expectations using path integrals # Numerical solution methods for 1D problems. Choose an interesting topic in groups of no more than 3 students by the sign-up date. e4a2bb96bace0b8f45fe2321a79e686d11aa2135 46 45 2013-08-23T15:11:27Z David M. Rogers 2 wikitext text/x-wiki <BIG>Graduate Quantum Mechanics</BIG> [[File:CHM6938.005-syllabus.doc|Text Syllabus]] == Meeting Time == CHM 6938-005 (Quantum Mechanics I) will meet Mondays and Wednesdays from 10:45am-12:00pm in NES 104. The instructor may be reached anytime by phone 4-4298 or email (username: davidrogers on usf.edu). == Course Overview == Nanoscience has already reached its natural quantum limit, bringing the 'spooky' behavior of quantum systems into the center of a revolution. This course will rigorously develop the fundamentals of quantum mechanics required for understanding the interplay of electricity and magnetism with electronic structure. == Course Objectives == By the end of the course, you will be able to determine which problems in chemistry and physics have an essentially quantum nature. For those that do, you will know the rules for formulating the solution mathematically and the tools and special tricks for completing the solution. You will also learn aspects of numerical solutions and partial differential equations that apply to many aspect of modern technology outside of QM. As a research course, you will be expected to finish with a high-level understanding of where to find worked projects similar to new and open questions, and to mix, match, and evaluate solution techniques before diving into differentiation or trial and error. == Grading == Your work will be graded based on homework assignments (80%) and one student project (20%). == Some Useful Preliminaries == Partial differential equations, linear algebra, Fourier series These will be reviewed in the course, but undergraduate calculus is required. == Textbooks == * Quantum Mechanics: A Modern and Concise Introductory Course, Daniel Bes (Springer, 2007 (2nd ed) or 2012 (3rd ed)) Bes gives an excellent survey of the myriad applications of QM, and is detailed enough to provide all the tools and intuition needed to do the math. It does as well as anyone should expect in getting at the whys and hows of the confusion that is quantum, including various manifestations of the measurement problem. [http://usf.catalog.fcla.edu/permalink.jsp?24SF020303747 eBook] * McQuarrie (Quantum Chemistry, 2nd ed., Univ. Sci. 2007) McQuarrie focuses in on molecular electronic structure, providing a chemistry compliment to Bes' physics-oriented book. It covers what we need to understand molecular computations, including spectroscopy, thermochemistry, Hartree-Fock and Slater determinants, molecular orbitals, density-functional theory. Leung and Marshall have written a solutions manual, Problems and Solutions for McQuarrie's QM, Univ. Sci., 2007. Both these texts are available at the library (possibly in course reserves), and purchasing them is not required for the course. === Other QM Texts === * Pauling (free book on archive.org) ** Early, but presciently maps out the next ~30 y. of developments * Atkins * Griffiths * Levine * Shankar (Principles of QM, 2nd ed., Plenum 1994) ** Introduces Quantization using commutation... * Landau & Lifschitz 3 & 4 * Advanced Quantum Mechanics, Dick Rainer (Springer, 2012) - chem/phys. * [http://usf.catalog.fcla.edu/permalink.jsp?24SF030655622 Bes, QM 2012 edition] == Course Outline == # for((i=0;i<120;i+=7)); do date -v8m -v26d -v+"$i"d; done (01) Aug 26 Class intro., failures of classical mechanics, Planck's hypothesis. (02) Sep 2 (Mon. = Labor Day) Review of the Schrodinger equation, Heisenberg states and all that. Basic linear algebra. (03) Sep 9 One-dimensional problems - review of the potential well. New applications for the Helmholtz equation - bound and scattering states. (04) Sep 16 Applications of the Helmholtz equation, continued - tunneling, radioactive decay and diffraction. (05) Sep 23 Review of the harmonic oscillator and hydrogen atom, introduction to multi-particle statistics. (06) Sep 30 Mathematics of rotation and time-dependence. Introduction to spin. (07) Oct 7 Angular momentum, applied to rotational (radio-wave) spectroscopy electronic and nuclear spin in NMR. (08) Oct 14 More about those molecular orbitals, and calculations on the H<math>_2</math> atom. If quantum theory is exact, why do I need to choose a bunch of basis functions? (09) Oct 21 Perturbation theory calculations, also applied to H<math>_2</math>. (10) Oct 28 Electronic (UV) and vibrational (IR) polarizability. (11) Nov 4 Thermochemistry and molecular reactions. (12) Nov 11 (Mon. = Veteran's Day) Statistics of an electron gas. The Kohn-Sham decomposition and the resulting alphabet soup. (13) Nov 18 The continuing quest for the perfect functional. (14) Nov 25 (Fri. Nov 29 = Day after Thanksgiving) Chemical reactions and transition-state theory. (15) Dec 2 (Fri. Dec. 6 = Last Class) Better entanglement for better quantum computers. (16) Dec 9 - final exam week == List of Group Study Topics == # Einstein, Podolsky and Rosen's paradox and Bell's inequality. # Bohm's quantum interpretation of quantum mechanics (see also Bell's later response) # Gaussian-type orbitals, exponents, and integrals for the H<math>_2</math> atom. # calculating electron hopping rates using the non-equilibrium Green's function method # Eyring's transition-state-theory and reaction diagrams using the empirical valence-bond method. # Formulation of QM expectations using path integrals # Numerical solution methods for 1D problems. Choose an interesting topic in groups of no more than 3 students by Friday, Oct. 4. 360ae54d82be0435a009ec08d36b16459eb09c7b 47 46 2013-08-23T15:13:19Z David M. Rogers 2 wikitext text/x-wiki <BIG>Graduate Quantum Mechanics</BIG> [[File:CHM6938.005-syllabus.doc|Text Syllabus]] == Meeting Time == CHM 6938-005 (Quantum Mechanics I) will meet Mondays and Wednesdays from 10:45am-12:00pm in NES 104. The instructor may be reached anytime by phone 4-4298 or email (username: davidrogers on usf.edu). == Course Overview & Objectives == Nanoscience has already reached its natural quantum limit, bringing the 'spooky' behavior of quantum systems into the center of a revolution. This course will rigorously develop the fundamentals of quantum mechanics required for understanding the interplay of electricity and magnetism with electronic structure. By the end of the course, you will be able to determine which problems in chemistry and physics have an essentially quantum nature. For those that do, you will know the rules for formulating the solution mathematically and the tools and special tricks for completing the solution. You will also learn aspects of numerical solutions and partial differential equations that apply to many aspect of modern technology outside of QM. As a research course, you will be expected to finish with a high-level understanding of where to find worked projects similar to new and open questions, and to mix, match, and evaluate solution techniques before diving into differentiation or trial and error. == Grading & Due Dates == Your work will be graded based on homework assignments (80%) and one student project (20%). Homework 1: Monday, September 16 Homework 2: TBA == Some Useful Preliminaries == Partial differential equations, linear algebra, Fourier series These will be reviewed in the course, but undergraduate calculus is required. == Textbooks == * Quantum Mechanics: A Modern and Concise Introductory Course, Daniel Bes (Springer, 2007 (2nd ed) or 2012 (3rd ed)) Bes gives an excellent survey of the myriad applications of QM, and is detailed enough to provide all the tools and intuition needed to do the math. It does as well as anyone should expect in getting at the whys and hows of the confusion that is quantum, including various manifestations of the measurement problem. [http://usf.catalog.fcla.edu/permalink.jsp?24SF020303747 eBook] * McQuarrie (Quantum Chemistry, 2nd ed., Univ. Sci. 2007) McQuarrie focuses in on molecular electronic structure, providing a chemistry compliment to Bes' physics-oriented book. It covers what we need to understand molecular computations, including spectroscopy, thermochemistry, Hartree-Fock and Slater determinants, molecular orbitals, density-functional theory. Leung and Marshall have written a solutions manual, Problems and Solutions for McQuarrie's QM, Univ. Sci., 2007. Both these texts are available at the library (possibly in course reserves), and purchasing them is not required for the course. === Other QM Texts === * Pauling (free book on archive.org) ** Early, but presciently maps out the next ~30 y. of developments * Atkins * Griffiths * Levine * Shankar (Principles of QM, 2nd ed., Plenum 1994) ** Introduces Quantization using commutation... * Landau & Lifschitz 3 & 4 * Advanced Quantum Mechanics, Dick Rainer (Springer, 2012) - chem/phys. * [http://usf.catalog.fcla.edu/permalink.jsp?24SF030655622 Bes, QM 2012 edition] == Course Outline == # for((i=0;i<120;i+=7)); do date -v8m -v26d -v+"$i"d; done (01) Aug 26 Class intro., failures of classical mechanics, Planck's hypothesis. (02) Sep 2 (Mon. = Labor Day) Review of the Schrodinger equation, Heisenberg states and all that. Basic linear algebra. (03) Sep 9 One-dimensional problems - review of the potential well. New applications for the Helmholtz equation - bound and scattering states. (04) Sep 16 Applications of the Helmholtz equation, continued - tunneling, radioactive decay and diffraction. (05) Sep 23 Review of the harmonic oscillator and hydrogen atom, introduction to multi-particle statistics. (06) Sep 30 Mathematics of rotation and time-dependence. Introduction to spin. (07) Oct 7 Angular momentum, applied to rotational (radio-wave) spectroscopy electronic and nuclear spin in NMR. (08) Oct 14 More about those molecular orbitals, and calculations on the H<math>_2</math> atom. If quantum theory is exact, why do I need to choose a bunch of basis functions? (09) Oct 21 Perturbation theory calculations, also applied to H<math>_2</math>. (10) Oct 28 Electronic (UV) and vibrational (IR) polarizability. (11) Nov 4 Thermochemistry and molecular reactions. (12) Nov 11 (Mon. = Veteran's Day) Statistics of an electron gas. The Kohn-Sham decomposition and the resulting alphabet soup. (13) Nov 18 The continuing quest for the perfect functional. (14) Nov 25 (Fri. Nov 29 = Day after Thanksgiving) Chemical reactions and transition-state theory. (15) Dec 2 (Fri. Dec. 6 = Last Class) Better entanglement for better quantum computers. (16) Dec 9 - final exam week == List of Group Study Topics == # Einstein, Podolsky and Rosen's paradox and Bell's inequality. # Bohm's quantum interpretation of quantum mechanics (see also Bell's later response) # Gaussian-type orbitals, exponents, and integrals for the H<math>_2</math> atom. # calculating electron hopping rates using the non-equilibrium Green's function method # Eyring's transition-state-theory and reaction diagrams using the empirical valence-bond method. # Formulation of QM expectations using path integrals # Numerical solution methods for 1D problems. Choose an interesting topic in groups of no more than 3 students by Friday, Oct. 4. 76263e16c2e53994d923a3f589ab0a726151aadf 48 47 2013-08-26T14:02:38Z David M. Rogers 2 wikitext text/x-wiki <BIG>Graduate Quantum Mechanics</BIG> [[File:CHM6938.005-syllabus.doc|Text Syllabus]] == Meeting Time == CHM 6938-005 (Quantum Mechanics I) will meet Mondays and Wednesdays from 10:45am-12:00pm in NES 104. The instructor may be reached anytime by phone 4-4298 or email (username: davidrogers on usf.edu). == Course Overview & Objectives == Nanoscience has already reached its natural quantum limit, bringing the 'spooky' behavior of quantum systems into the center of a revolution. This course will rigorously develop the fundamentals of quantum mechanics required for understanding the interplay of electricity and magnetism with electronic structure. By the end of the course, you will be able to determine which problems in chemistry and physics have an essentially quantum nature. For those that do, you will know the rules for formulating the solution mathematically and the tools and special tricks for completing the solution. You will also learn aspects of numerical solutions and partial differential equations that apply to many aspect of modern technology outside of QM. As a research course, you will be expected to finish with a high-level understanding of where to find worked projects similar to new and open questions, and to mix, match, and evaluate solution techniques before diving into differentiation or trial and error. == Grading & Due Dates == Your work will be graded based on homework assignments (80%) and one student project (20%). Homework 1: Monday, September 16 Homework 2: TBA == Some Useful Preliminaries == Partial differential equations, linear algebra, Fourier series These will be reviewed in the course, but undergraduate calculus is required. == Textbooks == * Quantum Mechanics: A Modern and Concise Introductory Course, Daniel Bes (Springer, 2007 (2nd ed) or 2012 (3rd ed)) Bes gives an excellent survey of the myriad applications of QM, and is detailed enough to provide all the tools and intuition needed to do the math. It does as well as anyone should expect in getting at the whys and hows of the confusion that is quantum, including various manifestations of the measurement problem. [http://usf.catalog.fcla.edu/permalink.jsp?24SF020303747 eBook] * McQuarrie (Quantum Chemistry, 2nd ed., Univ. Sci. 2007) McQuarrie focuses in on molecular electronic structure, providing a chemistry compliment to Bes' physics-oriented book. It covers what we need to understand molecular computations, including spectroscopy, thermochemistry, Hartree-Fock and Slater determinants, molecular orbitals, density-functional theory. Leung and Marshall have written a solutions manual, Problems and Solutions for McQuarrie's QM, Univ. Sci., 2007. Both these texts are available at the library (possibly in course reserves), and purchasing them is not required for the course. === Other QM Texts === * Pauling (free book on archive.org) ** Early, but presciently maps out the next ~30 y. of developments * Atkins * Griffiths * Levine * Shankar (Principles of QM, 2nd ed., Plenum 1994) ** Introduces Quantization using commutation... * Landau & Lifschitz 3 & 4 * Advanced Quantum Mechanics, Dick Rainer (Springer, 2012) - chem/phys. * [http://usf.catalog.fcla.edu/permalink.jsp?24SF030655622 Bes, QM 2012 edition] == Course Outline == # for((i=0;i<120;i+=7)); do date -v8m -v26d -v+"$i"d; done (01) Aug 26 Class intro., failures of classical mechanics, Planck's hypothesis. [[File:LectA.pdf|Notes]] (02) Sep 2 (Mon. = Labor Day) Review of the Schrodinger equation, Heisenberg states and all that. Basic linear algebra. (03) Sep 9 One-dimensional problems - review of the potential well. New applications for the Helmholtz equation - bound and scattering states. (04) Sep 16 Applications of the Helmholtz equation, continued - tunneling, radioactive decay and diffraction. (05) Sep 23 Review of the harmonic oscillator and hydrogen atom, introduction to multi-particle statistics. (06) Sep 30 Mathematics of rotation and time-dependence. Introduction to spin. (07) Oct 7 Angular momentum, applied to rotational (radio-wave) spectroscopy electronic and nuclear spin in NMR. (08) Oct 14 More about those molecular orbitals, and calculations on the H<math>_2</math> atom. If quantum theory is exact, why do I need to choose a bunch of basis functions? (09) Oct 21 Perturbation theory calculations, also applied to H<math>_2</math>. (10) Oct 28 Electronic (UV) and vibrational (IR) polarizability. (11) Nov 4 Thermochemistry and molecular reactions. (12) Nov 11 (Mon. = Veteran's Day) Statistics of an electron gas. The Kohn-Sham decomposition and the resulting alphabet soup. (13) Nov 18 The continuing quest for the perfect functional. (14) Nov 25 (Fri. Nov 29 = Day after Thanksgiving) Chemical reactions and transition-state theory. (15) Dec 2 (Fri. Dec. 6 = Last Class) Better entanglement for better quantum computers. (16) Dec 9 - final exam week == List of Group Study Topics == # Einstein, Podolsky and Rosen's paradox and Bell's inequality. # Bohm's quantum interpretation of quantum mechanics (see also Bell's later response) # Gaussian-type orbitals, exponents, and integrals for the H<math>_2</math> atom. # calculating electron hopping rates using the non-equilibrium Green's function method # Eyring's transition-state-theory and reaction diagrams using the empirical valence-bond method. # Formulation of QM expectations using path integrals # Numerical solution methods for 1D problems. Choose an interesting topic in groups of no more than 3 students by Friday, Oct. 4. 9211f49439fc635ed013438092f03ce58bf0c5f7 50 48 2013-08-26T18:49:50Z David M. Rogers 2 /* List of Group Study Topics */ wikitext text/x-wiki <BIG>Graduate Quantum Mechanics</BIG> [[File:CHM6938.005-syllabus.doc|Text Syllabus]] == Meeting Time == CHM 6938-005 (Quantum Mechanics I) will meet Mondays and Wednesdays from 10:45am-12:00pm in NES 104. The instructor may be reached anytime by phone 4-4298 or email (username: davidrogers on usf.edu). == Course Overview & Objectives == Nanoscience has already reached its natural quantum limit, bringing the 'spooky' behavior of quantum systems into the center of a revolution. This course will rigorously develop the fundamentals of quantum mechanics required for understanding the interplay of electricity and magnetism with electronic structure. By the end of the course, you will be able to determine which problems in chemistry and physics have an essentially quantum nature. For those that do, you will know the rules for formulating the solution mathematically and the tools and special tricks for completing the solution. You will also learn aspects of numerical solutions and partial differential equations that apply to many aspect of modern technology outside of QM. As a research course, you will be expected to finish with a high-level understanding of where to find worked projects similar to new and open questions, and to mix, match, and evaluate solution techniques before diving into differentiation or trial and error. == Grading & Due Dates == Your work will be graded based on homework assignments (80%) and one student project (20%). Homework 1: Monday, September 16 Homework 2: TBA == Some Useful Preliminaries == Partial differential equations, linear algebra, Fourier series These will be reviewed in the course, but undergraduate calculus is required. == Textbooks == * Quantum Mechanics: A Modern and Concise Introductory Course, Daniel Bes (Springer, 2007 (2nd ed) or 2012 (3rd ed)) Bes gives an excellent survey of the myriad applications of QM, and is detailed enough to provide all the tools and intuition needed to do the math. It does as well as anyone should expect in getting at the whys and hows of the confusion that is quantum, including various manifestations of the measurement problem. [http://usf.catalog.fcla.edu/permalink.jsp?24SF020303747 eBook] * McQuarrie (Quantum Chemistry, 2nd ed., Univ. Sci. 2007) McQuarrie focuses in on molecular electronic structure, providing a chemistry compliment to Bes' physics-oriented book. It covers what we need to understand molecular computations, including spectroscopy, thermochemistry, Hartree-Fock and Slater determinants, molecular orbitals, density-functional theory. Leung and Marshall have written a solutions manual, Problems and Solutions for McQuarrie's QM, Univ. Sci., 2007. Both these texts are available at the library (possibly in course reserves), and purchasing them is not required for the course. === Other QM Texts === * Pauling (free book on archive.org) ** Early, but presciently maps out the next ~30 y. of developments * Atkins * Griffiths * Levine * Shankar (Principles of QM, 2nd ed., Plenum 1994) ** Introduces Quantization using commutation... * Landau & Lifschitz 3 & 4 * Advanced Quantum Mechanics, Dick Rainer (Springer, 2012) - chem/phys. * [http://usf.catalog.fcla.edu/permalink.jsp?24SF030655622 Bes, QM 2012 edition] == Course Outline == # for((i=0;i<120;i+=7)); do date -v8m -v26d -v+"$i"d; done (01) Aug 26 Class intro., failures of classical mechanics, Planck's hypothesis. [[File:LectA.pdf|Notes]] (02) Sep 2 (Mon. = Labor Day) Review of the Schrodinger equation, Heisenberg states and all that. Basic linear algebra. (03) Sep 9 One-dimensional problems - review of the potential well. New applications for the Helmholtz equation - bound and scattering states. (04) Sep 16 Applications of the Helmholtz equation, continued - tunneling, radioactive decay and diffraction. (05) Sep 23 Review of the harmonic oscillator and hydrogen atom, introduction to multi-particle statistics. (06) Sep 30 Mathematics of rotation and time-dependence. Introduction to spin. (07) Oct 7 Angular momentum, applied to rotational (radio-wave) spectroscopy electronic and nuclear spin in NMR. (08) Oct 14 More about those molecular orbitals, and calculations on the H<math>_2</math> atom. If quantum theory is exact, why do I need to choose a bunch of basis functions? (09) Oct 21 Perturbation theory calculations, also applied to H<math>_2</math>. (10) Oct 28 Electronic (UV) and vibrational (IR) polarizability. (11) Nov 4 Thermochemistry and molecular reactions. (12) Nov 11 (Mon. = Veteran's Day) Statistics of an electron gas. The Kohn-Sham decomposition and the resulting alphabet soup. (13) Nov 18 The continuing quest for the perfect functional. (14) Nov 25 (Fri. Nov 29 = Day after Thanksgiving) Chemical reactions and transition-state theory. (15) Dec 2 (Fri. Dec. 6 = Last Class) Better entanglement for better quantum computers. (16) Dec 9 - final exam week == List of Group Study Topics == # Einstein, Podolsky and Rosen's paradox and Bell's inequality. # Bohm's quantum interpretation of quantum mechanics (see also Bell's later response) # Gaussian-type orbitals, exponents, and integrals for the H<math>_2</math> atom. # calculating electron hopping rates using the non-equilibrium Green's function method # Eyring's transition-state-theory and reaction diagrams using the empirical valence-bond method. # Formulation of QM expectations using path integrals # Numerical solution methods for 1D problems. Choose an interesting topic in groups of no more than 3 students by Friday, Oct. 4. [[Media:GroupAssignment.pdf |Group Assignment Instructions]] a49cd7b2d0c46d2b16b4a4cf429558c389e274c8 51 50 2013-08-26T18:54:31Z David M. Rogers 2 wikitext text/x-wiki <BIG>Graduate Quantum Mechanics</BIG> [[Media:CHM6938.005-syllabus.doc|Text Syllabus]] == Meeting Time == CHM 6938-005 (Quantum Mechanics I) will meet Mondays and Wednesdays from 10:45am-12:00pm in NES 104. The instructor may be reached anytime by phone 4-4298 or email (username: davidrogers on usf.edu). == Course Overview & Objectives == Nanoscience has already reached its natural quantum limit, bringing the 'spooky' behavior of quantum systems into the center of a revolution. This course will rigorously develop the fundamentals of quantum mechanics required for understanding the interplay of electricity and magnetism with electronic structure. By the end of the course, you will be able to determine which problems in chemistry and physics have an essentially quantum nature. For those that do, you will know the rules for formulating the solution mathematically and the tools and special tricks for completing the solution. You will also learn aspects of numerical solutions and partial differential equations that apply to many aspect of modern technology outside of QM. As a research course, you will be expected to finish with a high-level understanding of where to find worked projects similar to new and open questions, and to mix, match, and evaluate solution techniques before diving into differentiation or trial and error. == Grading & Due Dates == Your work will be graded based on homework assignments (80%) and one student project (20%). Homework 1: Monday, September 16 Homework 2: TBA == Some Useful Preliminaries == Partial differential equations, linear algebra, Fourier series These will be reviewed in the course, but undergraduate calculus is required. == Textbooks == * Quantum Mechanics: A Modern and Concise Introductory Course, Daniel Bes (Springer, 2007 (2nd ed) or 2012 (3rd ed)) Bes gives an excellent survey of the myriad applications of QM, and is detailed enough to provide all the tools and intuition needed to do the math. It does as well as anyone should expect in getting at the whys and hows of the confusion that is quantum, including various manifestations of the measurement problem. [http://usf.catalog.fcla.edu/permalink.jsp?24SF020303747 eBook] * McQuarrie (Quantum Chemistry, 2nd ed., Univ. Sci. 2007) McQuarrie focuses in on molecular electronic structure, providing a chemistry compliment to Bes' physics-oriented book. It covers what we need to understand molecular computations, including spectroscopy, thermochemistry, Hartree-Fock and Slater determinants, molecular orbitals, density-functional theory. Leung and Marshall have written a solutions manual, Problems and Solutions for McQuarrie's QM, Univ. Sci., 2007. Both these texts are available at the library (possibly in course reserves), and purchasing them is not required for the course. === Other QM Texts === * Pauling (free book on archive.org) ** Early, but presciently maps out the next ~30 y. of developments * Atkins * Griffiths * Levine * Shankar (Principles of QM, 2nd ed., Plenum 1994) ** Introduces Quantization using commutation... * Landau & Lifschitz 3 & 4 * Advanced Quantum Mechanics, Dick Rainer (Springer, 2012) - chem/phys. * [http://usf.catalog.fcla.edu/permalink.jsp?24SF030655622 Bes, QM 2012 edition] == Course Outline == # for((i=0;i<120;i+=7)); do date -v8m -v26d -v+"$i"d; done (01) Aug 26 Class intro., failures of classical mechanics, Planck's hypothesis. [[File:LectA.pdf|Notes]] (02) Sep 2 (Mon. = Labor Day) Review of the Schrodinger equation, Heisenberg states and all that. Basic linear algebra. (03) Sep 9 One-dimensional problems - review of the potential well. New applications for the Helmholtz equation - bound and scattering states. (04) Sep 16 Applications of the Helmholtz equation, continued - tunneling, radioactive decay and diffraction. (05) Sep 23 Review of the harmonic oscillator and hydrogen atom, introduction to multi-particle statistics. (06) Sep 30 Mathematics of rotation and time-dependence. Introduction to spin. (07) Oct 7 Angular momentum, applied to rotational (radio-wave) spectroscopy electronic and nuclear spin in NMR. (08) Oct 14 More about those molecular orbitals, and calculations on the H<math>_2</math> atom. If quantum theory is exact, why do I need to choose a bunch of basis functions? (09) Oct 21 Perturbation theory calculations, also applied to H<math>_2</math>. (10) Oct 28 Electronic (UV) and vibrational (IR) polarizability. (11) Nov 4 Thermochemistry and molecular reactions. (12) Nov 11 (Mon. = Veteran's Day) Statistics of an electron gas. The Kohn-Sham decomposition and the resulting alphabet soup. (13) Nov 18 The continuing quest for the perfect functional. (14) Nov 25 (Fri. Nov 29 = Day after Thanksgiving) Chemical reactions and transition-state theory. (15) Dec 2 (Fri. Dec. 6 = Last Class) Better entanglement for better quantum computers. (16) Dec 9 - final exam week == List of Group Study Topics == # Einstein, Podolsky and Rosen's paradox and Bell's inequality. # Bohm's quantum interpretation of quantum mechanics (see also Bell's later response) # Gaussian-type orbitals, exponents, and integrals for the H<math>_2</math> atom. # calculating electron hopping rates using the non-equilibrium Green's function method # Eyring's transition-state-theory and reaction diagrams using the empirical valence-bond method. # Formulation of QM expectations using path integrals # Numerical solution methods for 1D problems. Choose an interesting topic in groups of no more than 3 students by Friday, Oct. 4. [[Media:GroupAssignment.pdf |Group Assignment Instructions]] b135fd0c79983195f876081312800a36680cd2af 53 51 2013-08-26T21:15:36Z David M. Rogers 2 /* Course Outline */ wikitext text/x-wiki <BIG>Graduate Quantum Mechanics</BIG> [[Media:CHM6938.005-syllabus.doc|Text Syllabus]] == Meeting Time == CHM 6938-005 (Quantum Mechanics I) will meet Mondays and Wednesdays from 10:45am-12:00pm in NES 104. The instructor may be reached anytime by phone 4-4298 or email (username: davidrogers on usf.edu). == Course Overview & Objectives == Nanoscience has already reached its natural quantum limit, bringing the 'spooky' behavior of quantum systems into the center of a revolution. This course will rigorously develop the fundamentals of quantum mechanics required for understanding the interplay of electricity and magnetism with electronic structure. By the end of the course, you will be able to determine which problems in chemistry and physics have an essentially quantum nature. For those that do, you will know the rules for formulating the solution mathematically and the tools and special tricks for completing the solution. You will also learn aspects of numerical solutions and partial differential equations that apply to many aspect of modern technology outside of QM. As a research course, you will be expected to finish with a high-level understanding of where to find worked projects similar to new and open questions, and to mix, match, and evaluate solution techniques before diving into differentiation or trial and error. == Grading & Due Dates == Your work will be graded based on homework assignments (80%) and one student project (20%). Homework 1: Monday, September 16 Homework 2: TBA == Some Useful Preliminaries == Partial differential equations, linear algebra, Fourier series These will be reviewed in the course, but undergraduate calculus is required. == Textbooks == * Quantum Mechanics: A Modern and Concise Introductory Course, Daniel Bes (Springer, 2007 (2nd ed) or 2012 (3rd ed)) Bes gives an excellent survey of the myriad applications of QM, and is detailed enough to provide all the tools and intuition needed to do the math. It does as well as anyone should expect in getting at the whys and hows of the confusion that is quantum, including various manifestations of the measurement problem. [http://usf.catalog.fcla.edu/permalink.jsp?24SF020303747 eBook] * McQuarrie (Quantum Chemistry, 2nd ed., Univ. Sci. 2007) McQuarrie focuses in on molecular electronic structure, providing a chemistry compliment to Bes' physics-oriented book. It covers what we need to understand molecular computations, including spectroscopy, thermochemistry, Hartree-Fock and Slater determinants, molecular orbitals, density-functional theory. Leung and Marshall have written a solutions manual, Problems and Solutions for McQuarrie's QM, Univ. Sci., 2007. Both these texts are available at the library (possibly in course reserves), and purchasing them is not required for the course. === Other QM Texts === * Pauling (free book on archive.org) ** Early, but presciently maps out the next ~30 y. of developments * Atkins * Griffiths * Levine * Shankar (Principles of QM, 2nd ed., Plenum 1994) ** Introduces Quantization using commutation... * Landau & Lifschitz 3 & 4 * Advanced Quantum Mechanics, Dick Rainer (Springer, 2012) - chem/phys. * [http://usf.catalog.fcla.edu/permalink.jsp?24SF030655622 Bes, QM 2012 edition] == Course Outline == # for((i=0;i<120;i+=7)); do date -v8m -v26d -v+"$i"d; done (01) Aug 26 Class intro., failures of classical mechanics, Planck's hypothesis. [[Media:LectA.pdf|Notes]] Weeks 1-4 correspond roughly to Bes' Chapters 1-4. (02) Sep 2 (Mon. = Labor Day) Review of the Schrodinger equation, Heisenberg states and all that. Basic linear algebra. (03) Sep 9 One-dimensional problems - review of the potential well. New applications for the Helmholtz equation - bound and scattering states. (04) Sep 16 Applications of the Helmholtz equation, continued - tunneling, radioactive decay and diffraction. (05) Sep 23 Review of the harmonic oscillator and hydrogen atom, introduction to multi-particle statistics. Week 5 corresponds roughly to Bes' Chapters 6-7. (06) Sep 30 Mathematics of rotation and time-dependence. Introduction to spin. Weeks 6-7 correspond roughly to Bes' Chapter 5. (07) Oct 7 Angular momentum, applied to rotational (radio-wave) spectroscopy electronic and nuclear spin in NMR. (08) Oct 14 More about those molecular orbitals, and calculations on the H<math>_2</math> atom. If quantum theory is exact, why do I need to choose a bunch of basis functions? (09) Oct 21 Perturbation theory calculations, also applied to H<math>_2</math>. Weeks 8-9 correspond roughly to Bes' Chapters 7-9. More material from McQuarrie will be brought in at this point. Topics past week 9 are tentative. (10) Oct 28 Electronic (UV) and vibrational (IR) polarizability. (11) Nov 4 Thermochemistry and molecular reactions. (12) Nov 11 (Mon. = Veteran's Day) Statistics of an electron gas. The Kohn-Sham decomposition and the resulting alphabet soup. (13) Nov 18 The continuing quest for the perfect functional. (14) Nov 25 (Fri. Nov 29 = Day after Thanksgiving) Chemical reactions and transition-state theory. (15) Dec 2 Emerging research areas in molecular physics simulation and statistics. (16) Dec 9 - final exam week == List of Group Study Topics == # Einstein, Podolsky and Rosen's paradox and Bell's inequality. # Bohm's quantum interpretation of quantum mechanics (see also Bell's later response) # Gaussian-type orbitals, exponents, and integrals for the H<math>_2</math> atom. # calculating electron hopping rates using the non-equilibrium Green's function method # Eyring's transition-state-theory and reaction diagrams using the empirical valence-bond method. # Formulation of QM expectations using path integrals # Numerical solution methods for 1D problems. Choose an interesting topic in groups of no more than 3 students by Friday, Oct. 4. [[Media:GroupAssignment.pdf |Group Assignment Instructions]] 0ab5f2a17b57d4e3f50b5ab0662cc164c8923908 54 53 2013-08-26T21:21:42Z David M. Rogers 2 /* Course Outline */ wikitext text/x-wiki <BIG>Graduate Quantum Mechanics</BIG> [[Media:CHM6938.005-syllabus.doc|Text Syllabus]] == Meeting Time == CHM 6938-005 (Quantum Mechanics I) will meet Mondays and Wednesdays from 10:45am-12:00pm in NES 104. The instructor may be reached anytime by phone 4-4298 or email (username: davidrogers on usf.edu). == Course Overview & Objectives == Nanoscience has already reached its natural quantum limit, bringing the 'spooky' behavior of quantum systems into the center of a revolution. This course will rigorously develop the fundamentals of quantum mechanics required for understanding the interplay of electricity and magnetism with electronic structure. By the end of the course, you will be able to determine which problems in chemistry and physics have an essentially quantum nature. For those that do, you will know the rules for formulating the solution mathematically and the tools and special tricks for completing the solution. You will also learn aspects of numerical solutions and partial differential equations that apply to many aspect of modern technology outside of QM. As a research course, you will be expected to finish with a high-level understanding of where to find worked projects similar to new and open questions, and to mix, match, and evaluate solution techniques before diving into differentiation or trial and error. == Grading & Due Dates == Your work will be graded based on homework assignments (80%) and one student project (20%). Homework 1: Monday, September 16 Homework 2: TBA == Some Useful Preliminaries == Partial differential equations, linear algebra, Fourier series These will be reviewed in the course, but undergraduate calculus is required. == Textbooks == * Quantum Mechanics: A Modern and Concise Introductory Course, Daniel Bes (Springer, 2007 (2nd ed) or 2012 (3rd ed)) Bes gives an excellent survey of the myriad applications of QM, and is detailed enough to provide all the tools and intuition needed to do the math. It does as well as anyone should expect in getting at the whys and hows of the confusion that is quantum, including various manifestations of the measurement problem. [http://usf.catalog.fcla.edu/permalink.jsp?24SF020303747 eBook] * McQuarrie (Quantum Chemistry, 2nd ed., Univ. Sci. 2007) McQuarrie focuses in on molecular electronic structure, providing a chemistry compliment to Bes' physics-oriented book. It covers what we need to understand molecular computations, including spectroscopy, thermochemistry, Hartree-Fock and Slater determinants, molecular orbitals, density-functional theory. Leung and Marshall have written a solutions manual, Problems and Solutions for McQuarrie's QM, Univ. Sci., 2007. Both these texts are available at the library (possibly in course reserves), and purchasing them is not required for the course. === Other QM Texts === * Pauling (free book on archive.org) ** Early, but presciently maps out the next ~30 y. of developments * Atkins * Griffiths * Levine * Shankar (Principles of QM, 2nd ed., Plenum 1994) ** Introduces Quantization using commutation... * Landau & Lifschitz 3 & 4 * Advanced Quantum Mechanics, Dick Rainer (Springer, 2012) - chem/phys. * [http://usf.catalog.fcla.edu/permalink.jsp?24SF030655622 Bes, QM 2012 edition] == Course Outline == # for((i=0;i<120;i+=7)); do date -v8m -v26d -v+"$i"d; done (01) Aug 26 Class intro., failures of classical mechanics, Planck's hypothesis. [[Media:LectA.pdf|Notes]] Weeks 1-4 correspond roughly to Bes' Chapters 1-4. (02) Sep 2 (Mon. = Labor Day) Review of the Schrodinger equation, Heisenberg states and all that. Basic linear algebra. (03) Sep 9 One-dimensional problems - review of the potential well. New applications for the Helmholtz equation - bound and scattering states. (04) Sep 16 Applications of the Helmholtz equation, continued - tunneling, radioactive decay and diffraction. (05) Sep 23 Review of the harmonic oscillator and hydrogen atom, introduction to multi-particle statistics. Week 5 corresponds roughly to Bes' Chapters 6-7. (06) Sep 30 Mathematics of rotation and time-dependence. Introduction to spin. Weeks 6-7 correspond roughly to Bes' Chapter 5. (07) Oct 7 Angular momentum, applied to rotational (far infrared) spectroscopy electronic and nuclear spin in NMR. (08) Oct 14 More about those molecular orbitals, and calculations on the H<math>_2</math> atom. If quantum theory is exact, why do I need to choose a bunch of basis functions? (09) Oct 21 Perturbation theory calculations, also applied to H<math>_2</math>. Weeks 8-9 correspond roughly to Bes' Chapters 7-9. More material from McQuarrie will be brought in at this point. Topics past week 9 are tentative. (10) Oct 28 Electronic (UV) and vibrational (IR) polarizability. (11) Nov 4 Thermochemistry and molecular reactions. (12) Nov 11 (Mon. = Veteran's Day) Statistics of an electron gas. The Kohn-Sham decomposition and the resulting alphabet soup. (13) Nov 18 The continuing quest for the perfect functional. (14) Nov 25 (Fri. Nov 29 = Day after Thanksgiving) Chemical reactions and transition-state theory. (15) Dec 2 Emerging research areas in molecular physics simulation and statistics. (16) Dec 9 - final exam week == List of Group Study Topics == # Einstein, Podolsky and Rosen's paradox and Bell's inequality. # Bohm's quantum interpretation of quantum mechanics (see also Bell's later response) # Gaussian-type orbitals, exponents, and integrals for the H<math>_2</math> atom. # calculating electron hopping rates using the non-equilibrium Green's function method # Eyring's transition-state-theory and reaction diagrams using the empirical valence-bond method. # Formulation of QM expectations using path integrals # Numerical solution methods for 1D problems. Choose an interesting topic in groups of no more than 3 students by Friday, Oct. 4. [[Media:GroupAssignment.pdf |Group Assignment Instructions]] 5030665961bca50a8a69cf7a0300fbc67655d9bf 55 54 2013-08-27T14:32:57Z David M. Rogers 2 /* Course Outline */ wikitext text/x-wiki <BIG>Graduate Quantum Mechanics</BIG> [[Media:CHM6938.005-syllabus.doc|Text Syllabus]] == Meeting Time == CHM 6938-005 (Quantum Mechanics I) will meet Mondays and Wednesdays from 10:45am-12:00pm in NES 104. The instructor may be reached anytime by phone 4-4298 or email (username: davidrogers on usf.edu). == Course Overview & Objectives == Nanoscience has already reached its natural quantum limit, bringing the 'spooky' behavior of quantum systems into the center of a revolution. This course will rigorously develop the fundamentals of quantum mechanics required for understanding the interplay of electricity and magnetism with electronic structure. By the end of the course, you will be able to determine which problems in chemistry and physics have an essentially quantum nature. For those that do, you will know the rules for formulating the solution mathematically and the tools and special tricks for completing the solution. You will also learn aspects of numerical solutions and partial differential equations that apply to many aspect of modern technology outside of QM. As a research course, you will be expected to finish with a high-level understanding of where to find worked projects similar to new and open questions, and to mix, match, and evaluate solution techniques before diving into differentiation or trial and error. == Grading & Due Dates == Your work will be graded based on homework assignments (80%) and one student project (20%). Homework 1: Monday, September 16 Homework 2: TBA == Some Useful Preliminaries == Partial differential equations, linear algebra, Fourier series These will be reviewed in the course, but undergraduate calculus is required. == Textbooks == * Quantum Mechanics: A Modern and Concise Introductory Course, Daniel Bes (Springer, 2007 (2nd ed) or 2012 (3rd ed)) Bes gives an excellent survey of the myriad applications of QM, and is detailed enough to provide all the tools and intuition needed to do the math. It does as well as anyone should expect in getting at the whys and hows of the confusion that is quantum, including various manifestations of the measurement problem. [http://usf.catalog.fcla.edu/permalink.jsp?24SF020303747 eBook] * McQuarrie (Quantum Chemistry, 2nd ed., Univ. Sci. 2007) McQuarrie focuses in on molecular electronic structure, providing a chemistry compliment to Bes' physics-oriented book. It covers what we need to understand molecular computations, including spectroscopy, thermochemistry, Hartree-Fock and Slater determinants, molecular orbitals, density-functional theory. Leung and Marshall have written a solutions manual, Problems and Solutions for McQuarrie's QM, Univ. Sci., 2007. Both these texts are available at the library (possibly in course reserves), and purchasing them is not required for the course. === Other QM Texts === * Pauling (free book on archive.org) ** Early, but presciently maps out the next ~30 y. of developments * Atkins * Griffiths * Levine * Shankar (Principles of QM, 2nd ed., Plenum 1994) ** Introduces Quantization using commutation... * Landau & Lifschitz 3 & 4 * Advanced Quantum Mechanics, Dick Rainer (Springer, 2012) - chem/phys. * [http://usf.catalog.fcla.edu/permalink.jsp?24SF030655622 Bes, QM 2012 edition] == Course Outline == # for((i=0;i<120;i+=7)); do date -v8m -v26d -v+"$i"d; done (01) Aug 26 Class intro., failures of classical mechanics, Planck's hypothesis. [[Media:LectA.pdf|Notes]] Weeks 1-4 correspond roughly to Bes' Chapters 1-4. Pages 11-28 of the [http://science.energy.gov/~/media/bes/pdf/reports/files/gc_rpt.pdf DOE Grand Challenges report] also make for great related reading. (02) Sep 2 (Mon. = Labor Day) Review of the Schrodinger equation, Heisenberg states and all that. Basic linear algebra. (03) Sep 9 One-dimensional problems - review of the potential well. New applications for the Helmholtz equation - bound and scattering states. (04) Sep 16 Applications of the Helmholtz equation, continued - tunneling, radioactive decay and diffraction. (05) Sep 23 Review of the harmonic oscillator and hydrogen atom, introduction to multi-particle statistics. Week 5 corresponds roughly to Bes' Chapters 6-7. (06) Sep 30 Mathematics of rotation and time-dependence. Introduction to spin. Weeks 6-7 correspond roughly to Bes' Chapter 5. (07) Oct 7 Angular momentum, applied to rotational (far infrared) spectroscopy electronic and nuclear spin in NMR. (08) Oct 14 More about those molecular orbitals, and calculations on the H<math>_2</math> atom. If quantum theory is exact, why do I need to choose a bunch of basis functions? (09) Oct 21 Perturbation theory calculations, also applied to H<math>_2</math>. Weeks 8-9 correspond roughly to Bes' Chapters 7-9. More material from McQuarrie will be brought in at this point. Topics past week 9 are tentative. (10) Oct 28 Electronic (UV) and vibrational (IR) polarizability. (11) Nov 4 Thermochemistry and molecular reactions. (12) Nov 11 (Mon. = Veteran's Day) Statistics of an electron gas. The Kohn-Sham decomposition and the resulting alphabet soup. (13) Nov 18 The continuing quest for the perfect functional. (14) Nov 25 (Fri. Nov 29 = Day after Thanksgiving) Chemical reactions and transition-state theory. (15) Dec 2 Emerging research areas in molecular physics simulation and statistics. (16) Dec 9 - final exam week == List of Group Study Topics == # Einstein, Podolsky and Rosen's paradox and Bell's inequality. # Bohm's quantum interpretation of quantum mechanics (see also Bell's later response) # Gaussian-type orbitals, exponents, and integrals for the H<math>_2</math> atom. # calculating electron hopping rates using the non-equilibrium Green's function method # Eyring's transition-state-theory and reaction diagrams using the empirical valence-bond method. # Formulation of QM expectations using path integrals # Numerical solution methods for 1D problems. Choose an interesting topic in groups of no more than 3 students by Friday, Oct. 4. [[Media:GroupAssignment.pdf |Group Assignment Instructions]] d7d3e0974ff827181372ba635997abb0f596a729 56 55 2013-08-28T21:08:04Z David M. Rogers 2 /* Course Outline */ wikitext text/x-wiki <BIG>Graduate Quantum Mechanics</BIG> [[Media:CHM6938.005-syllabus.doc|Text Syllabus]] == Meeting Time == CHM 6938-005 (Quantum Mechanics I) will meet Mondays and Wednesdays from 10:45am-12:00pm in NES 104. The instructor may be reached anytime by phone 4-4298 or email (username: davidrogers on usf.edu). == Course Overview & Objectives == Nanoscience has already reached its natural quantum limit, bringing the 'spooky' behavior of quantum systems into the center of a revolution. This course will rigorously develop the fundamentals of quantum mechanics required for understanding the interplay of electricity and magnetism with electronic structure. By the end of the course, you will be able to determine which problems in chemistry and physics have an essentially quantum nature. For those that do, you will know the rules for formulating the solution mathematically and the tools and special tricks for completing the solution. You will also learn aspects of numerical solutions and partial differential equations that apply to many aspect of modern technology outside of QM. As a research course, you will be expected to finish with a high-level understanding of where to find worked projects similar to new and open questions, and to mix, match, and evaluate solution techniques before diving into differentiation or trial and error. == Grading & Due Dates == Your work will be graded based on homework assignments (80%) and one student project (20%). Homework 1: Monday, September 16 Homework 2: TBA == Some Useful Preliminaries == Partial differential equations, linear algebra, Fourier series These will be reviewed in the course, but undergraduate calculus is required. == Textbooks == * Quantum Mechanics: A Modern and Concise Introductory Course, Daniel Bes (Springer, 2007 (2nd ed) or 2012 (3rd ed)) Bes gives an excellent survey of the myriad applications of QM, and is detailed enough to provide all the tools and intuition needed to do the math. It does as well as anyone should expect in getting at the whys and hows of the confusion that is quantum, including various manifestations of the measurement problem. [http://usf.catalog.fcla.edu/permalink.jsp?24SF020303747 eBook] * McQuarrie (Quantum Chemistry, 2nd ed., Univ. Sci. 2007) McQuarrie focuses in on molecular electronic structure, providing a chemistry compliment to Bes' physics-oriented book. It covers what we need to understand molecular computations, including spectroscopy, thermochemistry, Hartree-Fock and Slater determinants, molecular orbitals, density-functional theory. Leung and Marshall have written a solutions manual, Problems and Solutions for McQuarrie's QM, Univ. Sci., 2007. Both these texts are available at the library (possibly in course reserves), and purchasing them is not required for the course. === Other QM Texts === * Pauling (free book on archive.org) ** Early, but presciently maps out the next ~30 y. of developments * Atkins * Griffiths * Levine * Shankar (Principles of QM, 2nd ed., Plenum 1994) ** Introduces Quantization using commutation... * Landau & Lifschitz 3 & 4 * Advanced Quantum Mechanics, Dick Rainer (Springer, 2012) - chem/phys. * [http://usf.catalog.fcla.edu/permalink.jsp?24SF030655622 Bes, QM 2012 edition] == Course Outline == # for((i=0;i<120;i+=7)); do date -v8m -v26d -v+"$i"d; done (01) Aug 26 Class intro., failures of classical mechanics, Planck's hypothesis. [[Media:LectA.pdf|Notes]] Weeks 1-4 correspond roughly to Bes' Chapters 1-4 and Chapter 13 on the history of QM. Pages 11-28 of the [http://science.energy.gov/~/media/bes/pdf/reports/files/gc_rpt.pdf DOE Grand Challenges report] also make for great related reading. (02) Sep 2 (Mon. = Labor Day) Review of the Schrodinger equation, Heisenberg states and all that. Basic linear algebra. [[Media:notes.pdf|Typed Class Notes]] (03) Sep 9 One-dimensional problems - review of the potential well. New applications for the Helmholtz equation - bound and scattering states. (04) Sep 16 Applications of the Helmholtz equation, continued - tunneling, radioactive decay and diffraction. (05) Sep 23 Review of the harmonic oscillator and hydrogen atom, introduction to multi-particle statistics. Week 5 corresponds roughly to Bes' Chapters 6-7. (06) Sep 30 Mathematics of rotation and time-dependence. Introduction to spin. Weeks 6-7 correspond roughly to Bes' Chapter 5. (07) Oct 7 Angular momentum, applied to rotational (far infrared) spectroscopy electronic and nuclear spin in NMR. (08) Oct 14 More about those molecular orbitals, and calculations on the H<math>_2</math> atom. If quantum theory is exact, why do I need to choose a bunch of basis functions? (09) Oct 21 Perturbation theory calculations, also applied to H<math>_2</math>. Weeks 8-9 correspond roughly to Bes' Chapters 7-9. More material from McQuarrie will be brought in at this point. Topics past week 9 are tentative. (10) Oct 28 Electronic (UV) and vibrational (IR) polarizability. (11) Nov 4 Thermochemistry and molecular reactions. (12) Nov 11 (Mon. = Veteran's Day) Statistics of an electron gas. The Kohn-Sham decomposition and the resulting alphabet soup. (13) Nov 18 The continuing quest for the perfect functional. (14) Nov 25 (Fri. Nov 29 = Day after Thanksgiving) Chemical reactions and transition-state theory. (15) Dec 2 Emerging research areas in molecular physics simulation and statistics. (16) Dec 9 - final exam week == List of Group Study Topics == # Einstein, Podolsky and Rosen's paradox and Bell's inequality. # Bohm's quantum interpretation of quantum mechanics (see also Bell's later response) # Gaussian-type orbitals, exponents, and integrals for the H<math>_2</math> atom. # calculating electron hopping rates using the non-equilibrium Green's function method # Eyring's transition-state-theory and reaction diagrams using the empirical valence-bond method. # Formulation of QM expectations using path integrals # Numerical solution methods for 1D problems. Choose an interesting topic in groups of no more than 3 students by Friday, Oct. 4. [[Media:GroupAssignment.pdf |Group Assignment Instructions]] 60faccf487a302da829aa859470ee02cb5daa73c Courses 0 16 28 2013-06-23T20:07:41Z David M. Rogers 2 Created page with "Here's a list of courses with useful online materials: == Courses == * [http://lambda-the-ultimate.org/classic/Courses.html Functional Programming] == Lecture Series == * [http…" wikitext text/x-wiki Here's a list of courses with useful online materials: == Courses == * [http://lambda-the-ultimate.org/classic/Courses.html Functional Programming] == Lecture Series == * [http://www.esqc.org/lectures European Summer School in Quantum Chemistry] == Tutorials == * [http://www.mathematica-journal.com/2012/02/evaluation-of-gaussian-molecular-integrals Evaluating Matrix Elements] * [http://www.haskell.org/tutorial/ Haskell] * [http://monads.haskell.cz/html/index.html Monads] * [http://www.yosefk.com/blog/my-history-with-forth-stack-machines.html The Forth Language] 32380a6d40dfa71d9c4d03687372043ab2931ef3 29 28 2013-06-23T21:01:48Z David M. Rogers 2 wikitext text/x-wiki Here's a list of courses with useful online materials: == Courses == * [[GradQuantumFall2013| USF Graduate Quantum Mechanics]] * [http://lambda-the-ultimate.org/classic/Courses.html Functional Programming] == Lecture Series == * [http://www.esqc.org/lectures European Summer School in Quantum Chemistry] == Tutorials == * [http://www.mathematica-journal.com/2012/02/evaluation-of-gaussian-molecular-integrals Evaluating Matrix Elements] * [http://www.haskell.org/tutorial/ Haskell] * [http://monads.haskell.cz/html/index.html Monads] * [http://www.yosefk.com/blog/my-history-with-forth-stack-machines.html The Forth Language] ed867ed12ea87f7d5416ca696ffc2ae9bf2529b6 Predictive Chemistry:About 4 17 35 2013-06-23T23:05:11Z WikiAdmin 1 Created page with "Unless otherwise noted (e.g. in the headers of source files / projects or in an attribution statement), all materials appearing on this site are shared under a [http://creativeco…" wikitext text/x-wiki Unless otherwise noted (e.g. in the headers of source files / projects or in an attribution statement), all materials appearing on this site are shared under a [http://creativecommons.org/licenses/by-nc-sa/3.0/ Creative Commons Attribution-ShareAlike 3.0 Unported License]. 70a63b30045d8efb42b7035add91825616ee1e77 36 35 2013-06-23T23:12:50Z WikiAdmin 1 wikitext text/x-wiki Unless otherwise noted (e.g. in the headers of source files / projects or attributed to others), all materials appearing on this site are shared under a [http://creativecommons.org/licenses/by-sa/3.0/ Creative Commons Attribution-ShareAlike 3.0 Unported License]. This means you have the freedom to re-work and re-distribute the text, provided you include an attribution statement. An appropriate attribution would read: This work incorporates material written by David Rogers and other authors from [http://www.predictivestatmech.org www.predictivestatmech.org]. 8771c6cf284c7fd5f4ceb34bd5be3980edaa99ff Code 0 18 37 2013-06-23T23:21:53Z WikiAdmin 1 Created page with "== Python Libraries == === Geometric Algebra === The attached [[Media:galg.py | Multivector]] class implements geometric algebra using Python's operator overloading. It works …" wikitext text/x-wiki == Python Libraries == === Geometric Algebra === The attached [[Media:galg.py | Multivector]] class implements geometric algebra using Python's operator overloading. It works with minimal space for any number of spatial dimensions, since it's not based on the matrix / spinor representation of Clifford algebra. Instead, it takes the basis blade approach recommended by Dorst, Fondijne, and Mann [http://www.geometricalgebra.net]. It's really just as easy as ordering all the basis vectors, and keeping track of the commutator (+/- <math>\hat 1</math>). 23f73448a383ca36fdd94d81c0277b810e136287 38 37 2013-06-23T23:32:12Z David M. Rogers 2 /* Geometric Algebra */ wikitext text/x-wiki == Python Libraries == === Geometric Algebra === The [http://www.predictivestatmech.org/code/galg.py Multivector] class implements geometric algebra using Python's operator overloading. It works with minimal space for any number of spatial dimensions, since it's not based on the matrix / spinor representation of Clifford algebra. Instead, it takes the basis blade approach recommended by Dorst, Fondijne, and Mann [http://www.geometricalgebra.net]. It's really just as easy as ordering all the basis vectors, and keeping track of the commutator (+/- <math>\hat 1</math>). c34c365b673125f28984f890d2856fac28807f0d 40 38 2013-06-26T04:51:50Z David M. Rogers 2 wikitext text/x-wiki == Python Libraries == === Geometric Algebra === The [http://www.predictivestatmech.org/code/galg.py Multivector] class implements geometric algebra using Python's operator overloading. It works with minimal space for any number of spatial dimensions, since it's not based on the matrix / spinor representation of Clifford algebra. Instead, it takes the basis blade approach recommended by Dorst, Fondijne, and Mann [http://www.geometricalgebra.net]. It's really just as easy as ordering all the basis vectors, and keeping track of the commutator (+/- <math>\hat 1</math>). == Code Humor == Put this into your makefile: <source lang=bash> Clint\ Eastwood: myday echo "I feel great!" </source> 27cf6c9dfaf08a96c1918d950c7680cf74f4bbf1 HowTo:GNUOSX 0 19 43 2013-08-08T17:54:51Z David M. Rogers 2 Created page with "Quit awhile ago, Apple switched to BSD's kernel and libraries for the guts of its OSX. This means that you can already access the Unix terminal from the Utilities folder. Newer…" wikitext text/x-wiki Quit awhile ago, Apple switched to BSD's kernel and libraries for the guts of its OSX. This means that you can already access the Unix terminal from the Utilities folder. Newer versions (like 10.8 here) are making some of those developer-friendly features harder to find - so let's briefly summarize how to get them back. # Start with basic Apple setup: mail, calendar and sync. These are pretty easy due to their large user base. #* To get multiple workspaces, you have to click the "+" on the top right of the "Mission Control" screen. # Install the XCode package - https://developer.apple.com/xcode/ #* word has it that Starting with Xcode 4.3 - you must now manually install command line tools from Xcode menu > Preferences > Downloads #* Apple is working hard to update the compiler toolchain by rewriting the monolithic GCC into a programming-language friendly LLVM framework with the CLANG compiler, so you'll see that GCC dependence is shrinking and LLVM is installed. #* or, just install the cmd line to begin: [https://developer.apple.com/downloads/index.action?=Command%20Line%20Tools%20%28OS%20X%20Mountain%20Lion%29] #* or directly at [http://devimages.apple.com/downloads/xcode/command_line_tools_for_xcode_10_8_late_july_2012.dmg] #** this can be installed without the giant XCode IDE # Install gfortran following the instructions at: [http://r.research.att.com/tools/] #* Use the CRAN mirror at: [http://cran.r-project.org/bin/macosx/tools/] #* I've found this package to work well. #* It says not to use the compilers from HPC... # Install X11 using XQuartz [http://xquartz.macosforge.org/] - or find the link through Finder -> Applications -> Utilities -> X11 # Now you're ready to install a package manager. I recommend Fink,[fink.sf.net] since it's based on Debian's dpkg system, the packages are easy to make, and I've made a few of them too. # See [[Some Productive Programs]] for useful GNU software. # Don't forget TexShop [http://mirror.ctan.org/systems/mac/mactex/MacTeX.pkg] [http://pages.uoregon.edu/koch/texshop/obtaining.html], Keynote, and Pages for papers, presentations, and posters. #* Just drag TexShop to the Applications Folder. #* Apple and MS software is available from the Library computer support desk here at USF #* These often work much better than the port of Powerpoint because of the slowness of MS font rendering on the Mac. a693d8d62a5808451de051b9a0454b42d755f733 Some Productive Programs 0 20 44 2013-08-08T18:24:32Z David M. Rogers 2 Created page with "{| border="1" class="wikitable" ! Getting Started - The Essential Tools: ! Getting Moving - The Sylish Tools: ! Rocking Out - The Expert Tools: |- | bash, less, cat, tar || pytho…" wikitext text/x-wiki {| border="1" class="wikitable" ! Getting Started - The Essential Tools: ! Getting Moving - The Sylish Tools: ! Rocking Out - The Expert Tools: |- | bash, less, cat, tar || python (>= 2.6 for ctypes), scipy, matplotlib, redirection, sed+awk || loops, array variables, job control, find, losetup |- || gedit || vim || vim-slime |- || gcc || make, git || haskell + cabal |- || latex || TeXShop || wmii |- || GNUplot, Inkscape || GIMP || ImageMagick, sox, ffmpeg |- || ssh || rsync, gnupg || screen (-x to connect to shared session) |} 96c7ab1a8c4e4150374c7934d52dd1266dd8cdde File:LectA.pdf 6 21 49 2013-08-26T14:12:21Z David M. Rogers 2 wikitext text/x-wiki da39a3ee5e6b4b0d3255bfef95601890afd80709 File:GroupAssignment.pdf 6 22 52 2013-08-26T20:29:15Z David M. Rogers 2 wikitext text/x-wiki da39a3ee5e6b4b0d3255bfef95601890afd80709 File:Notes.pdf 6 23 57 2013-08-28T21:38:56Z David M. Rogers 2 wikitext text/x-wiki da39a3ee5e6b4b0d3255bfef95601890afd80709 Publications 0 8 58 10 2013-09-03T19:22:38Z David M. Rogers 2 wikitext text/x-wiki {| cellpadding="4" style="border: 1px solid darkgray;" |- style="border: 1px solid darkgray;" || David M. Rogers, Dian Jiao, Lawrence Pratt, and Susan B. Rempe. "Structural Models and Molecular Thermodynamics of Hydration of Ions and Small Molecules" [http://dx.doi.org/10.1016/B978-0-444-59440-2.00004-1 Annu. Rep. Comp. Chem. 8:71–127, 2012.] |- style="border: 1px solid darkgray;" || David M. Rogers and Susan B. Rempe. "Irreversible Thermodynamics." [http://dx.doi.org/10.1088/1742-6596/402/1/012014 J. Phys.: Conf. Ser. 402:012014, 2012]. |- style="border: 1px solid darkgray;" || David M. Rogers, Thomas L. Beck, and Susan B. Rempe. [[Media:Dmroge_InfoNonequ2011.pdf|"An Information Theory Approach to Nonlinear, Nonequilibrium Thermodynamics."]] [http://dx.doi.org/10.1007/s10955-011-0358-9 J. Stat. Phys. 145(2):385-409, 2011] We show how the interpretation of thermodynamic states as representing system information leads naturally to thermodynamic cycles and the first and second laws of thermodynamics as well as similar formulations for nontrivial nonequilibrium problems. The logical development of the theory also leads naturally to correct indistinguishability factors in the partition function. |- style="border: 1px solid darkgray;" || Sameer Varma, David M. Rogers, Lawrence R. Pratt, and Susan B. Rempe. "Perspectives on Ion Selectivity: Design Principles for K+ Selectivity in Membrane Transport." [http://jgp.rupress.org/content/137/6/479.full J. Gen. Physiol., 137(6):479-488, 2011.] We review the development of models for understanding the physical basis of selectivity for K+ ions over Na+, its sibling only one row behind, in membrane channels and transporters. Although the problem is subtle because of the morass of competing effects, we emphasize work analyzing the systematic influence of the environment on tipping local binding site structure toward selective configurations. |- style="border: 1px solid darkgray;" || David M. Rogers and Susan B. Rempe. [http://www.ncbi.nlm.nih.gov/pmc/articles/PMC3443978/ “Probing the Thermodynamics of Competitive Ion Binding Using Minimum Energy Structures.”] [http://dx.doi.org/10.1021/jp2012864 J. Phys. Chem. B, 115(29):9116-29, 2011]. We presented an extension of the Quasi-Chemical theory for quantifying the impact of local structure on ion complexation thermodynamics. The theory can be simply represented using a set of thermodynamic cycles involving binding site structural and compositional states as reaction intermediates. |- style="border: 1px solid darkgray;" || Susan B. Rempe and David M. Rogers; et. al. “Computational and experimental platform for understanding and optimizing water flux and salt rejection in nanoporous membranes.” [http://prod.sandia.gov/techlib/access-control.cgi/2010/106735.pdf Sandia Technical Report, SAND2010-6735, 2010.] We summarize work on designing polymer coatings for salt exclusion in water transporting nanopores. In this work, I collected available molecular dynamics results for these systems and performed a novel energy efficiency analysis able to relate atomistic and experimental scales as well as identify important design goals and chemical principles for material performance. |- style="border: 1px solid darkgray;" || David M. Rogers, [http://etd.ohiolink.edu/view.cgi?acc_num=ucin1251832030 ''''Using Bayes' Theorem for Free Energy Calculations''''], 2009. We investigated the central quantity of free energies in a Bayesian context and provide estimators for solvation free energies as well as optimal potential of mean force approximations to model polymer coarse-grained dynamics from atomistic simulations. |- style="border: 1px solid darkgray;" || Zhen Zhao, David M. Rogers and Thomas L. Beck. "Polarization and Charge Transfer in the Hydration of Chloride Ions." [http://link.aip.org/link/?JCP/132/014502/1 J. Chem. Phys., 132:014502, 2010.] Dr. Zhao's ab-initio analysis of the charge distribution in water-ion clusters highlighted the importance of many-body water-water interactions and charge transfer effects in determining cluster structural and energetic properties. These are still challenging to represent in modern polarizable forcefields and have implications for anion properties at interfaces. |- style="border: 1px solid darkgray;" || David M. Rogers and Thomas L. Beck. "Quasi-Chemical and Structural Analysis of Polarizable Anion Hydration." [http://link.aip.org/link/?JCP/132/014505/1 J. Chem. Phys., 132:014505, 2010.] The role of polarizability in forcefield-based models of ions and water was examined. Utilizing some of our recent developments on quasi-chemical theory, we have been able to quantify the tightened, asymmetric nature of the ion's local solvation waters induced by increased polarizability as well as the exact effects of polarization on the solvation free energy. The results suggest some potential problems and diagnostics for such models. |- style="border: 1px solid darkgray;" || David M. Rogers and Thomas L. Beck. [http://forcesolve.sourceforge.net/ Force Solve] (Sourceforge, Chicago IL, 2008). This force matching software implements and tests coarse-graining for general molecular systems in a mere 4000 lines of code. It is able to parametrize coarse Hamiltonians from atomic trajectory data given arbitrary definitions of coarse united-atom type models as well as carry out short Langevin Dynamics simulations on the coarse scale. The program's main drawbacks are its slow speed and high memory usage due to its simplistic design, attributable to the interpreted nature of python. |- style="border: 1px solid darkgray;" || David M. Rogers and Thomas L. Beck. "Resolution and Scale Independent Nonparametric Function Matching Using a String Energy Penalized Spline Prior." 2008. [http://arxiv.org/abs/1003.4741 arXiv:1003.4741v1] (stat.ML). Fresh insight is provided into long-standing mathematical issues surrounding computational modeling of continuous functions from a few sampled data points. The present research lays the groundwork for predicting the behavior of complicated many-body systems using advanced regression techniques. |} 47a62f7488fa45fe5d6f2615bc4c488f572a2a99 HowTo:GNUOSX 0 19 59 43 2013-09-03T19:58:16Z David M. Rogers 2 wikitext text/x-wiki Quit awhile ago, Apple switched to BSD's kernel and libraries for the guts of its OSX. This means that you can already access the Unix terminal from the Utilities folder. Newer versions (like 10.8 here) are making some of those developer-friendly features harder to find - so let's briefly summarize how to get them back. # Start with basic Apple setup: mail, calendar and sync. These are pretty easy due to their large user base. #* To get multiple workspaces, you have to click the "+" on the top right of the "Mission Control" screen. # Install the XCode package - https://developer.apple.com/xcode/ #* word has it that Starting with Xcode 4.3 - you must now manually install command line tools from Xcode menu > Preferences > Downloads #* Apple is working hard to update the compiler toolchain by rewriting the monolithic GCC into a programming-language friendly LLVM framework with the CLANG compiler, so you'll see that GCC dependence is shrinking and LLVM is installed. #* or, just install the cmd line to begin: [https://developer.apple.com/downloads/index.action?=Command%20Line%20Tools%20%28OS%20X%20Mountain%20Lion%29] #* or directly at [http://devimages.apple.com/downloads/xcode/command_line_tools_for_xcode_10_8_late_july_2012.dmg] #** this can be installed without the giant XCode IDE, but you have to <pre>mv /usr/bin/xcrun{,.old}; xcode-select -switch /usr/bin</pre> and then create ''/usr/bin/xcrun'' with the following: <source lang="bash">#!/bin/sh case $1 in -*) echo "Option '$1' not implemented." exit esac $@ </source> # Install gfortran following the instructions at: [http://r.research.att.com/tools/] #* Use the CRAN mirror at: [http://cran.r-project.org/bin/macosx/tools/] #* I've found this package to work well. #* It says not to use the compilers from HPC... # Install X11 using XQuartz [http://xquartz.macosforge.org/] - or find the link through Finder -> Applications -> Utilities -> X11 # Now you're ready to install a package manager. I recommend Fink,[fink.sf.net] since it's based on Debian's dpkg system, the packages are easy to make, and I've made a few of them too. # See [[Some Productive Programs]] for useful GNU software. # Don't forget TexShop [http://mirror.ctan.org/systems/mac/mactex/MacTeX.pkg] [http://pages.uoregon.edu/koch/texshop/obtaining.html], Keynote, and Pages for papers, presentations, and posters. #* Just drag TexShop to the Applications Folder. #* Apple and MS software is available from the Library computer support desk here at USF #* These often work much better than the port of Powerpoint because of the slowness of MS font rendering on the Mac. f0f9dfeeef2e17081152a9c6cc50b028fb092c2c 60 59 2013-09-03T20:05:53Z David M. Rogers 2 wikitext text/x-wiki Quit awhile ago, Apple switched to BSD's kernel and libraries for the guts of its OSX. This means that you can already access the Unix terminal from the Utilities folder. Newer versions (like 10.8 here) are making some of those developer-friendly features harder to find - so let's briefly summarize how to get them back. # Start with basic Apple setup: mail, calendar and sync. These are pretty easy due to their large user base. #* To get multiple workspaces, you have to click the "+" on the top right of the "Mission Control" screen. # Install the XCode package - https://developer.apple.com/xcode/ #* word has it that Starting with Xcode 4.3 - you must now manually install command line tools from Xcode menu > Preferences > Downloads #* Apple is working hard to update the compiler toolchain by rewriting the monolithic GCC into a programming-language friendly LLVM framework with the CLANG compiler, so you'll see that GCC dependence is shrinking and LLVM is installed. #* or, just install the cmd line to begin: [https://developer.apple.com/downloads/index.action?=Command%20Line%20Tools%20%28OS%20X%20Mountain%20Lion%29] #* or directly at [http://devimages.apple.com/downloads/xcode/command_line_tools_for_xcode_10_8_late_july_2012.dmg] #** this can be installed without the giant XCode IDE, but some fink packages won't work (sic) # Install gfortran following the instructions at: [http://r.research.att.com/tools/] #* Use the CRAN mirror at: [http://cran.r-project.org/bin/macosx/tools/] #* I've found this package to work well. #* It says not to use the compilers from HPC... # Install X11 using XQuartz [http://xquartz.macosforge.org/] - or find the link through Finder -> Applications -> Utilities -> X11 # Now you're ready to install a package manager. I recommend Fink,[fink.sf.net] since it's based on Debian's dpkg system, the packages are easy to make, and I've made a few of them too. # See [[Some Productive Programs]] for useful GNU software. # Don't forget TexShop [http://mirror.ctan.org/systems/mac/mactex/MacTeX.pkg] [http://pages.uoregon.edu/koch/texshop/obtaining.html], Keynote, and Pages for papers, presentations, and posters. #* Just drag TexShop to the Applications Folder. #* Apple and MS software is available from the Library computer support desk here at USF #* These often work much better than the port of Powerpoint because of the slowness of MS font rendering on the Mac. 4877b2aa625bc402f6d2473a2daa91cba43652ba GradQuantumFall2013 0 15 61 56 2013-09-04T18:40:59Z David M. Rogers 2 updated first homework wikitext text/x-wiki <BIG>Graduate Quantum Mechanics</BIG> [[Media:CHM6938.005-syllabus.doc|Text Syllabus]] == Meeting Time == CHM 6938-005 (Quantum Mechanics I) will meet Mondays and Wednesdays from 10:45am-12:00pm in NES 104. The instructor may be reached anytime by phone 4-4298 or email (username: davidrogers on usf.edu). == Course Overview & Objectives == Nanoscience has already reached its natural quantum limit, bringing the 'spooky' behavior of quantum systems into the center of a revolution. This course will rigorously develop the fundamentals of quantum mechanics required for understanding the interplay of electricity and magnetism with electronic structure. By the end of the course, you will be able to determine which problems in chemistry and physics have an essentially quantum nature. For those that do, you will know the rules for formulating the solution mathematically and the tools and special tricks for completing the solution. You will also learn aspects of numerical solutions and partial differential equations that apply to many aspect of modern technology outside of QM. As a research course, you will be expected to finish with a high-level understanding of where to find worked projects similar to new and open questions, and to mix, match, and evaluate solution techniques before diving into differentiation or trial and error. == Grading & Due Dates == Your work will be graded based on homework assignments (80%) and one student project (20%). * Homework 1: Problems from Bes, 2007 Chapter 2 - due Monday, September 9 * Homework 2: TBA == Some Useful Preliminaries == Partial differential equations, linear algebra, Fourier series These will be reviewed in the course, but undergraduate calculus is required. == Textbooks == * Quantum Mechanics: A Modern and Concise Introductory Course, Daniel Bes (Springer, 2007 (2nd ed) or 2012 (3rd ed)) Bes gives an excellent survey of the myriad applications of QM, and is detailed enough to provide all the tools and intuition needed to do the math. It does as well as anyone should expect in getting at the whys and hows of the confusion that is quantum, including various manifestations of the measurement problem. [http://usf.catalog.fcla.edu/permalink.jsp?24SF020303747 eBook] * McQuarrie (Quantum Chemistry, 2nd ed., Univ. Sci. 2007) McQuarrie focuses in on molecular electronic structure, providing a chemistry compliment to Bes' physics-oriented book. It covers what we need to understand molecular computations, including spectroscopy, thermochemistry, Hartree-Fock and Slater determinants, molecular orbitals, density-functional theory. Leung and Marshall have written a solutions manual, Problems and Solutions for McQuarrie's QM, Univ. Sci., 2007. Both these texts are available at the library (possibly in course reserves), and purchasing them is not required for the course. === Other QM Texts === * Pauling (free book on archive.org) ** Early, but presciently maps out the next ~30 y. of developments * Atkins * Griffiths * Levine * Shankar (Principles of QM, 2nd ed., Plenum 1994) ** Introduces Quantization using commutation... * Landau & Lifschitz 3 & 4 * Advanced Quantum Mechanics, Dick Rainer (Springer, 2012) - chem/phys. * [http://usf.catalog.fcla.edu/permalink.jsp?24SF030655622 Bes, QM 2012 edition] == Course Outline == # for((i=0;i<120;i+=7)); do date -v8m -v26d -v+"$i"d; done (01) Aug 26 Class intro., failures of classical mechanics, Planck's hypothesis. [[Media:LectA.pdf|Notes]] Weeks 1-4 correspond roughly to Bes' Chapters 1-4 and Chapter 13 on the history of QM. Pages 11-28 of the [http://science.energy.gov/~/media/bes/pdf/reports/files/gc_rpt.pdf DOE Grand Challenges report] also make for great related reading. (02) Sep 2 (Mon. = Labor Day) Review of the Schrodinger equation, Heisenberg states and all that. Basic linear algebra. [[Media:notes.pdf|Typed Class Notes]] (03) Sep 9 One-dimensional problems - review of the potential well. New applications for the Helmholtz equation - bound and scattering states. (04) Sep 16 Applications of the Helmholtz equation, continued - tunneling, radioactive decay and diffraction. (05) Sep 23 Review of the harmonic oscillator and hydrogen atom, introduction to multi-particle statistics. Week 5 corresponds roughly to Bes' Chapters 6-7. (06) Sep 30 Mathematics of rotation and time-dependence. Introduction to spin. Weeks 6-7 correspond roughly to Bes' Chapter 5. (07) Oct 7 Angular momentum, applied to rotational (far infrared) spectroscopy electronic and nuclear spin in NMR. (08) Oct 14 More about those molecular orbitals, and calculations on the H<math>_2</math> atom. If quantum theory is exact, why do I need to choose a bunch of basis functions? (09) Oct 21 Perturbation theory calculations, also applied to H<math>_2</math>. Weeks 8-9 correspond roughly to Bes' Chapters 7-9. More material from McQuarrie will be brought in at this point. Topics past week 9 are tentative. (10) Oct 28 Electronic (UV) and vibrational (IR) polarizability. (11) Nov 4 Thermochemistry and molecular reactions. (12) Nov 11 (Mon. = Veteran's Day) Statistics of an electron gas. The Kohn-Sham decomposition and the resulting alphabet soup. (13) Nov 18 The continuing quest for the perfect functional. (14) Nov 25 (Fri. Nov 29 = Day after Thanksgiving) Chemical reactions and transition-state theory. (15) Dec 2 Emerging research areas in molecular physics simulation and statistics. (16) Dec 9 - final exam week == List of Group Study Topics == # Einstein, Podolsky and Rosen's paradox and Bell's inequality. # Bohm's quantum interpretation of quantum mechanics (see also Bell's later response) # Gaussian-type orbitals, exponents, and integrals for the H<math>_2</math> atom. # calculating electron hopping rates using the non-equilibrium Green's function method # Eyring's transition-state-theory and reaction diagrams using the empirical valence-bond method. # Formulation of QM expectations using path integrals # Numerical solution methods for 1D problems. Choose an interesting topic in groups of no more than 3 students by Friday, Oct. 4. [[Media:GroupAssignment.pdf |Group Assignment Instructions]] be19a082113021b628bfe1414fc5bfe342c0ef7a 62 61 2013-09-19T16:15:15Z David M. Rogers 2 /* Grading & Due Dates */ wikitext text/x-wiki <BIG>Graduate Quantum Mechanics</BIG> [[Media:CHM6938.005-syllabus.doc|Text Syllabus]] == Meeting Time == CHM 6938-005 (Quantum Mechanics I) will meet Mondays and Wednesdays from 10:45am-12:00pm in NES 104. The instructor may be reached anytime by phone 4-4298 or email (username: davidrogers on usf.edu). == Course Overview & Objectives == Nanoscience has already reached its natural quantum limit, bringing the 'spooky' behavior of quantum systems into the center of a revolution. This course will rigorously develop the fundamentals of quantum mechanics required for understanding the interplay of electricity and magnetism with electronic structure. By the end of the course, you will be able to determine which problems in chemistry and physics have an essentially quantum nature. For those that do, you will know the rules for formulating the solution mathematically and the tools and special tricks for completing the solution. You will also learn aspects of numerical solutions and partial differential equations that apply to many aspect of modern technology outside of QM. As a research course, you will be expected to finish with a high-level understanding of where to find worked projects similar to new and open questions, and to mix, match, and evaluate solution techniques before diving into differentiation or trial and error. == Grading & Due Dates == Your work will be graded based on homework assignments (80%) and one student project (20%). * Homework 1: Problems from Bes, 2007 Chapter 2 - due Monday, September 9 * [[Media:HW2.pdf|Homework 2]]: Problems based on Bes, Ch. 4 and 9 - due Monday, October 7 == Some Useful Preliminaries == Partial differential equations, linear algebra, Fourier series These will be reviewed in the course, but undergraduate calculus is required. == Textbooks == * Quantum Mechanics: A Modern and Concise Introductory Course, Daniel Bes (Springer, 2007 (2nd ed) or 2012 (3rd ed)) Bes gives an excellent survey of the myriad applications of QM, and is detailed enough to provide all the tools and intuition needed to do the math. It does as well as anyone should expect in getting at the whys and hows of the confusion that is quantum, including various manifestations of the measurement problem. [http://usf.catalog.fcla.edu/permalink.jsp?24SF020303747 eBook] * McQuarrie (Quantum Chemistry, 2nd ed., Univ. Sci. 2007) McQuarrie focuses in on molecular electronic structure, providing a chemistry compliment to Bes' physics-oriented book. It covers what we need to understand molecular computations, including spectroscopy, thermochemistry, Hartree-Fock and Slater determinants, molecular orbitals, density-functional theory. Leung and Marshall have written a solutions manual, Problems and Solutions for McQuarrie's QM, Univ. Sci., 2007. Both these texts are available at the library (possibly in course reserves), and purchasing them is not required for the course. === Other QM Texts === * Pauling (free book on archive.org) ** Early, but presciently maps out the next ~30 y. of developments * Atkins * Griffiths * Levine * Shankar (Principles of QM, 2nd ed., Plenum 1994) ** Introduces Quantization using commutation... * Landau & Lifschitz 3 & 4 * Advanced Quantum Mechanics, Dick Rainer (Springer, 2012) - chem/phys. * [http://usf.catalog.fcla.edu/permalink.jsp?24SF030655622 Bes, QM 2012 edition] == Course Outline == # for((i=0;i<120;i+=7)); do date -v8m -v26d -v+"$i"d; done (01) Aug 26 Class intro., failures of classical mechanics, Planck's hypothesis. [[Media:LectA.pdf|Notes]] Weeks 1-4 correspond roughly to Bes' Chapters 1-4 and Chapter 13 on the history of QM. Pages 11-28 of the [http://science.energy.gov/~/media/bes/pdf/reports/files/gc_rpt.pdf DOE Grand Challenges report] also make for great related reading. (02) Sep 2 (Mon. = Labor Day) Review of the Schrodinger equation, Heisenberg states and all that. Basic linear algebra. [[Media:notes.pdf|Typed Class Notes]] (03) Sep 9 One-dimensional problems - review of the potential well. New applications for the Helmholtz equation - bound and scattering states. (04) Sep 16 Applications of the Helmholtz equation, continued - tunneling, radioactive decay and diffraction. (05) Sep 23 Review of the harmonic oscillator and hydrogen atom, introduction to multi-particle statistics. Week 5 corresponds roughly to Bes' Chapters 6-7. (06) Sep 30 Mathematics of rotation and time-dependence. Introduction to spin. Weeks 6-7 correspond roughly to Bes' Chapter 5. (07) Oct 7 Angular momentum, applied to rotational (far infrared) spectroscopy electronic and nuclear spin in NMR. (08) Oct 14 More about those molecular orbitals, and calculations on the H<math>_2</math> atom. If quantum theory is exact, why do I need to choose a bunch of basis functions? (09) Oct 21 Perturbation theory calculations, also applied to H<math>_2</math>. Weeks 8-9 correspond roughly to Bes' Chapters 7-9. More material from McQuarrie will be brought in at this point. Topics past week 9 are tentative. (10) Oct 28 Electronic (UV) and vibrational (IR) polarizability. (11) Nov 4 Thermochemistry and molecular reactions. (12) Nov 11 (Mon. = Veteran's Day) Statistics of an electron gas. The Kohn-Sham decomposition and the resulting alphabet soup. (13) Nov 18 The continuing quest for the perfect functional. (14) Nov 25 (Fri. Nov 29 = Day after Thanksgiving) Chemical reactions and transition-state theory. (15) Dec 2 Emerging research areas in molecular physics simulation and statistics. (16) Dec 9 - final exam week == List of Group Study Topics == # Einstein, Podolsky and Rosen's paradox and Bell's inequality. # Bohm's quantum interpretation of quantum mechanics (see also Bell's later response) # Gaussian-type orbitals, exponents, and integrals for the H<math>_2</math> atom. # calculating electron hopping rates using the non-equilibrium Green's function method # Eyring's transition-state-theory and reaction diagrams using the empirical valence-bond method. # Formulation of QM expectations using path integrals # Numerical solution methods for 1D problems. Choose an interesting topic in groups of no more than 3 students by Friday, Oct. 4. [[Media:GroupAssignment.pdf |Group Assignment Instructions]] 7de9d8b3abb0e93f93d849f7d42d1749f4721caa 64 62 2013-09-19T16:16:49Z David M. Rogers 2 /* Grading & Due Dates */ wikitext text/x-wiki <BIG>Graduate Quantum Mechanics</BIG> [[Media:CHM6938.005-syllabus.doc|Text Syllabus]] == Meeting Time == CHM 6938-005 (Quantum Mechanics I) will meet Mondays and Wednesdays from 10:45am-12:00pm in NES 104. The instructor may be reached anytime by phone 4-4298 or email (username: davidrogers on usf.edu). == Course Overview & Objectives == Nanoscience has already reached its natural quantum limit, bringing the 'spooky' behavior of quantum systems into the center of a revolution. This course will rigorously develop the fundamentals of quantum mechanics required for understanding the interplay of electricity and magnetism with electronic structure. By the end of the course, you will be able to determine which problems in chemistry and physics have an essentially quantum nature. For those that do, you will know the rules for formulating the solution mathematically and the tools and special tricks for completing the solution. You will also learn aspects of numerical solutions and partial differential equations that apply to many aspect of modern technology outside of QM. As a research course, you will be expected to finish with a high-level understanding of where to find worked projects similar to new and open questions, and to mix, match, and evaluate solution techniques before diving into differentiation or trial and error. == Grading & Due Dates == Your work will be graded based on homework assignments (80%) and one student project (20%). * Homework 1: Problems from Bes, 2007 Chapter 2 - due Monday, September 9 * [[Media:HW2.pdf|Homework 2]]: Problems based on Bes, Ch. 4, 5 and 9 - due Monday, October 7 == Some Useful Preliminaries == Partial differential equations, linear algebra, Fourier series These will be reviewed in the course, but undergraduate calculus is required. == Textbooks == * Quantum Mechanics: A Modern and Concise Introductory Course, Daniel Bes (Springer, 2007 (2nd ed) or 2012 (3rd ed)) Bes gives an excellent survey of the myriad applications of QM, and is detailed enough to provide all the tools and intuition needed to do the math. It does as well as anyone should expect in getting at the whys and hows of the confusion that is quantum, including various manifestations of the measurement problem. [http://usf.catalog.fcla.edu/permalink.jsp?24SF020303747 eBook] * McQuarrie (Quantum Chemistry, 2nd ed., Univ. Sci. 2007) McQuarrie focuses in on molecular electronic structure, providing a chemistry compliment to Bes' physics-oriented book. It covers what we need to understand molecular computations, including spectroscopy, thermochemistry, Hartree-Fock and Slater determinants, molecular orbitals, density-functional theory. Leung and Marshall have written a solutions manual, Problems and Solutions for McQuarrie's QM, Univ. Sci., 2007. Both these texts are available at the library (possibly in course reserves), and purchasing them is not required for the course. === Other QM Texts === * Pauling (free book on archive.org) ** Early, but presciently maps out the next ~30 y. of developments * Atkins * Griffiths * Levine * Shankar (Principles of QM, 2nd ed., Plenum 1994) ** Introduces Quantization using commutation... * Landau & Lifschitz 3 & 4 * Advanced Quantum Mechanics, Dick Rainer (Springer, 2012) - chem/phys. * [http://usf.catalog.fcla.edu/permalink.jsp?24SF030655622 Bes, QM 2012 edition] == Course Outline == # for((i=0;i<120;i+=7)); do date -v8m -v26d -v+"$i"d; done (01) Aug 26 Class intro., failures of classical mechanics, Planck's hypothesis. [[Media:LectA.pdf|Notes]] Weeks 1-4 correspond roughly to Bes' Chapters 1-4 and Chapter 13 on the history of QM. Pages 11-28 of the [http://science.energy.gov/~/media/bes/pdf/reports/files/gc_rpt.pdf DOE Grand Challenges report] also make for great related reading. (02) Sep 2 (Mon. = Labor Day) Review of the Schrodinger equation, Heisenberg states and all that. Basic linear algebra. [[Media:notes.pdf|Typed Class Notes]] (03) Sep 9 One-dimensional problems - review of the potential well. New applications for the Helmholtz equation - bound and scattering states. (04) Sep 16 Applications of the Helmholtz equation, continued - tunneling, radioactive decay and diffraction. (05) Sep 23 Review of the harmonic oscillator and hydrogen atom, introduction to multi-particle statistics. Week 5 corresponds roughly to Bes' Chapters 6-7. (06) Sep 30 Mathematics of rotation and time-dependence. Introduction to spin. Weeks 6-7 correspond roughly to Bes' Chapter 5. (07) Oct 7 Angular momentum, applied to rotational (far infrared) spectroscopy electronic and nuclear spin in NMR. (08) Oct 14 More about those molecular orbitals, and calculations on the H<math>_2</math> atom. If quantum theory is exact, why do I need to choose a bunch of basis functions? (09) Oct 21 Perturbation theory calculations, also applied to H<math>_2</math>. Weeks 8-9 correspond roughly to Bes' Chapters 7-9. More material from McQuarrie will be brought in at this point. Topics past week 9 are tentative. (10) Oct 28 Electronic (UV) and vibrational (IR) polarizability. (11) Nov 4 Thermochemistry and molecular reactions. (12) Nov 11 (Mon. = Veteran's Day) Statistics of an electron gas. The Kohn-Sham decomposition and the resulting alphabet soup. (13) Nov 18 The continuing quest for the perfect functional. (14) Nov 25 (Fri. Nov 29 = Day after Thanksgiving) Chemical reactions and transition-state theory. (15) Dec 2 Emerging research areas in molecular physics simulation and statistics. (16) Dec 9 - final exam week == List of Group Study Topics == # Einstein, Podolsky and Rosen's paradox and Bell's inequality. # Bohm's quantum interpretation of quantum mechanics (see also Bell's later response) # Gaussian-type orbitals, exponents, and integrals for the H<math>_2</math> atom. # calculating electron hopping rates using the non-equilibrium Green's function method # Eyring's transition-state-theory and reaction diagrams using the empirical valence-bond method. # Formulation of QM expectations using path integrals # Numerical solution methods for 1D problems. Choose an interesting topic in groups of no more than 3 students by Friday, Oct. 4. [[Media:GroupAssignment.pdf |Group Assignment Instructions]] b728de5449fcc9c61a40b80d118420d9836348ed 65 64 2013-09-19T16:29:42Z David M. Rogers 2 /* Course Outline */ wikitext text/x-wiki <BIG>Graduate Quantum Mechanics</BIG> [[Media:CHM6938.005-syllabus.doc|Text Syllabus]] == Meeting Time == CHM 6938-005 (Quantum Mechanics I) will meet Mondays and Wednesdays from 10:45am-12:00pm in NES 104. The instructor may be reached anytime by phone 4-4298 or email (username: davidrogers on usf.edu). == Course Overview & Objectives == Nanoscience has already reached its natural quantum limit, bringing the 'spooky' behavior of quantum systems into the center of a revolution. This course will rigorously develop the fundamentals of quantum mechanics required for understanding the interplay of electricity and magnetism with electronic structure. By the end of the course, you will be able to determine which problems in chemistry and physics have an essentially quantum nature. For those that do, you will know the rules for formulating the solution mathematically and the tools and special tricks for completing the solution. You will also learn aspects of numerical solutions and partial differential equations that apply to many aspect of modern technology outside of QM. As a research course, you will be expected to finish with a high-level understanding of where to find worked projects similar to new and open questions, and to mix, match, and evaluate solution techniques before diving into differentiation or trial and error. == Grading & Due Dates == Your work will be graded based on homework assignments (80%) and one student project (20%). * Homework 1: Problems from Bes, 2007 Chapter 2 - due Monday, September 9 * [[Media:HW2.pdf|Homework 2]]: Problems based on Bes, Ch. 4, 5 and 9 - due Monday, October 7 == Some Useful Preliminaries == Partial differential equations, linear algebra, Fourier series These will be reviewed in the course, but undergraduate calculus is required. == Textbooks == * Quantum Mechanics: A Modern and Concise Introductory Course, Daniel Bes (Springer, 2007 (2nd ed) or 2012 (3rd ed)) Bes gives an excellent survey of the myriad applications of QM, and is detailed enough to provide all the tools and intuition needed to do the math. It does as well as anyone should expect in getting at the whys and hows of the confusion that is quantum, including various manifestations of the measurement problem. [http://usf.catalog.fcla.edu/permalink.jsp?24SF020303747 eBook] * McQuarrie (Quantum Chemistry, 2nd ed., Univ. Sci. 2007) McQuarrie focuses in on molecular electronic structure, providing a chemistry compliment to Bes' physics-oriented book. It covers what we need to understand molecular computations, including spectroscopy, thermochemistry, Hartree-Fock and Slater determinants, molecular orbitals, density-functional theory. Leung and Marshall have written a solutions manual, Problems and Solutions for McQuarrie's QM, Univ. Sci., 2007. Both these texts are available at the library (possibly in course reserves), and purchasing them is not required for the course. === Other QM Texts === * Pauling (free book on archive.org) ** Early, but presciently maps out the next ~30 y. of developments * Atkins * Griffiths * Levine * Shankar (Principles of QM, 2nd ed., Plenum 1994) ** Introduces Quantization using commutation... * Landau & Lifschitz 3 & 4 * Advanced Quantum Mechanics, Dick Rainer (Springer, 2012) - chem/phys. * [http://usf.catalog.fcla.edu/permalink.jsp?24SF030655622 Bes, QM 2012 edition] == Course Outline == # for((i=0;i<120;i+=7)); do date -v8m -v26d -v+"$i"d; done (01) Aug 26 Class intro., failures of classical mechanics, Planck's hypothesis. [[Media:LectA.pdf|Notes]] Weeks 1-4 correspond roughly to Bes' Chapters 1-4 and Chapter 13 on the history of QM. Pages 11-28 of the [http://science.energy.gov/~/media/bes/pdf/reports/files/gc_rpt.pdf DOE Grand Challenges report] also make for great related reading. (02) Sep 2 (Mon. = Labor Day) Review of the Schrodinger equation, Heisenberg states and all that. Basic linear algebra. [[Media:notes.pdf|Typed Class Notes]] (03) Sep 9 Eigenvalue decompositions and measurements in QM. (04) Sep 16 Worked solutions to HW1. (05) Sep 23 One-dimensional problems - review of the potential well. New applications for the Helmholtz equation - bound and scattering states. Variational solutions. <!-- Perturbation theory calculations, also applied to H<math>_2</math>. --> Interspersed with background on group projects. (06) Sep 30 Applications of the Helmholtz equation, continued - tunneling, radioactive decay and diffraction. Time-dependent perturbation theory and the interpretation of off-diagonal matrix elements. This covers material in Bes, Ch. 9. (07) Oct 7 Mathematics of rotation. Application to rotational (far infrared) spectroscopy. Week 7 corresponds roughly to Bes' Chapter 5 and rotational spectroscopy in McQuarrie. (08) Oct 14 <!-- Review of the harmonic oscillator and hydrogen atom, introduction to multi-particle statistics. Week 8 corresponds roughly to Bes' Chapters 6-7. --> Electronic (UV) and vibrational (IR) polarizability. Molecular point groups and symmetry properties. (09) Oct 21 More about those molecular orbitals, and calculations on the H<math>_2</math> atom. If quantum theory is exact, why do I need to choose a bunch of basis functions? <!-- Weeks 8-9 correspond roughly to Bes' Chapters 7-9. More material from McQuarrie will be brought in at this point. --> (10) Oct 28 Topics past week 9 are tentative. (11) Nov 4 QM software intro. (12) Nov 11 (Mon. = Veteran's Day) Statistics of an electron gas. The Kohn-Sham decomposition and the resulting alphabet soup. (13) Nov 18 The continuing quest for the perfect functional. (14) Nov 25 (Fri. Nov 29 = Day after Thanksgiving) Chemical reactions and transition-state theory. (15) Dec 2 Emerging research areas in molecular physics simulation and statistics. (16) Dec 9 - final exam week == List of Group Study Topics == # Einstein, Podolsky and Rosen's paradox and Bell's inequality. # Bohm's quantum interpretation of quantum mechanics (see also Bell's later response) # Gaussian-type orbitals, exponents, and integrals for the H<math>_2</math> atom. # calculating electron hopping rates using the non-equilibrium Green's function method # Eyring's transition-state-theory and reaction diagrams using the empirical valence-bond method. # Formulation of QM expectations using path integrals # Numerical solution methods for 1D problems. Choose an interesting topic in groups of no more than 3 students by Friday, Oct. 4. [[Media:GroupAssignment.pdf |Group Assignment Instructions]] f5b2803818bdfeb146f2887db26a96f4a654f9e2 71 65 2013-09-24T17:04:40Z David M. Rogers 2 /* List of Group Study Topics */ wikitext text/x-wiki <BIG>Graduate Quantum Mechanics</BIG> [[Media:CHM6938.005-syllabus.doc|Text Syllabus]] == Meeting Time == CHM 6938-005 (Quantum Mechanics I) will meet Mondays and Wednesdays from 10:45am-12:00pm in NES 104. The instructor may be reached anytime by phone 4-4298 or email (username: davidrogers on usf.edu). == Course Overview & Objectives == Nanoscience has already reached its natural quantum limit, bringing the 'spooky' behavior of quantum systems into the center of a revolution. This course will rigorously develop the fundamentals of quantum mechanics required for understanding the interplay of electricity and magnetism with electronic structure. By the end of the course, you will be able to determine which problems in chemistry and physics have an essentially quantum nature. For those that do, you will know the rules for formulating the solution mathematically and the tools and special tricks for completing the solution. You will also learn aspects of numerical solutions and partial differential equations that apply to many aspect of modern technology outside of QM. As a research course, you will be expected to finish with a high-level understanding of where to find worked projects similar to new and open questions, and to mix, match, and evaluate solution techniques before diving into differentiation or trial and error. == Grading & Due Dates == Your work will be graded based on homework assignments (80%) and one student project (20%). * Homework 1: Problems from Bes, 2007 Chapter 2 - due Monday, September 9 * [[Media:HW2.pdf|Homework 2]]: Problems based on Bes, Ch. 4, 5 and 9 - due Monday, October 7 == Some Useful Preliminaries == Partial differential equations, linear algebra, Fourier series These will be reviewed in the course, but undergraduate calculus is required. == Textbooks == * Quantum Mechanics: A Modern and Concise Introductory Course, Daniel Bes (Springer, 2007 (2nd ed) or 2012 (3rd ed)) Bes gives an excellent survey of the myriad applications of QM, and is detailed enough to provide all the tools and intuition needed to do the math. It does as well as anyone should expect in getting at the whys and hows of the confusion that is quantum, including various manifestations of the measurement problem. [http://usf.catalog.fcla.edu/permalink.jsp?24SF020303747 eBook] * McQuarrie (Quantum Chemistry, 2nd ed., Univ. Sci. 2007) McQuarrie focuses in on molecular electronic structure, providing a chemistry compliment to Bes' physics-oriented book. It covers what we need to understand molecular computations, including spectroscopy, thermochemistry, Hartree-Fock and Slater determinants, molecular orbitals, density-functional theory. Leung and Marshall have written a solutions manual, Problems and Solutions for McQuarrie's QM, Univ. Sci., 2007. Both these texts are available at the library (possibly in course reserves), and purchasing them is not required for the course. === Other QM Texts === * Pauling (free book on archive.org) ** Early, but presciently maps out the next ~30 y. of developments * Atkins * Griffiths * Levine * Shankar (Principles of QM, 2nd ed., Plenum 1994) ** Introduces Quantization using commutation... * Landau & Lifschitz 3 & 4 * Advanced Quantum Mechanics, Dick Rainer (Springer, 2012) - chem/phys. * [http://usf.catalog.fcla.edu/permalink.jsp?24SF030655622 Bes, QM 2012 edition] == Course Outline == # for((i=0;i<120;i+=7)); do date -v8m -v26d -v+"$i"d; done (01) Aug 26 Class intro., failures of classical mechanics, Planck's hypothesis. [[Media:LectA.pdf|Notes]] Weeks 1-4 correspond roughly to Bes' Chapters 1-4 and Chapter 13 on the history of QM. Pages 11-28 of the [http://science.energy.gov/~/media/bes/pdf/reports/files/gc_rpt.pdf DOE Grand Challenges report] also make for great related reading. (02) Sep 2 (Mon. = Labor Day) Review of the Schrodinger equation, Heisenberg states and all that. Basic linear algebra. [[Media:notes.pdf|Typed Class Notes]] (03) Sep 9 Eigenvalue decompositions and measurements in QM. (04) Sep 16 Worked solutions to HW1. (05) Sep 23 One-dimensional problems - review of the potential well. New applications for the Helmholtz equation - bound and scattering states. Variational solutions. <!-- Perturbation theory calculations, also applied to H<math>_2</math>. --> Interspersed with background on group projects. (06) Sep 30 Applications of the Helmholtz equation, continued - tunneling, radioactive decay and diffraction. Time-dependent perturbation theory and the interpretation of off-diagonal matrix elements. This covers material in Bes, Ch. 9. (07) Oct 7 Mathematics of rotation. Application to rotational (far infrared) spectroscopy. Week 7 corresponds roughly to Bes' Chapter 5 and rotational spectroscopy in McQuarrie. (08) Oct 14 <!-- Review of the harmonic oscillator and hydrogen atom, introduction to multi-particle statistics. Week 8 corresponds roughly to Bes' Chapters 6-7. --> Electronic (UV) and vibrational (IR) polarizability. Molecular point groups and symmetry properties. (09) Oct 21 More about those molecular orbitals, and calculations on the H<math>_2</math> atom. If quantum theory is exact, why do I need to choose a bunch of basis functions? <!-- Weeks 8-9 correspond roughly to Bes' Chapters 7-9. More material from McQuarrie will be brought in at this point. --> (10) Oct 28 Topics past week 9 are tentative. (11) Nov 4 QM software intro. (12) Nov 11 (Mon. = Veteran's Day) Statistics of an electron gas. The Kohn-Sham decomposition and the resulting alphabet soup. (13) Nov 18 The continuing quest for the perfect functional. (14) Nov 25 (Fri. Nov 29 = Day after Thanksgiving) Chemical reactions and transition-state theory. (15) Dec 2 Emerging research areas in molecular physics simulation and statistics. (16) Dec 9 - final exam week == List of Group Study Topics == # Einstein, Podolsky and Rosen's paradox and Bell's inequality. # [http://prola.aps.org/toc/PR/v85/i2 Bohm's quantum interpretation of quantum mechanics] (see also [http://link.springer.com/article/10.1007/BF01889272 Bell's later response]) # [http://shodor.org/succeed-1.0/programs/compchem98/labs/sto/ Gaussian-type orbitals, exponents, and integrals][http://www.computationalscience.org/ccce/Lesson2/02_lab_basissets.pdf] for the H<math>_2</math> atom. # Calculating electron hopping rates using the [http://www.jetp.ac.ru/cgi-bin/dn/e_020_04_1018.pdf Non-equilibrium Green's function] method #* see Keldysh, "Diagram Technique for Nonequilibrium Processes," Keldysh, Sov. Phys. 1965. and Ch. 10 of Physical Kinetics, Lifshitz # Eyring's [http://jcp.aip.org/resource/1/jcpsa6/v3/i2/p107_s1 transition-state-theory][http://dx.doi.org/10.1021/cr60056a006] and reaction diagrams using [http://en.wikipedia.org/wiki/Marcus_theory Marcus Theory]. # Formulation of QM expectations using path integrals # Numerical solution methods for 1D problems. Choose an interesting topic in groups of no more than 3 students by Friday, Oct. 4. [[Media:GroupAssignment.pdf |Group Assignment Instructions]] 321b7f2e32acb6ddca8b873516d30835fd0cea4f 72 71 2013-10-16T13:37:04Z David M. Rogers 2 /* List of Group Study Topics */ wikitext text/x-wiki <BIG>Graduate Quantum Mechanics</BIG> [[Media:CHM6938.005-syllabus.doc|Text Syllabus]] == Meeting Time == CHM 6938-005 (Quantum Mechanics I) will meet Mondays and Wednesdays from 10:45am-12:00pm in NES 104. The instructor may be reached anytime by phone 4-4298 or email (username: davidrogers on usf.edu). == Course Overview & Objectives == Nanoscience has already reached its natural quantum limit, bringing the 'spooky' behavior of quantum systems into the center of a revolution. This course will rigorously develop the fundamentals of quantum mechanics required for understanding the interplay of electricity and magnetism with electronic structure. By the end of the course, you will be able to determine which problems in chemistry and physics have an essentially quantum nature. For those that do, you will know the rules for formulating the solution mathematically and the tools and special tricks for completing the solution. You will also learn aspects of numerical solutions and partial differential equations that apply to many aspect of modern technology outside of QM. As a research course, you will be expected to finish with a high-level understanding of where to find worked projects similar to new and open questions, and to mix, match, and evaluate solution techniques before diving into differentiation or trial and error. == Grading & Due Dates == Your work will be graded based on homework assignments (80%) and one student project (20%). * Homework 1: Problems from Bes, 2007 Chapter 2 - due Monday, September 9 * [[Media:HW2.pdf|Homework 2]]: Problems based on Bes, Ch. 4, 5 and 9 - due Monday, October 7 == Some Useful Preliminaries == Partial differential equations, linear algebra, Fourier series These will be reviewed in the course, but undergraduate calculus is required. == Textbooks == * Quantum Mechanics: A Modern and Concise Introductory Course, Daniel Bes (Springer, 2007 (2nd ed) or 2012 (3rd ed)) Bes gives an excellent survey of the myriad applications of QM, and is detailed enough to provide all the tools and intuition needed to do the math. It does as well as anyone should expect in getting at the whys and hows of the confusion that is quantum, including various manifestations of the measurement problem. [http://usf.catalog.fcla.edu/permalink.jsp?24SF020303747 eBook] * McQuarrie (Quantum Chemistry, 2nd ed., Univ. Sci. 2007) McQuarrie focuses in on molecular electronic structure, providing a chemistry compliment to Bes' physics-oriented book. It covers what we need to understand molecular computations, including spectroscopy, thermochemistry, Hartree-Fock and Slater determinants, molecular orbitals, density-functional theory. Leung and Marshall have written a solutions manual, Problems and Solutions for McQuarrie's QM, Univ. Sci., 2007. Both these texts are available at the library (possibly in course reserves), and purchasing them is not required for the course. === Other QM Texts === * Pauling (free book on archive.org) ** Early, but presciently maps out the next ~30 y. of developments * Atkins * Griffiths * Levine * Shankar (Principles of QM, 2nd ed., Plenum 1994) ** Introduces Quantization using commutation... * Landau & Lifschitz 3 & 4 * Advanced Quantum Mechanics, Dick Rainer (Springer, 2012) - chem/phys. * [http://usf.catalog.fcla.edu/permalink.jsp?24SF030655622 Bes, QM 2012 edition] == Course Outline == # for((i=0;i<120;i+=7)); do date -v8m -v26d -v+"$i"d; done (01) Aug 26 Class intro., failures of classical mechanics, Planck's hypothesis. [[Media:LectA.pdf|Notes]] Weeks 1-4 correspond roughly to Bes' Chapters 1-4 and Chapter 13 on the history of QM. Pages 11-28 of the [http://science.energy.gov/~/media/bes/pdf/reports/files/gc_rpt.pdf DOE Grand Challenges report] also make for great related reading. (02) Sep 2 (Mon. = Labor Day) Review of the Schrodinger equation, Heisenberg states and all that. Basic linear algebra. [[Media:notes.pdf|Typed Class Notes]] (03) Sep 9 Eigenvalue decompositions and measurements in QM. (04) Sep 16 Worked solutions to HW1. (05) Sep 23 One-dimensional problems - review of the potential well. New applications for the Helmholtz equation - bound and scattering states. Variational solutions. <!-- Perturbation theory calculations, also applied to H<math>_2</math>. --> Interspersed with background on group projects. (06) Sep 30 Applications of the Helmholtz equation, continued - tunneling, radioactive decay and diffraction. Time-dependent perturbation theory and the interpretation of off-diagonal matrix elements. This covers material in Bes, Ch. 9. (07) Oct 7 Mathematics of rotation. Application to rotational (far infrared) spectroscopy. Week 7 corresponds roughly to Bes' Chapter 5 and rotational spectroscopy in McQuarrie. (08) Oct 14 <!-- Review of the harmonic oscillator and hydrogen atom, introduction to multi-particle statistics. Week 8 corresponds roughly to Bes' Chapters 6-7. --> Electronic (UV) and vibrational (IR) polarizability. Molecular point groups and symmetry properties. (09) Oct 21 More about those molecular orbitals, and calculations on the H<math>_2</math> atom. If quantum theory is exact, why do I need to choose a bunch of basis functions? <!-- Weeks 8-9 correspond roughly to Bes' Chapters 7-9. More material from McQuarrie will be brought in at this point. --> (10) Oct 28 Topics past week 9 are tentative. (11) Nov 4 QM software intro. (12) Nov 11 (Mon. = Veteran's Day) Statistics of an electron gas. The Kohn-Sham decomposition and the resulting alphabet soup. (13) Nov 18 The continuing quest for the perfect functional. (14) Nov 25 (Fri. Nov 29 = Day after Thanksgiving) Chemical reactions and transition-state theory. (15) Dec 2 Emerging research areas in molecular physics simulation and statistics. (16) Dec 9 - final exam week == List of Group Study Topics == # Einstein, Podolsky and Rosen's paradox and Bell's inequality. # [http://prola.aps.org/toc/PR/v85/i2 Bohm's quantum interpretation of quantum mechanics] (see also [http://link.springer.com/article/10.1007/BF01889272 Bell's later response]) # [http://shodor.org/succeed-1.0/programs/compchem98/labs/sto/ Gaussian-type orbitals, exponents, and integrals][http://www.computationalscience.org/ccce/Lesson2/02_lab_basissets.pdf] for the H<math>_2</math> atom. # Calculating electron hopping rates using the [http://www.jetp.ac.ru/cgi-bin/dn/e_020_04_1018.pdf Non-equilibrium Green's function] method #* see Keldysh, "Diagram Technique for Nonequilibrium Processes," Keldysh, Sov. Phys. 1965. and Ch. 10 of Physical Kinetics, Lifshitz # Eyring's [http://scitation.aip.org.ezproxy.lib.usf.edu/content/aip/journal/jcp/3/2/10.1063/1.1749604 transition-state-theory][http://dx.doi.org/10.1021/cr60056a006] and reaction diagrams using [http://en.wikipedia.org/wiki/Marcus_theory Marcus Theory]. # Formulation of QM expectations using path integrals # Numerical solution methods for 1D problems. Choose an interesting topic in groups of no more than 3 students by Friday, Oct. 4. [[Media:GroupAssignment.pdf |Group Assignment Instructions]] 403e2d099ba88deab5fcbccac8254d7d1c5cf641 73 72 2013-10-18T14:48:46Z David M. Rogers 2 /* List of Group Study Topics */ wikitext text/x-wiki <BIG>Graduate Quantum Mechanics</BIG> [[Media:CHM6938.005-syllabus.doc|Text Syllabus]] == Meeting Time == CHM 6938-005 (Quantum Mechanics I) will meet Mondays and Wednesdays from 10:45am-12:00pm in NES 104. The instructor may be reached anytime by phone 4-4298 or email (username: davidrogers on usf.edu). == Course Overview & Objectives == Nanoscience has already reached its natural quantum limit, bringing the 'spooky' behavior of quantum systems into the center of a revolution. This course will rigorously develop the fundamentals of quantum mechanics required for understanding the interplay of electricity and magnetism with electronic structure. By the end of the course, you will be able to determine which problems in chemistry and physics have an essentially quantum nature. For those that do, you will know the rules for formulating the solution mathematically and the tools and special tricks for completing the solution. You will also learn aspects of numerical solutions and partial differential equations that apply to many aspect of modern technology outside of QM. As a research course, you will be expected to finish with a high-level understanding of where to find worked projects similar to new and open questions, and to mix, match, and evaluate solution techniques before diving into differentiation or trial and error. == Grading & Due Dates == Your work will be graded based on homework assignments (80%) and one student project (20%). * Homework 1: Problems from Bes, 2007 Chapter 2 - due Monday, September 9 * [[Media:HW2.pdf|Homework 2]]: Problems based on Bes, Ch. 4, 5 and 9 - due Monday, October 7 == Some Useful Preliminaries == Partial differential equations, linear algebra, Fourier series These will be reviewed in the course, but undergraduate calculus is required. == Textbooks == * Quantum Mechanics: A Modern and Concise Introductory Course, Daniel Bes (Springer, 2007 (2nd ed) or 2012 (3rd ed)) Bes gives an excellent survey of the myriad applications of QM, and is detailed enough to provide all the tools and intuition needed to do the math. It does as well as anyone should expect in getting at the whys and hows of the confusion that is quantum, including various manifestations of the measurement problem. [http://usf.catalog.fcla.edu/permalink.jsp?24SF020303747 eBook] * McQuarrie (Quantum Chemistry, 2nd ed., Univ. Sci. 2007) McQuarrie focuses in on molecular electronic structure, providing a chemistry compliment to Bes' physics-oriented book. It covers what we need to understand molecular computations, including spectroscopy, thermochemistry, Hartree-Fock and Slater determinants, molecular orbitals, density-functional theory. Leung and Marshall have written a solutions manual, Problems and Solutions for McQuarrie's QM, Univ. Sci., 2007. Both these texts are available at the library (possibly in course reserves), and purchasing them is not required for the course. === Other QM Texts === * Pauling (free book on archive.org) ** Early, but presciently maps out the next ~30 y. of developments * Atkins * Griffiths * Levine * Shankar (Principles of QM, 2nd ed., Plenum 1994) ** Introduces Quantization using commutation... * Landau & Lifschitz 3 & 4 * Advanced Quantum Mechanics, Dick Rainer (Springer, 2012) - chem/phys. * [http://usf.catalog.fcla.edu/permalink.jsp?24SF030655622 Bes, QM 2012 edition] == Course Outline == # for((i=0;i<120;i+=7)); do date -v8m -v26d -v+"$i"d; done (01) Aug 26 Class intro., failures of classical mechanics, Planck's hypothesis. [[Media:LectA.pdf|Notes]] Weeks 1-4 correspond roughly to Bes' Chapters 1-4 and Chapter 13 on the history of QM. Pages 11-28 of the [http://science.energy.gov/~/media/bes/pdf/reports/files/gc_rpt.pdf DOE Grand Challenges report] also make for great related reading. (02) Sep 2 (Mon. = Labor Day) Review of the Schrodinger equation, Heisenberg states and all that. Basic linear algebra. [[Media:notes.pdf|Typed Class Notes]] (03) Sep 9 Eigenvalue decompositions and measurements in QM. (04) Sep 16 Worked solutions to HW1. (05) Sep 23 One-dimensional problems - review of the potential well. New applications for the Helmholtz equation - bound and scattering states. Variational solutions. <!-- Perturbation theory calculations, also applied to H<math>_2</math>. --> Interspersed with background on group projects. (06) Sep 30 Applications of the Helmholtz equation, continued - tunneling, radioactive decay and diffraction. Time-dependent perturbation theory and the interpretation of off-diagonal matrix elements. This covers material in Bes, Ch. 9. (07) Oct 7 Mathematics of rotation. Application to rotational (far infrared) spectroscopy. Week 7 corresponds roughly to Bes' Chapter 5 and rotational spectroscopy in McQuarrie. (08) Oct 14 <!-- Review of the harmonic oscillator and hydrogen atom, introduction to multi-particle statistics. Week 8 corresponds roughly to Bes' Chapters 6-7. --> Electronic (UV) and vibrational (IR) polarizability. Molecular point groups and symmetry properties. (09) Oct 21 More about those molecular orbitals, and calculations on the H<math>_2</math> atom. If quantum theory is exact, why do I need to choose a bunch of basis functions? <!-- Weeks 8-9 correspond roughly to Bes' Chapters 7-9. More material from McQuarrie will be brought in at this point. --> (10) Oct 28 Topics past week 9 are tentative. (11) Nov 4 QM software intro. (12) Nov 11 (Mon. = Veteran's Day) Statistics of an electron gas. The Kohn-Sham decomposition and the resulting alphabet soup. (13) Nov 18 The continuing quest for the perfect functional. (14) Nov 25 (Fri. Nov 29 = Day after Thanksgiving) Chemical reactions and transition-state theory. (15) Dec 2 Emerging research areas in molecular physics simulation and statistics. (16) Dec 9 - final exam week == List of Group Study Topics == # Einstein, Podolsky and Rosen's paradox and Bell's inequality. # [http://prola.aps.org/toc/PR/v85/i2 Bohm's quantum interpretation of quantum mechanics] (see also [http://link.springer.com/article/10.1007/BF01889272 Bell's later response]) # [http://shodor.org/succeed-1.0/programs/compchem98/labs/sto/ Gaussian-type orbitals, exponents, and integrals][http://www.computationalscience.org/ccce/Lesson2/02_lab_basissets.pdf] for the H<math>_2</math> atom. # Calculating electron hopping rates using the [http://www.jetp.ac.ru/cgi-bin/dn/e_020_04_1018.pdf Non-equilibrium Green's function] method #* see Keldysh, "Diagram Technique for Nonequilibrium Processes," Keldysh, Sov. Phys. 1965. and Ch. 10 of Physical Kinetics, Lifshitz # Eyring's [http://scitation.aip.org.ezproxy.lib.usf.edu/content/aip/journal/jcp/3/2/10.1063/1.1749604 transition-state-theory][http://dx.doi.org/10.1021/cr60056a006] and reaction diagrams using [http://en.wikipedia.org/wiki/Marcus_theory Marcus Theory] lit ref: [http://dx.doi.org/10.1017/S0033583501003730 Warshel and Parson]. # Formulation of QM expectations using path integrals # Numerical solution methods for 1D problems. Choose an interesting topic in groups of no more than 3 students by Friday, Oct. 4. [[Media:GroupAssignment.pdf |Group Assignment Instructions]] a1a74ad03622f04e634c8ae1714917055e2fbe72 84 73 2013-10-31T18:54:28Z David M. Rogers 2 /* Grading & Due Dates */ wikitext text/x-wiki <BIG>Graduate Quantum Mechanics</BIG> [[Media:CHM6938.005-syllabus.doc|Text Syllabus]] == Meeting Time == CHM 6938-005 (Quantum Mechanics I) will meet Mondays and Wednesdays from 10:45am-12:00pm in NES 104. The instructor may be reached anytime by phone 4-4298 or email (username: davidrogers on usf.edu). == Course Overview & Objectives == Nanoscience has already reached its natural quantum limit, bringing the 'spooky' behavior of quantum systems into the center of a revolution. This course will rigorously develop the fundamentals of quantum mechanics required for understanding the interplay of electricity and magnetism with electronic structure. By the end of the course, you will be able to determine which problems in chemistry and physics have an essentially quantum nature. For those that do, you will know the rules for formulating the solution mathematically and the tools and special tricks for completing the solution. You will also learn aspects of numerical solutions and partial differential equations that apply to many aspect of modern technology outside of QM. As a research course, you will be expected to finish with a high-level understanding of where to find worked projects similar to new and open questions, and to mix, match, and evaluate solution techniques before diving into differentiation or trial and error. == Grading & Due Dates == Your work will be graded based on homework assignments (80%) and one student project (20%). * Homework 1: Problems from Bes, 2007 Chapter 2 - due Monday, September 9 * [[Media:HW2.pdf|Homework 2]]: Problems based on Bes, Ch. 4, 5 and 9 - due Monday, October 7 * [[Media:HW3.pdf|Homework 3]]: Worked Examples of the Schrodinger Equation - due Monday, October 28 == Some Useful Preliminaries == Partial differential equations, linear algebra, Fourier series These will be reviewed in the course, but undergraduate calculus is required. == Textbooks == * Quantum Mechanics: A Modern and Concise Introductory Course, Daniel Bes (Springer, 2007 (2nd ed) or 2012 (3rd ed)) Bes gives an excellent survey of the myriad applications of QM, and is detailed enough to provide all the tools and intuition needed to do the math. It does as well as anyone should expect in getting at the whys and hows of the confusion that is quantum, including various manifestations of the measurement problem. [http://usf.catalog.fcla.edu/permalink.jsp?24SF020303747 eBook] * McQuarrie (Quantum Chemistry, 2nd ed., Univ. Sci. 2007) McQuarrie focuses in on molecular electronic structure, providing a chemistry compliment to Bes' physics-oriented book. It covers what we need to understand molecular computations, including spectroscopy, thermochemistry, Hartree-Fock and Slater determinants, molecular orbitals, density-functional theory. Leung and Marshall have written a solutions manual, Problems and Solutions for McQuarrie's QM, Univ. Sci., 2007. Both these texts are available at the library (possibly in course reserves), and purchasing them is not required for the course. === Other QM Texts === * Pauling (free book on archive.org) ** Early, but presciently maps out the next ~30 y. of developments * Atkins * Griffiths * Levine * Shankar (Principles of QM, 2nd ed., Plenum 1994) ** Introduces Quantization using commutation... * Landau & Lifschitz 3 & 4 * Advanced Quantum Mechanics, Dick Rainer (Springer, 2012) - chem/phys. * [http://usf.catalog.fcla.edu/permalink.jsp?24SF030655622 Bes, QM 2012 edition] == Course Outline == # for((i=0;i<120;i+=7)); do date -v8m -v26d -v+"$i"d; done (01) Aug 26 Class intro., failures of classical mechanics, Planck's hypothesis. [[Media:LectA.pdf|Notes]] Weeks 1-4 correspond roughly to Bes' Chapters 1-4 and Chapter 13 on the history of QM. Pages 11-28 of the [http://science.energy.gov/~/media/bes/pdf/reports/files/gc_rpt.pdf DOE Grand Challenges report] also make for great related reading. (02) Sep 2 (Mon. = Labor Day) Review of the Schrodinger equation, Heisenberg states and all that. Basic linear algebra. [[Media:notes.pdf|Typed Class Notes]] (03) Sep 9 Eigenvalue decompositions and measurements in QM. (04) Sep 16 Worked solutions to HW1. (05) Sep 23 One-dimensional problems - review of the potential well. New applications for the Helmholtz equation - bound and scattering states. Variational solutions. <!-- Perturbation theory calculations, also applied to H<math>_2</math>. --> Interspersed with background on group projects. (06) Sep 30 Applications of the Helmholtz equation, continued - tunneling, radioactive decay and diffraction. Time-dependent perturbation theory and the interpretation of off-diagonal matrix elements. This covers material in Bes, Ch. 9. (07) Oct 7 Mathematics of rotation. Application to rotational (far infrared) spectroscopy. Week 7 corresponds roughly to Bes' Chapter 5 and rotational spectroscopy in McQuarrie. (08) Oct 14 <!-- Review of the harmonic oscillator and hydrogen atom, introduction to multi-particle statistics. Week 8 corresponds roughly to Bes' Chapters 6-7. --> Electronic (UV) and vibrational (IR) polarizability. Molecular point groups and symmetry properties. (09) Oct 21 More about those molecular orbitals, and calculations on the H<math>_2</math> atom. If quantum theory is exact, why do I need to choose a bunch of basis functions? <!-- Weeks 8-9 correspond roughly to Bes' Chapters 7-9. More material from McQuarrie will be brought in at this point. --> (10) Oct 28 Topics past week 9 are tentative. (11) Nov 4 QM software intro. (12) Nov 11 (Mon. = Veteran's Day) Statistics of an electron gas. The Kohn-Sham decomposition and the resulting alphabet soup. (13) Nov 18 The continuing quest for the perfect functional. (14) Nov 25 (Fri. Nov 29 = Day after Thanksgiving) Chemical reactions and transition-state theory. (15) Dec 2 Emerging research areas in molecular physics simulation and statistics. (16) Dec 9 - final exam week == List of Group Study Topics == # Einstein, Podolsky and Rosen's paradox and Bell's inequality. # [http://prola.aps.org/toc/PR/v85/i2 Bohm's quantum interpretation of quantum mechanics] (see also [http://link.springer.com/article/10.1007/BF01889272 Bell's later response]) # [http://shodor.org/succeed-1.0/programs/compchem98/labs/sto/ Gaussian-type orbitals, exponents, and integrals][http://www.computationalscience.org/ccce/Lesson2/02_lab_basissets.pdf] for the H<math>_2</math> atom. # Calculating electron hopping rates using the [http://www.jetp.ac.ru/cgi-bin/dn/e_020_04_1018.pdf Non-equilibrium Green's function] method #* see Keldysh, "Diagram Technique for Nonequilibrium Processes," Keldysh, Sov. Phys. 1965. and Ch. 10 of Physical Kinetics, Lifshitz # Eyring's [http://scitation.aip.org.ezproxy.lib.usf.edu/content/aip/journal/jcp/3/2/10.1063/1.1749604 transition-state-theory][http://dx.doi.org/10.1021/cr60056a006] and reaction diagrams using [http://en.wikipedia.org/wiki/Marcus_theory Marcus Theory] lit ref: [http://dx.doi.org/10.1017/S0033583501003730 Warshel and Parson]. # Formulation of QM expectations using path integrals # Numerical solution methods for 1D problems. Choose an interesting topic in groups of no more than 3 students by Friday, Oct. 4. [[Media:GroupAssignment.pdf |Group Assignment Instructions]] 20da4f4045e01f4ee32f5ba61466e6436f0a445a 102 84 2013-11-13T15:01:20Z David M. Rogers 2 /* Grading & Due Dates */ wikitext text/x-wiki <BIG>Graduate Quantum Mechanics</BIG> [[Media:CHM6938.005-syllabus.doc|Text Syllabus]] == Meeting Time == CHM 6938-005 (Quantum Mechanics I) will meet Mondays and Wednesdays from 10:45am-12:00pm in NES 104. The instructor may be reached anytime by phone 4-4298 or email (username: davidrogers on usf.edu). == Course Overview & Objectives == Nanoscience has already reached its natural quantum limit, bringing the 'spooky' behavior of quantum systems into the center of a revolution. This course will rigorously develop the fundamentals of quantum mechanics required for understanding the interplay of electricity and magnetism with electronic structure. By the end of the course, you will be able to determine which problems in chemistry and physics have an essentially quantum nature. For those that do, you will know the rules for formulating the solution mathematically and the tools and special tricks for completing the solution. You will also learn aspects of numerical solutions and partial differential equations that apply to many aspect of modern technology outside of QM. As a research course, you will be expected to finish with a high-level understanding of where to find worked projects similar to new and open questions, and to mix, match, and evaluate solution techniques before diving into differentiation or trial and error. == Grading & Due Dates == Your work will be graded based on homework assignments (80%) and one student project (20%). * Homework 1: Problems from Bes, 2007 Chapter 2 - due Monday, September 9 * [[Media:HW2.pdf|Homework 2]]: Problems based on Bes, Ch. 4, 5 and 9 - due Monday, October 7 * [[Media:HW3.pdf|Homework 3]]: Worked Examples of the Schrodinger Equation - due Monday, October 28 * [[Media:HW4.pdf|Homework 4]]: Introduction to Group Theory - due Monday, November 18 == Some Useful Preliminaries == Partial differential equations, linear algebra, Fourier series These will be reviewed in the course, but undergraduate calculus is required. == Textbooks == * Quantum Mechanics: A Modern and Concise Introductory Course, Daniel Bes (Springer, 2007 (2nd ed) or 2012 (3rd ed)) Bes gives an excellent survey of the myriad applications of QM, and is detailed enough to provide all the tools and intuition needed to do the math. It does as well as anyone should expect in getting at the whys and hows of the confusion that is quantum, including various manifestations of the measurement problem. [http://usf.catalog.fcla.edu/permalink.jsp?24SF020303747 eBook] * McQuarrie (Quantum Chemistry, 2nd ed., Univ. Sci. 2007) McQuarrie focuses in on molecular electronic structure, providing a chemistry compliment to Bes' physics-oriented book. It covers what we need to understand molecular computations, including spectroscopy, thermochemistry, Hartree-Fock and Slater determinants, molecular orbitals, density-functional theory. Leung and Marshall have written a solutions manual, Problems and Solutions for McQuarrie's QM, Univ. Sci., 2007. Both these texts are available at the library (possibly in course reserves), and purchasing them is not required for the course. === Other QM Texts === * Pauling (free book on archive.org) ** Early, but presciently maps out the next ~30 y. of developments * Atkins * Griffiths * Levine * Shankar (Principles of QM, 2nd ed., Plenum 1994) ** Introduces Quantization using commutation... * Landau & Lifschitz 3 & 4 * Advanced Quantum Mechanics, Dick Rainer (Springer, 2012) - chem/phys. * [http://usf.catalog.fcla.edu/permalink.jsp?24SF030655622 Bes, QM 2012 edition] == Course Outline == # for((i=0;i<120;i+=7)); do date -v8m -v26d -v+"$i"d; done (01) Aug 26 Class intro., failures of classical mechanics, Planck's hypothesis. [[Media:LectA.pdf|Notes]] Weeks 1-4 correspond roughly to Bes' Chapters 1-4 and Chapter 13 on the history of QM. Pages 11-28 of the [http://science.energy.gov/~/media/bes/pdf/reports/files/gc_rpt.pdf DOE Grand Challenges report] also make for great related reading. (02) Sep 2 (Mon. = Labor Day) Review of the Schrodinger equation, Heisenberg states and all that. Basic linear algebra. [[Media:notes.pdf|Typed Class Notes]] (03) Sep 9 Eigenvalue decompositions and measurements in QM. (04) Sep 16 Worked solutions to HW1. (05) Sep 23 One-dimensional problems - review of the potential well. New applications for the Helmholtz equation - bound and scattering states. Variational solutions. <!-- Perturbation theory calculations, also applied to H<math>_2</math>. --> Interspersed with background on group projects. (06) Sep 30 Applications of the Helmholtz equation, continued - tunneling, radioactive decay and diffraction. Time-dependent perturbation theory and the interpretation of off-diagonal matrix elements. This covers material in Bes, Ch. 9. (07) Oct 7 Mathematics of rotation. Application to rotational (far infrared) spectroscopy. Week 7 corresponds roughly to Bes' Chapter 5 and rotational spectroscopy in McQuarrie. (08) Oct 14 <!-- Review of the harmonic oscillator and hydrogen atom, introduction to multi-particle statistics. Week 8 corresponds roughly to Bes' Chapters 6-7. --> Electronic (UV) and vibrational (IR) polarizability. Molecular point groups and symmetry properties. (09) Oct 21 More about those molecular orbitals, and calculations on the H<math>_2</math> atom. If quantum theory is exact, why do I need to choose a bunch of basis functions? <!-- Weeks 8-9 correspond roughly to Bes' Chapters 7-9. More material from McQuarrie will be brought in at this point. --> (10) Oct 28 Topics past week 9 are tentative. (11) Nov 4 QM software intro. (12) Nov 11 (Mon. = Veteran's Day) Statistics of an electron gas. The Kohn-Sham decomposition and the resulting alphabet soup. (13) Nov 18 The continuing quest for the perfect functional. (14) Nov 25 (Fri. Nov 29 = Day after Thanksgiving) Chemical reactions and transition-state theory. (15) Dec 2 Emerging research areas in molecular physics simulation and statistics. (16) Dec 9 - final exam week == List of Group Study Topics == # Einstein, Podolsky and Rosen's paradox and Bell's inequality. # [http://prola.aps.org/toc/PR/v85/i2 Bohm's quantum interpretation of quantum mechanics] (see also [http://link.springer.com/article/10.1007/BF01889272 Bell's later response]) # [http://shodor.org/succeed-1.0/programs/compchem98/labs/sto/ Gaussian-type orbitals, exponents, and integrals][http://www.computationalscience.org/ccce/Lesson2/02_lab_basissets.pdf] for the H<math>_2</math> atom. # Calculating electron hopping rates using the [http://www.jetp.ac.ru/cgi-bin/dn/e_020_04_1018.pdf Non-equilibrium Green's function] method #* see Keldysh, "Diagram Technique for Nonequilibrium Processes," Keldysh, Sov. Phys. 1965. and Ch. 10 of Physical Kinetics, Lifshitz # Eyring's [http://scitation.aip.org.ezproxy.lib.usf.edu/content/aip/journal/jcp/3/2/10.1063/1.1749604 transition-state-theory][http://dx.doi.org/10.1021/cr60056a006] and reaction diagrams using [http://en.wikipedia.org/wiki/Marcus_theory Marcus Theory] lit ref: [http://dx.doi.org/10.1017/S0033583501003730 Warshel and Parson]. # Formulation of QM expectations using path integrals # Numerical solution methods for 1D problems. Choose an interesting topic in groups of no more than 3 students by Friday, Oct. 4. [[Media:GroupAssignment.pdf |Group Assignment Instructions]] 99b36b1f70766c28b66e9d7a0c4c667a4d4b4666 104 102 2013-11-13T15:20:36Z David M. Rogers 2 /* Course Outline */ wikitext text/x-wiki <BIG>Graduate Quantum Mechanics</BIG> [[Media:CHM6938.005-syllabus.doc|Text Syllabus]] == Meeting Time == CHM 6938-005 (Quantum Mechanics I) will meet Mondays and Wednesdays from 10:45am-12:00pm in NES 104. The instructor may be reached anytime by phone 4-4298 or email (username: davidrogers on usf.edu). == Course Overview & Objectives == Nanoscience has already reached its natural quantum limit, bringing the 'spooky' behavior of quantum systems into the center of a revolution. This course will rigorously develop the fundamentals of quantum mechanics required for understanding the interplay of electricity and magnetism with electronic structure. By the end of the course, you will be able to determine which problems in chemistry and physics have an essentially quantum nature. For those that do, you will know the rules for formulating the solution mathematically and the tools and special tricks for completing the solution. You will also learn aspects of numerical solutions and partial differential equations that apply to many aspect of modern technology outside of QM. As a research course, you will be expected to finish with a high-level understanding of where to find worked projects similar to new and open questions, and to mix, match, and evaluate solution techniques before diving into differentiation or trial and error. == Grading & Due Dates == Your work will be graded based on homework assignments (80%) and one student project (20%). * Homework 1: Problems from Bes, 2007 Chapter 2 - due Monday, September 9 * [[Media:HW2.pdf|Homework 2]]: Problems based on Bes, Ch. 4, 5 and 9 - due Monday, October 7 * [[Media:HW3.pdf|Homework 3]]: Worked Examples of the Schrodinger Equation - due Monday, October 28 * [[Media:HW4.pdf|Homework 4]]: Introduction to Group Theory - due Monday, November 18 == Some Useful Preliminaries == Partial differential equations, linear algebra, Fourier series These will be reviewed in the course, but undergraduate calculus is required. == Textbooks == * Quantum Mechanics: A Modern and Concise Introductory Course, Daniel Bes (Springer, 2007 (2nd ed) or 2012 (3rd ed)) Bes gives an excellent survey of the myriad applications of QM, and is detailed enough to provide all the tools and intuition needed to do the math. It does as well as anyone should expect in getting at the whys and hows of the confusion that is quantum, including various manifestations of the measurement problem. [http://usf.catalog.fcla.edu/permalink.jsp?24SF020303747 eBook] * McQuarrie (Quantum Chemistry, 2nd ed., Univ. Sci. 2007) McQuarrie focuses in on molecular electronic structure, providing a chemistry compliment to Bes' physics-oriented book. It covers what we need to understand molecular computations, including spectroscopy, thermochemistry, Hartree-Fock and Slater determinants, molecular orbitals, density-functional theory. Leung and Marshall have written a solutions manual, Problems and Solutions for McQuarrie's QM, Univ. Sci., 2007. Both these texts are available at the library (possibly in course reserves), and purchasing them is not required for the course. === Other QM Texts === * Pauling (free book on archive.org) ** Early, but presciently maps out the next ~30 y. of developments * Atkins * Griffiths * Levine * Shankar (Principles of QM, 2nd ed., Plenum 1994) ** Introduces Quantization using commutation... * Landau & Lifschitz 3 & 4 * Advanced Quantum Mechanics, Dick Rainer (Springer, 2012) - chem/phys. * [http://usf.catalog.fcla.edu/permalink.jsp?24SF030655622 Bes, QM 2012 edition] == Course Outline == # for((i=0;i<120;i+=7)); do date -v8m -v26d -v+"$i"d; done (01) Aug 26 Class intro., failures of classical mechanics, Planck's hypothesis. [[Media:LectA.pdf|Notes]] Weeks 1-4 correspond roughly to Bes' Chapters 1-4 and Chapter 13 on the history of QM. Pages 11-28 of the [http://science.energy.gov/~/media/bes/pdf/reports/files/gc_rpt.pdf DOE Grand Challenges report] also make for great related reading. (02) Sep 2 (Mon. = Labor Day) Review of the Schrodinger equation, Heisenberg states and all that. Basic linear algebra. [[Media:notes.pdf|Typed Class Notes]] (03) Sep 9 Eigenvalue decompositions and measurements in QM. (04) Sep 16 Worked solutions to HW1. (05) Sep 23 One-dimensional problems - review of the potential well. New applications for the Helmholtz equation - bound and scattering states. Variational solutions. <!-- Perturbation theory calculations, also applied to H<math>_2</math>. --> Interspersed with background on group projects. (06) Sep 30 Applications of the Helmholtz equation, continued - tunneling, radioactive decay and diffraction. Time-dependent perturbation theory and the interpretation of off-diagonal matrix elements. This covers material in Bes, Ch. 9. (07) Oct 7 Review of HW2. (08) Oct 14 Mathematics of rotation and solution of the 2-body Kepler problem. Application to rotational (far infrared) spectroscopy. Week 8 corresponds roughly to Bes' Chapter 5 and rotational spectroscopy in McQuarrie. (09) Oct 21 Review of the harmonic oscillator and hydrogen atom, introduction to multi-particle statistics. Week 9 corresponds roughly to Bes' Chapters 6-7. (10) Oct 28 Introduction to molecular symmetry operations. Electronic (UV) and vibrational (IR) polarizability. Molecular point groups and symmetry properties. Your reference for the group theory material is McQuarrie's book. (11) Nov 4 Numerical solution of Schrodinger's equation and QM software intro. [[NWChem]] Review of HW3 solutions. (12) Nov 11 (Mon. = Veteran's Day) (13) Nov 18 Example group project presentation - EPR paradox, the Bell inequalities, and Bohm's suggestion. (14) Nov 25 (Fri. Nov 29 = Day after Thanksgiving) Presentation of group projects. (15) Dec 2 Presentation of group projects. (16) Dec 9 - final exam week Coming up next semester: Running large parallel electronic structure calculations and plotting molecular orbitals. The role of basis functions and convergence. Electronic polarization and its role in UV absorption and dispersion forces. QM/MM methods applicable to the condensed phase - the many representations of solvent. Basic statistics of Boson and Fermion energy distributions - statistics on top of statistics. Statistics of an electron gas. The Kohn-Sham decomposition and the resulting alphabet soup of density functionals. Thermochemistry, chemical reactions and kinetics. Feynman's path integral representation of QM - derivation of classical mechanics, Heisenberg and Schrodinger. Elementary path integrals, and the concepts of coupled-cluster perturbation. Emerging research areas in molecular physics simulation and statistics. Optional material: Quaternion representation of rotations and the Dirac equation. <!-- Weeks 8-9 correspond roughly to Bes' Chapters 7-9. More material from McQuarrie will be brought in at this point. --> == List of Group Study Topics == # Einstein, Podolsky and Rosen's paradox and Bell's inequality. # [http://prola.aps.org/toc/PR/v85/i2 Bohm's quantum interpretation of quantum mechanics] (see also [http://link.springer.com/article/10.1007/BF01889272 Bell's later response]) # [http://shodor.org/succeed-1.0/programs/compchem98/labs/sto/ Gaussian-type orbitals, exponents, and integrals][http://www.computationalscience.org/ccce/Lesson2/02_lab_basissets.pdf] for the H<math>_2</math> atom. # Calculating electron hopping rates using the [http://www.jetp.ac.ru/cgi-bin/dn/e_020_04_1018.pdf Non-equilibrium Green's function] method #* see Keldysh, "Diagram Technique for Nonequilibrium Processes," Keldysh, Sov. Phys. 1965. and Ch. 10 of Physical Kinetics, Lifshitz # Eyring's [http://scitation.aip.org.ezproxy.lib.usf.edu/content/aip/journal/jcp/3/2/10.1063/1.1749604 transition-state-theory][http://dx.doi.org/10.1021/cr60056a006] and reaction diagrams using [http://en.wikipedia.org/wiki/Marcus_theory Marcus Theory] lit ref: [http://dx.doi.org/10.1017/S0033583501003730 Warshel and Parson]. # Formulation of QM expectations using path integrals # Numerical solution methods for 1D problems. Choose an interesting topic in groups of no more than 3 students by Friday, Oct. 4. [[Media:GroupAssignment.pdf |Group Assignment Instructions]] 5fc35c568f06d59cc1ec8f901e3ed018047361e3 108 104 2013-11-19T18:04:32Z David M. Rogers 2 /* Course Outline */ wikitext text/x-wiki <BIG>Graduate Quantum Mechanics</BIG> [[Media:CHM6938.005-syllabus.doc|Text Syllabus]] == Meeting Time == CHM 6938-005 (Quantum Mechanics I) will meet Mondays and Wednesdays from 10:45am-12:00pm in NES 104. The instructor may be reached anytime by phone 4-4298 or email (username: davidrogers on usf.edu). == Course Overview & Objectives == Nanoscience has already reached its natural quantum limit, bringing the 'spooky' behavior of quantum systems into the center of a revolution. This course will rigorously develop the fundamentals of quantum mechanics required for understanding the interplay of electricity and magnetism with electronic structure. By the end of the course, you will be able to determine which problems in chemistry and physics have an essentially quantum nature. For those that do, you will know the rules for formulating the solution mathematically and the tools and special tricks for completing the solution. You will also learn aspects of numerical solutions and partial differential equations that apply to many aspect of modern technology outside of QM. As a research course, you will be expected to finish with a high-level understanding of where to find worked projects similar to new and open questions, and to mix, match, and evaluate solution techniques before diving into differentiation or trial and error. == Grading & Due Dates == Your work will be graded based on homework assignments (80%) and one student project (20%). * Homework 1: Problems from Bes, 2007 Chapter 2 - due Monday, September 9 * [[Media:HW2.pdf|Homework 2]]: Problems based on Bes, Ch. 4, 5 and 9 - due Monday, October 7 * [[Media:HW3.pdf|Homework 3]]: Worked Examples of the Schrodinger Equation - due Monday, October 28 * [[Media:HW4.pdf|Homework 4]]: Introduction to Group Theory - due Monday, November 18 == Some Useful Preliminaries == Partial differential equations, linear algebra, Fourier series These will be reviewed in the course, but undergraduate calculus is required. == Textbooks == * Quantum Mechanics: A Modern and Concise Introductory Course, Daniel Bes (Springer, 2007 (2nd ed) or 2012 (3rd ed)) Bes gives an excellent survey of the myriad applications of QM, and is detailed enough to provide all the tools and intuition needed to do the math. It does as well as anyone should expect in getting at the whys and hows of the confusion that is quantum, including various manifestations of the measurement problem. [http://usf.catalog.fcla.edu/permalink.jsp?24SF020303747 eBook] * McQuarrie (Quantum Chemistry, 2nd ed., Univ. Sci. 2007) McQuarrie focuses in on molecular electronic structure, providing a chemistry compliment to Bes' physics-oriented book. It covers what we need to understand molecular computations, including spectroscopy, thermochemistry, Hartree-Fock and Slater determinants, molecular orbitals, density-functional theory. Leung and Marshall have written a solutions manual, Problems and Solutions for McQuarrie's QM, Univ. Sci., 2007. Both these texts are available at the library (possibly in course reserves), and purchasing them is not required for the course. === Other QM Texts === * Pauling (free book on archive.org) ** Early, but presciently maps out the next ~30 y. of developments * Atkins * Griffiths * Levine * Shankar (Principles of QM, 2nd ed., Plenum 1994) ** Introduces Quantization using commutation... * Landau & Lifschitz 3 & 4 * Advanced Quantum Mechanics, Dick Rainer (Springer, 2012) - chem/phys. * [http://usf.catalog.fcla.edu/permalink.jsp?24SF030655622 Bes, QM 2012 edition] == Course Outline == # for((i=0;i<120;i+=7)); do date -v8m -v26d -v+"$i"d; done (01) Aug 26 Class intro., failures of classical mechanics, Planck's hypothesis. [[Media:LectA.pdf|Notes]] Weeks 1-4 correspond roughly to Bes' Chapters 1-4 and Chapter 13 on the history of QM. Pages 11-28 of the [http://science.energy.gov/~/media/bes/pdf/reports/files/gc_rpt.pdf DOE Grand Challenges report] also make for great related reading. (02) Sep 2 (Mon. = Labor Day) Review of the Schrodinger equation, Heisenberg states and all that. Basic linear algebra. [[Media:notes.pdf|Typed Class Notes]] (03) Sep 9 Eigenvalue decompositions and measurements in QM. (04) Sep 16 Worked solutions to HW1. (05) Sep 23 One-dimensional problems - review of the potential well. New applications for the Helmholtz equation - bound and scattering states. Variational solutions. <!-- Perturbation theory calculations, also applied to H<math>_2</math>. --> Interspersed with background on group projects. (06) Sep 30 Applications of the Helmholtz equation, continued - tunneling, radioactive decay and diffraction. Time-dependent perturbation theory and the interpretation of off-diagonal matrix elements. This covers material in Bes, Ch. 9. (07) Oct 7 Review of HW2. (08) Oct 14 Mathematics of rotation and solution of the 2-body Kepler problem. Application to rotational (far infrared) spectroscopy. Week 8 corresponds roughly to Bes' Chapter 5 and rotational spectroscopy in McQuarrie. (09) Oct 21 Review of the harmonic oscillator and hydrogen atom, introduction to multi-particle statistics. Week 9 corresponds roughly to Bes' Chapters 6-7. (10) Oct 28 Introduction to molecular symmetry operations. Electronic (UV) and vibrational (IR) polarizability. Molecular point groups and symmetry properties. Your reference for the group theory material is McQuarrie's book. (11) Nov 4 Numerical solution of Schrodinger's equation and QM software intro. [[NWChem]] Review of HW3 solutions. (12) Nov 11 (Mon. = Veteran's Day) Group theory and spectroscopy review. (13) Nov 18 Example group project presentation - EPR paradox, the Bell inequalities, and Bohm's suggestion. (14) Nov 25 (Fri. Nov 29 = Day after Thanksgiving) Presentation of group projects. (15) Dec 2 Presentation of group projects. (16) Dec 9 - final exam week Coming up next semester: Running large parallel electronic structure calculations and plotting molecular orbitals. The role of basis functions and convergence. Electronic polarization and its role in UV absorption and dispersion forces. QM/MM methods applicable to the condensed phase - the many representations of solvent. Basic statistics of Boson and Fermion energy distributions - statistics on top of statistics. Statistics of an electron gas. The Kohn-Sham decomposition and the resulting alphabet soup of density functionals. Thermochemistry, chemical reactions and kinetics. Feynman's path integral representation of QM - derivation of classical mechanics, Heisenberg and Schrodinger. Elementary path integrals, and the concepts of coupled-cluster perturbation. Emerging research areas in molecular physics simulation and statistics. Optional material: Quaternion representation of rotations and the Dirac equation. <!-- Weeks 8-9 correspond roughly to Bes' Chapters 7-9. More material from McQuarrie will be brought in at this point. --> == List of Group Study Topics == # Einstein, Podolsky and Rosen's paradox and Bell's inequality. # [http://prola.aps.org/toc/PR/v85/i2 Bohm's quantum interpretation of quantum mechanics] (see also [http://link.springer.com/article/10.1007/BF01889272 Bell's later response]) # [http://shodor.org/succeed-1.0/programs/compchem98/labs/sto/ Gaussian-type orbitals, exponents, and integrals][http://www.computationalscience.org/ccce/Lesson2/02_lab_basissets.pdf] for the H<math>_2</math> atom. # Calculating electron hopping rates using the [http://www.jetp.ac.ru/cgi-bin/dn/e_020_04_1018.pdf Non-equilibrium Green's function] method #* see Keldysh, "Diagram Technique for Nonequilibrium Processes," Keldysh, Sov. Phys. 1965. and Ch. 10 of Physical Kinetics, Lifshitz # Eyring's [http://scitation.aip.org.ezproxy.lib.usf.edu/content/aip/journal/jcp/3/2/10.1063/1.1749604 transition-state-theory][http://dx.doi.org/10.1021/cr60056a006] and reaction diagrams using [http://en.wikipedia.org/wiki/Marcus_theory Marcus Theory] lit ref: [http://dx.doi.org/10.1017/S0033583501003730 Warshel and Parson]. # Formulation of QM expectations using path integrals # Numerical solution methods for 1D problems. Choose an interesting topic in groups of no more than 3 students by Friday, Oct. 4. [[Media:GroupAssignment.pdf |Group Assignment Instructions]] 27f00a808f01200e6bef720e3f48b3948af00a47 109 108 2013-11-19T21:48:04Z David M. Rogers 2 /* List of Group Study Topics */ wikitext text/x-wiki <BIG>Graduate Quantum Mechanics</BIG> [[Media:CHM6938.005-syllabus.doc|Text Syllabus]] == Meeting Time == CHM 6938-005 (Quantum Mechanics I) will meet Mondays and Wednesdays from 10:45am-12:00pm in NES 104. The instructor may be reached anytime by phone 4-4298 or email (username: davidrogers on usf.edu). == Course Overview & Objectives == Nanoscience has already reached its natural quantum limit, bringing the 'spooky' behavior of quantum systems into the center of a revolution. This course will rigorously develop the fundamentals of quantum mechanics required for understanding the interplay of electricity and magnetism with electronic structure. By the end of the course, you will be able to determine which problems in chemistry and physics have an essentially quantum nature. For those that do, you will know the rules for formulating the solution mathematically and the tools and special tricks for completing the solution. You will also learn aspects of numerical solutions and partial differential equations that apply to many aspect of modern technology outside of QM. As a research course, you will be expected to finish with a high-level understanding of where to find worked projects similar to new and open questions, and to mix, match, and evaluate solution techniques before diving into differentiation or trial and error. == Grading & Due Dates == Your work will be graded based on homework assignments (80%) and one student project (20%). * Homework 1: Problems from Bes, 2007 Chapter 2 - due Monday, September 9 * [[Media:HW2.pdf|Homework 2]]: Problems based on Bes, Ch. 4, 5 and 9 - due Monday, October 7 * [[Media:HW3.pdf|Homework 3]]: Worked Examples of the Schrodinger Equation - due Monday, October 28 * [[Media:HW4.pdf|Homework 4]]: Introduction to Group Theory - due Monday, November 18 == Some Useful Preliminaries == Partial differential equations, linear algebra, Fourier series These will be reviewed in the course, but undergraduate calculus is required. == Textbooks == * Quantum Mechanics: A Modern and Concise Introductory Course, Daniel Bes (Springer, 2007 (2nd ed) or 2012 (3rd ed)) Bes gives an excellent survey of the myriad applications of QM, and is detailed enough to provide all the tools and intuition needed to do the math. It does as well as anyone should expect in getting at the whys and hows of the confusion that is quantum, including various manifestations of the measurement problem. [http://usf.catalog.fcla.edu/permalink.jsp?24SF020303747 eBook] * McQuarrie (Quantum Chemistry, 2nd ed., Univ. Sci. 2007) McQuarrie focuses in on molecular electronic structure, providing a chemistry compliment to Bes' physics-oriented book. It covers what we need to understand molecular computations, including spectroscopy, thermochemistry, Hartree-Fock and Slater determinants, molecular orbitals, density-functional theory. Leung and Marshall have written a solutions manual, Problems and Solutions for McQuarrie's QM, Univ. Sci., 2007. Both these texts are available at the library (possibly in course reserves), and purchasing them is not required for the course. === Other QM Texts === * Pauling (free book on archive.org) ** Early, but presciently maps out the next ~30 y. of developments * Atkins * Griffiths * Levine * Shankar (Principles of QM, 2nd ed., Plenum 1994) ** Introduces Quantization using commutation... * Landau & Lifschitz 3 & 4 * Advanced Quantum Mechanics, Dick Rainer (Springer, 2012) - chem/phys. * [http://usf.catalog.fcla.edu/permalink.jsp?24SF030655622 Bes, QM 2012 edition] == Course Outline == # for((i=0;i<120;i+=7)); do date -v8m -v26d -v+"$i"d; done (01) Aug 26 Class intro., failures of classical mechanics, Planck's hypothesis. [[Media:LectA.pdf|Notes]] Weeks 1-4 correspond roughly to Bes' Chapters 1-4 and Chapter 13 on the history of QM. Pages 11-28 of the [http://science.energy.gov/~/media/bes/pdf/reports/files/gc_rpt.pdf DOE Grand Challenges report] also make for great related reading. (02) Sep 2 (Mon. = Labor Day) Review of the Schrodinger equation, Heisenberg states and all that. Basic linear algebra. [[Media:notes.pdf|Typed Class Notes]] (03) Sep 9 Eigenvalue decompositions and measurements in QM. (04) Sep 16 Worked solutions to HW1. (05) Sep 23 One-dimensional problems - review of the potential well. New applications for the Helmholtz equation - bound and scattering states. Variational solutions. <!-- Perturbation theory calculations, also applied to H<math>_2</math>. --> Interspersed with background on group projects. (06) Sep 30 Applications of the Helmholtz equation, continued - tunneling, radioactive decay and diffraction. Time-dependent perturbation theory and the interpretation of off-diagonal matrix elements. This covers material in Bes, Ch. 9. (07) Oct 7 Review of HW2. (08) Oct 14 Mathematics of rotation and solution of the 2-body Kepler problem. Application to rotational (far infrared) spectroscopy. Week 8 corresponds roughly to Bes' Chapter 5 and rotational spectroscopy in McQuarrie. (09) Oct 21 Review of the harmonic oscillator and hydrogen atom, introduction to multi-particle statistics. Week 9 corresponds roughly to Bes' Chapters 6-7. (10) Oct 28 Introduction to molecular symmetry operations. Electronic (UV) and vibrational (IR) polarizability. Molecular point groups and symmetry properties. Your reference for the group theory material is McQuarrie's book. (11) Nov 4 Numerical solution of Schrodinger's equation and QM software intro. [[NWChem]] Review of HW3 solutions. (12) Nov 11 (Mon. = Veteran's Day) Group theory and spectroscopy review. (13) Nov 18 Example group project presentation - EPR paradox, the Bell inequalities, and Bohm's suggestion. (14) Nov 25 (Fri. Nov 29 = Day after Thanksgiving) Presentation of group projects. (15) Dec 2 Presentation of group projects. (16) Dec 9 - final exam week Coming up next semester: Running large parallel electronic structure calculations and plotting molecular orbitals. The role of basis functions and convergence. Electronic polarization and its role in UV absorption and dispersion forces. QM/MM methods applicable to the condensed phase - the many representations of solvent. Basic statistics of Boson and Fermion energy distributions - statistics on top of statistics. Statistics of an electron gas. The Kohn-Sham decomposition and the resulting alphabet soup of density functionals. Thermochemistry, chemical reactions and kinetics. Feynman's path integral representation of QM - derivation of classical mechanics, Heisenberg and Schrodinger. Elementary path integrals, and the concepts of coupled-cluster perturbation. Emerging research areas in molecular physics simulation and statistics. Optional material: Quaternion representation of rotations and the Dirac equation. <!-- Weeks 8-9 correspond roughly to Bes' Chapters 7-9. More material from McQuarrie will be brought in at this point. --> == List of Group Study Topics == # Einstein, Podolsky and Rosen's paradox and Bell's inequality. # [http://prola.aps.org/toc/PR/v85/i2 Bohm's quantum interpretation of quantum mechanics] (see also [http://link.springer.com/article/10.1007/BF01889272 Bell's later response]) # [http://shodor.org/succeed-1.0/programs/compchem98/labs/sto/ Gaussian-type orbitals, exponents, and integrals][http://www.computationalscience.org/ccce/Lesson2/02_lab_basissets.pdf] for the H<math>_2</math> atom. # Calculating electron hopping rates using the [http://www.jetp.ac.ru/cgi-bin/dn/e_020_04_1018.pdf Non-equilibrium Green's function] method #* see Keldysh, "Diagram Technique for Nonequilibrium Processes," Keldysh, Sov. Phys. 1965. and Ch. 10 of Physical Kinetics, Lifshitz # Eyring's [http://scitation.aip.org.ezproxy.lib.usf.edu/content/aip/journal/jcp/3/2/10.1063/1.1749604 transition-state-theory][http://dx.doi.org/10.1021/cr60056a006] [http://dx.doi.org/10.1021/jp953748q] and reaction diagrams using [http://en.wikipedia.org/wiki/Marcus_theory Marcus Theory] lit ref: [http://dx.doi.org/10.1017/S0033583501003730 Warshel and Parson]. # Formulation of QM expectations using path integrals # Numerical solution methods for 1D problems. Choose an interesting topic in groups of no more than 3 students by Friday, Oct. 4. [[Media:GroupAssignment.pdf |Group Assignment Instructions]] 32c77b8ea3074a3bc2e7f7e90bb5c5a795a498b9 110 109 2013-11-19T21:50:52Z David M. Rogers 2 /* List of Group Study Topics */ wikitext text/x-wiki <BIG>Graduate Quantum Mechanics</BIG> [[Media:CHM6938.005-syllabus.doc|Text Syllabus]] == Meeting Time == CHM 6938-005 (Quantum Mechanics I) will meet Mondays and Wednesdays from 10:45am-12:00pm in NES 104. The instructor may be reached anytime by phone 4-4298 or email (username: davidrogers on usf.edu). == Course Overview & Objectives == Nanoscience has already reached its natural quantum limit, bringing the 'spooky' behavior of quantum systems into the center of a revolution. This course will rigorously develop the fundamentals of quantum mechanics required for understanding the interplay of electricity and magnetism with electronic structure. By the end of the course, you will be able to determine which problems in chemistry and physics have an essentially quantum nature. For those that do, you will know the rules for formulating the solution mathematically and the tools and special tricks for completing the solution. You will also learn aspects of numerical solutions and partial differential equations that apply to many aspect of modern technology outside of QM. As a research course, you will be expected to finish with a high-level understanding of where to find worked projects similar to new and open questions, and to mix, match, and evaluate solution techniques before diving into differentiation or trial and error. == Grading & Due Dates == Your work will be graded based on homework assignments (80%) and one student project (20%). * Homework 1: Problems from Bes, 2007 Chapter 2 - due Monday, September 9 * [[Media:HW2.pdf|Homework 2]]: Problems based on Bes, Ch. 4, 5 and 9 - due Monday, October 7 * [[Media:HW3.pdf|Homework 3]]: Worked Examples of the Schrodinger Equation - due Monday, October 28 * [[Media:HW4.pdf|Homework 4]]: Introduction to Group Theory - due Monday, November 18 == Some Useful Preliminaries == Partial differential equations, linear algebra, Fourier series These will be reviewed in the course, but undergraduate calculus is required. == Textbooks == * Quantum Mechanics: A Modern and Concise Introductory Course, Daniel Bes (Springer, 2007 (2nd ed) or 2012 (3rd ed)) Bes gives an excellent survey of the myriad applications of QM, and is detailed enough to provide all the tools and intuition needed to do the math. It does as well as anyone should expect in getting at the whys and hows of the confusion that is quantum, including various manifestations of the measurement problem. [http://usf.catalog.fcla.edu/permalink.jsp?24SF020303747 eBook] * McQuarrie (Quantum Chemistry, 2nd ed., Univ. Sci. 2007) McQuarrie focuses in on molecular electronic structure, providing a chemistry compliment to Bes' physics-oriented book. It covers what we need to understand molecular computations, including spectroscopy, thermochemistry, Hartree-Fock and Slater determinants, molecular orbitals, density-functional theory. Leung and Marshall have written a solutions manual, Problems and Solutions for McQuarrie's QM, Univ. Sci., 2007. Both these texts are available at the library (possibly in course reserves), and purchasing them is not required for the course. === Other QM Texts === * Pauling (free book on archive.org) ** Early, but presciently maps out the next ~30 y. of developments * Atkins * Griffiths * Levine * Shankar (Principles of QM, 2nd ed., Plenum 1994) ** Introduces Quantization using commutation... * Landau & Lifschitz 3 & 4 * Advanced Quantum Mechanics, Dick Rainer (Springer, 2012) - chem/phys. * [http://usf.catalog.fcla.edu/permalink.jsp?24SF030655622 Bes, QM 2012 edition] == Course Outline == # for((i=0;i<120;i+=7)); do date -v8m -v26d -v+"$i"d; done (01) Aug 26 Class intro., failures of classical mechanics, Planck's hypothesis. [[Media:LectA.pdf|Notes]] Weeks 1-4 correspond roughly to Bes' Chapters 1-4 and Chapter 13 on the history of QM. Pages 11-28 of the [http://science.energy.gov/~/media/bes/pdf/reports/files/gc_rpt.pdf DOE Grand Challenges report] also make for great related reading. (02) Sep 2 (Mon. = Labor Day) Review of the Schrodinger equation, Heisenberg states and all that. Basic linear algebra. [[Media:notes.pdf|Typed Class Notes]] (03) Sep 9 Eigenvalue decompositions and measurements in QM. (04) Sep 16 Worked solutions to HW1. (05) Sep 23 One-dimensional problems - review of the potential well. New applications for the Helmholtz equation - bound and scattering states. Variational solutions. <!-- Perturbation theory calculations, also applied to H<math>_2</math>. --> Interspersed with background on group projects. (06) Sep 30 Applications of the Helmholtz equation, continued - tunneling, radioactive decay and diffraction. Time-dependent perturbation theory and the interpretation of off-diagonal matrix elements. This covers material in Bes, Ch. 9. (07) Oct 7 Review of HW2. (08) Oct 14 Mathematics of rotation and solution of the 2-body Kepler problem. Application to rotational (far infrared) spectroscopy. Week 8 corresponds roughly to Bes' Chapter 5 and rotational spectroscopy in McQuarrie. (09) Oct 21 Review of the harmonic oscillator and hydrogen atom, introduction to multi-particle statistics. Week 9 corresponds roughly to Bes' Chapters 6-7. (10) Oct 28 Introduction to molecular symmetry operations. Electronic (UV) and vibrational (IR) polarizability. Molecular point groups and symmetry properties. Your reference for the group theory material is McQuarrie's book. (11) Nov 4 Numerical solution of Schrodinger's equation and QM software intro. [[NWChem]] Review of HW3 solutions. (12) Nov 11 (Mon. = Veteran's Day) Group theory and spectroscopy review. (13) Nov 18 Example group project presentation - EPR paradox, the Bell inequalities, and Bohm's suggestion. (14) Nov 25 (Fri. Nov 29 = Day after Thanksgiving) Presentation of group projects. (15) Dec 2 Presentation of group projects. (16) Dec 9 - final exam week Coming up next semester: Running large parallel electronic structure calculations and plotting molecular orbitals. The role of basis functions and convergence. Electronic polarization and its role in UV absorption and dispersion forces. QM/MM methods applicable to the condensed phase - the many representations of solvent. Basic statistics of Boson and Fermion energy distributions - statistics on top of statistics. Statistics of an electron gas. The Kohn-Sham decomposition and the resulting alphabet soup of density functionals. Thermochemistry, chemical reactions and kinetics. Feynman's path integral representation of QM - derivation of classical mechanics, Heisenberg and Schrodinger. Elementary path integrals, and the concepts of coupled-cluster perturbation. Emerging research areas in molecular physics simulation and statistics. Optional material: Quaternion representation of rotations and the Dirac equation. <!-- Weeks 8-9 correspond roughly to Bes' Chapters 7-9. More material from McQuarrie will be brought in at this point. --> == List of Group Study Topics == # Einstein, Podolsky and Rosen's paradox and Bell's inequality. # [http://prola.aps.org/toc/PR/v85/i2 Bohm's quantum interpretation of quantum mechanics] (see also [http://link.springer.com/article/10.1007/BF01889272 Bell's later response]) # [http://shodor.org/succeed-1.0/programs/compchem98/labs/sto/ Gaussian-type orbitals, exponents, and integrals][http://www.computationalscience.org/ccce/Lesson2/02_lab_basissets.pdf] for the H<math>_2</math> atom. # Calculating electron hopping rates using the [http://www.jetp.ac.ru/cgi-bin/dn/e_020_04_1018.pdf Non-equilibrium Green's function] method #* see Keldysh, "Diagram Technique for Nonequilibrium Processes," Keldysh, Sov. Phys. 1965. and Ch. 10 of Physical Kinetics, Lifshitz # Eyring's [http://scitation.aip.org.ezproxy.lib.usf.edu/content/aip/journal/jcp/3/2/10.1063/1.1749604 transition-state-theory][http://dx.doi.org/10.1021/cr60056a006] [http://dx.doi.org/10.1021/jp953748q] and reaction diagrams using [http://en.wikipedia.org/wiki/Marcus_theory Marcus Theory] lit ref: [http://dx.doi.org/10.1017/S0033583501003730 Warshel and Parson] [http://dx.doi.org/10.1063/1.1740102]. # Formulation of QM expectations using path integrals # Numerical solution methods for 1D problems. Choose an interesting topic in groups of no more than 3 students by Friday, Oct. 4. [[Media:GroupAssignment.pdf |Group Assignment Instructions]] ed32c22d979c01ffa01f1b4a3abd585a27340ffb File:HW2.pdf 6 24 63 2013-09-19T16:15:45Z David M. Rogers 2 Second set of homework problems. wikitext text/x-wiki Second set of homework problems. 453e9b5999828ececafc4174e7a96af88bf8cffc Main Page 0 9 66 24 2013-09-23T18:48:28Z David M. Rogers 2 wikitext text/x-wiki Welcome to the David M. Rogers' research group in Multiscale Chemical Physics at the University of South Florida! We are actively defining and understanding new physics at the nanoscale - where surface interactions are omnipresent, gravity is negligible, and it's really hard to carry any forward momentum. For more details, see the [[Research]] and [[Publications]] links. c3eeb72f4fddf4a66185b730dd2fa503fec90d05 74 66 2013-10-21T20:23:34Z David M. Rogers 2 wikitext text/x-wiki Welcome to the David M. Rogers' research group in Multiscale Chemical Physics at the University of South Florida! We are actively defining and understanding new physics at the nanoscale - where surface interactions are omnipresent, gravity is negligible, and it's really hard to carry any forward momentum. For more details, see the [[Research]] and [[Publications]] links. We have [[positions available]] for talented and inquisitive Undergraduate and Graduate Research assistants who want to learn about and make fundamental, lasting contributions to the central science! 1c8ec116f264f7ca6cd511b5b9fff213bfabbd33 Research 0 11 67 17 2013-09-23T18:53:19Z David M. Rogers 2 wikitext text/x-wiki = Nonequilibrium Statistical Mechanics = The first law of thermodynamics states that energy can flow into a system both as heat and work. The second law states that heat divided by temperature is a particularly pernicious quantity. It represents an increase in something like a debt which can never be bought down, only exported somewhere else. Recent discoveries in nonequilibrium statistical mechanics have centered around the microscopic origins of this 'irreversibility.' We have uncovered surprising new connections to observable information. For example, energy rejected from a process, but not used to do work, has to be counted as heat. The more statistical information we have about a process, the more avenues we have to extract some of that energy, shifting it under the heading of 'work.' We are investigating these microscopic processes through simulations on nanoscale energy conversion devices. = Local Free Energy Methods = Molecule partitioning underlies drug activity, separation and extraction, and solid/liquid phase stability. A variety of factors come together to determine the part of a solution that a molecule will take up residence, and more than one explanation is possible. The most useful of these for designing new molecular and solvent structures is a local picture, where a free energy for moving a molecule to different points in solution acts like a voltage probe in an electric circuit. The energy required for moving a molecule to any point in solution can be divided into molecular packing, direct energetic interaction with a surrounding set of ligands, and long-range solvent polarization terms. We are building models for these components that will greatly simplify the process of designing better devices using molecular information. = More Research = In and around [http://sciences.cas.usf.edu/research_clusters/ USF] and elsewhere, there's a huge effort to understand these problems in testable, analytical and computable ways. Check the [[Links]] page for more ideas. 4d2c1b52b336268ae2df9b6740c299f632931468 Links 0 25 68 2013-09-23T19:13:07Z David M. Rogers 2 Created page with "* [http://boundaries-in-biophysics.org/ Jaydeep Bardhan] - proteins and boundary element methods * [http://seneca.fis.ucm.es/ U Complutense Statistical Mechanics Group] - dispers…" wikitext text/x-wiki * [http://boundaries-in-biophysics.org/ Jaydeep Bardhan] - proteins and boundary element methods * [http://seneca.fis.ucm.es/ U Complutense Statistical Mechanics Group] - dispersion and nonequilibrium systems * [http://sites.google.com/site/beckgroupcincy/ Thomas L Beck Research Group] - density functional theory, fundamental thermochemistry of electrolyte solutions and interfaces * [http://groups.csail.mit.edu/mac/users/gjs/ Gerald Jay Sussman] - a modern-day counterpart to Von Neumann, but focusing on functional computer science * [http://faculty.virginia.edu/shirtsgroup/‎ Michael Shirts] - statistical mechanics, drug docking, and free energy methods * [http://web.mit.edu/alexrod7/www/ Alejandro Rodriguez‎] - numerical computation of Casimir forces * [http://spin.niddk.nih.gov/hummer/ Gerhard Hummer] - free energy, nonequilibrium transport and density methods * [http://patelgroup.chem.udel.edu/‎ Sandeep Patel] - Advanced hybrid computational methods for protein-protein, protein-membrane interactions in crowded cellular environments. * [http://www.cmu.edu/biolphys/deserno/index.html Markus Deserno] Membrane biophysics and coarse-grained simulations with (molecular) Espresso. * [http://www.ccbb.pitt.edu/zuckerman/‎ Daniel Zuckerman] - (massively) Enhanced Sampling for Statistical Simulations 451c300fabd6eb5c708319d20cbe54cde018ceb7 69 68 2013-09-23T19:14:15Z David M. Rogers 2 wikitext text/x-wiki Although the sentence fragment explanations don't do them credit, here's a partial listing of leaders in modern computational chemistry and physics. * [http://boundaries-in-biophysics.org/ Jaydeep Bardhan] - proteins and boundary element methods * [http://seneca.fis.ucm.es/ U Complutense Statistical Mechanics Group] - dispersion and nonequilibrium systems * [http://sites.google.com/site/beckgroupcincy/ Thomas L Beck Research Group] - density functional theory, fundamental thermochemistry of electrolyte solutions and interfaces * [http://groups.csail.mit.edu/mac/users/gjs/ Gerald Jay Sussman] - a modern-day counterpart to Von Neumann, but focusing on functional computer science * [http://faculty.virginia.edu/shirtsgroup/‎ Michael Shirts] - statistical mechanics, drug docking, and free energy methods * [http://web.mit.edu/alexrod7/www/ Alejandro Rodriguez‎] - numerical computation of Casimir forces * [http://spin.niddk.nih.gov/hummer/ Gerhard Hummer] - free energy, nonequilibrium transport and density methods * [http://patelgroup.chem.udel.edu/‎ Sandeep Patel] - Advanced hybrid computational methods for protein-protein, protein-membrane interactions in crowded cellular environments. * [http://www.cmu.edu/biolphys/deserno/index.html Markus Deserno] Membrane biophysics and coarse-grained simulations with (molecular) Espresso. * [http://www.ccbb.pitt.edu/zuckerman/‎ Daniel Zuckerman] - (massively) Enhanced Sampling for Statistical Simulations 7f76431fda2d7f20a357deba8a6ac07bc68f95dd 70 69 2013-09-23T19:38:47Z David M. Rogers 2 wikitext text/x-wiki Although the sentence fragment explanations don't do them credit, here's an extremely partial listing of leaders in modern computational chemistry and physics, narrowed by the somewhat arbitrary requirement of having a personal website. * [http://boundaries-in-biophysics.org/ Jaydeep Bardhan] - proteins and boundary element methods * [http://seneca.fis.ucm.es/ U Complutense Statistical Mechanics Group] - dispersion and nonequilibrium systems * [http://sites.google.com/site/beckgroupcincy/ Thomas L Beck Research Group] - density functional theory, fundamental thermochemistry of electrolyte solutions and interfaces * [http://terpconnect.umd.edu/~jdw/ John D. Weeks] - Statistical Mechanics of inhomogeneous and confined fluids and interfaces. * [http://groups.csail.mit.edu/mac/users/gjs/ Gerald Jay Sussman] - a modern-day counterpart to Von Neumann, but focusing on functional computer science * [http://faculty.virginia.edu/shirtsgroup/‎ Michael Shirts] - statistical mechanics, drug docking, and free energy methods * [http://web.mit.edu/alexrod7/www/ Alejandro Rodriguez‎] - numerical computation of Casimir forces * [http://spin.niddk.nih.gov/hummer/ Gerhard Hummer] - free energy, nonequilibrium transport and density methods * [http://patelgroup.chem.udel.edu/‎ Sandeep Patel] - Advanced hybrid computational methods for protein-protein, protein-membrane interactions in crowded cellular environments. * [http://www.cmu.edu/biolphys/deserno/index.html Markus Deserno] Membrane biophysics and coarse-grained simulations with (molecular) Espresso. * [http://www.ccbb.pitt.edu/zuckerman/‎ Daniel Zuckerman] - (massively) Enhanced Sampling for Statistical Simulations * [http://lcls.crc.nd.edu/joomla/index.php/home Jesus Izaguirre] New theory, numerical methods, and analysis tools for biophysical simulations. * [http://mcb.illinois.edu/faculty/profile/tajkhors Emad Tajkorshid] Large-scale simulations of ion channel biophysics cca246350dc6c132fa965f05b4c68ad35fb9477f Positions available 0 26 75 2013-10-21T20:34:40Z David M. Rogers 2 Created page with "Tuition and living expenses for four years in warm, sunny Tampa are available to pay for two students to move through graduate school and earn a Ph.D. in computational physical c…" wikitext text/x-wiki Tuition and living expenses for four years in warm, sunny Tampa are available to pay for two students to move through graduate school and earn a Ph.D. in computational physical chemistry. The group needs computer-science inclined chemistry/engineering/physics/mathematics BS/BA, as we build a computational physical chemistry lab from the ground up. We specialize in multiscale modeling to span the chasm between chemical theory and industrial practice. On the way, we will develop cutting-edge techniques in constrained optimization, computational geometry, symbolic algebra and parallel algorithms and apply them to the design and analysis of energy conversion processes occurring in nano- and micro-scale devices. Success doing this work requires a personal drive to build connections to new application areas, confront challenging questions with massive numerical computations, and to present your work to outside audiences. Applications must be sent to davidrogers -at usf.edu and to the USF [http://chemistry.usf.edu/graduate/ graduate school]. 4add84744281a6829b2c625d6538baf39a57113e 76 75 2013-10-21T22:16:14Z David M. Rogers 2 wikitext text/x-wiki Tuition and living expenses for four years in warm, sunny Tampa are available to pay for two students to move through graduate school and earn a Ph.D. in computational physical chemistry. The [http://www.usf.edu University of South Florida] is North of the city, near [http://www.mosi.org MOSI] and [http://buschgardens.com Bush Gardens], and approximately a 30-50 min drive from Tampa Bay and the beautiful [http://www.pinellascounty.org/park/beaches.htm beaches] of St. Petersburg, Clearwater, and Ft. De Soto. USF itself is among the top 3 research universities in Florida, with over 45 faculty members in Chemistry, a top-notch [http://www.usf.edu/it/research-computing/ research computing] facility, member of the [http://www.floridahightech.com/hightechindustry.php Florida high-tech corridor], and an emerging [http://sciences.cas.usf.edu/research_clusters Research Cluster on Computational Theory & Practice]. The group needs computer-science inclined chemistry/engineering/physics/mathematics BS/BA, as we build a computational physical chemistry lab from the ground up. We specialize in multiscale modeling to span the chasm between chemical theory and industrial practice. On the way, we will develop cutting-edge techniques in constrained optimization, computational geometry, symbolic algebra and parallel algorithms and apply them to the design and analysis of energy conversion processes occurring in nano- and micro-scale devices. Success doing this work requires a personal drive to build connections to new application areas, confront challenging questions with massive numerical computations, and to present your work to outside audiences. Applications must be sent to davidrogers -at usf.edu and to the USF [http://chemistry.usf.edu/graduate/ graduate school]. 4d1e695fe3e2d896f15a840422897e39265be6ff 77 76 2013-10-21T22:23:07Z David M. Rogers 2 wikitext text/x-wiki Tuition and living expenses for four years in warm, sunny Tampa are available to pay for two students to move through graduate school and earn a Ph.D. in computational physical chemistry. The [http://www.usf.edu University of South Florida] is North of the city, near [http://www.mosi.org MOSI] and [http://buschgardens.com Bush Gardens], and approximately a 30-50 min drive from Tampa Bay and the beautiful [http://www.pinellascounty.org/park/beaches.htm beaches] of St. Petersburg, Clearwater, and Ft. De Soto. USF itself is among the top 3 research universities in Florida, with over 45 faculty members in Chemistry, a top-notch [http://www.usf.edu/it/research-computing/ research computing] facility, member of the [http://www.floridahightech.com/hightechindustry.php Florida high-tech corridor], and an emerging [http://sciences.cas.usf.edu/research_clusters Research Cluster on Computational Theory & Practice]. The group needs computer-science inclined chemistry/engineering/physics/mathematics BS/BA, as we build a computational physical chemistry lab from the ground up. We specialize in multiscale modeling to span the chasm between chemical theory and industrial practice. On the way, we will develop cutting-edge techniques in constrained optimization, computational geometry, symbolic algebra and parallel algorithms and apply them to the design and analysis of energy conversion processes occurring in nano- and micro-scale devices. Success doing this work requires a personal drive to build connections to new application areas, confront challenging questions with massive numerical computations, and to present your work to outside audiences. Interested applicants must have an undergraduate GPA of at least 3.0 and send a list of relevant experience and lofty aspirations, names of two references, and source code snippets to davidrogers -at usf.edu and apply online with the USF [http://chemistry.usf.edu/graduate/ graduate school]. Emailing unofficial transcripts may be attached to support your experience and background statements. bc2b1f50957ad0e320dcac5050da465a3263cff5 78 77 2013-10-21T22:23:52Z David M. Rogers 2 wikitext text/x-wiki Tuition and living expenses for four years in warm, sunny Tampa are available to pay for two students to move through graduate school and earn a Ph.D. in computational physical chemistry. The [http://www.usf.edu University of South Florida] is North of the city, near [http://www.mosi.org MOSI] and [http://buschgardens.com Bush Gardens], and approximately a 30-50 min drive from Tampa Bay and the beautiful [http://www.pinellascounty.org/park/beaches.htm beaches] of St. Petersburg, Clearwater, and Ft. De Soto. USF itself is among the top 3 research universities in Florida, with over 45 faculty members in Chemistry, a top-notch [http://www.usf.edu/it/research-computing/ research computing] facility, member of the [http://www.floridahightech.com/hightechindustry.php Florida high-tech corridor], and an emerging [http://sciences.cas.usf.edu/research_clusters Research Cluster on Computational Theory & Practice]. The group needs computer-science inclined chemistry/engineering/physics/mathematics BS/BA, as we build a computational physical chemistry lab from the ground up. We specialize in multiscale modeling to span the chasm between chemical theory and industrial practice. On the way, we will develop cutting-edge techniques in constrained optimization, computational geometry, symbolic algebra and parallel algorithms and apply them to the design and analysis of energy conversion processes occurring in nano- and micro-scale devices. Success doing this work requires a personal drive to build connections to new application areas, confront challenging questions with massive numerical computations, and to present your work to outside audiences. Interested applicants must have an undergraduate GPA of at least 3.0 and send a list of relevant experience and lofty aspirations, names of two references, and source code snippets to davidrogers -at usf.edu, and apply online with the USF [http://chemistry.usf.edu/graduate/ graduate school]. Unofficial transcripts may also be emailed to support your experience and background statements. 7ef5bfa8ee0f2730a8d8a5c99059443028b31e50 HowTo 0 13 79 42 2013-10-24T14:45:30Z David M. Rogers 2 wikitext text/x-wiki I'm constantly finding that life is like a bunch of little projects, sandwiching a few much larger projects. Here's some free advice for the little projects. * [[HowTo:CleanUpUbuntu|Clean Up Ubuntu 12]] * [[HowTo:VirtualMachine|Build a virtual machine]] * [[HowTo:GNUOSX|Setup Mac OSX for Linux Development and GNU Programs]] * [http://flurdy.com/docs/postfix/ Setup Postfix] * [http://pllab.is.ocha.ac.jp/~asai/cw2011tutorial/ Work With Delimited Continuations] * [[HowTo:ScreeCast|ScreenCast]] 53518f500c23d0443e87f32d0a29390d925189ae 81 79 2013-10-24T14:54:01Z David M. Rogers 2 wikitext text/x-wiki I'm constantly finding that life is like a bunch of little projects, sandwiching a few much larger projects. Here's some free advice for the little projects. * [[HowTo:CleanUpUbuntu|Clean Up Ubuntu 12]] * [[HowTo:VirtualMachine|Build a virtual machine]] * [[HowTo:GNUOSX|Setup Mac OSX for Linux Development and GNU Programs]] * [http://flurdy.com/docs/postfix/ Setup Postfix] * [http://pllab.is.ocha.ac.jp/~asai/cw2011tutorial/ Work With Delimited Continuations] * [[HowTo:ScreenCast|ScreenCast]] 2a7ce27932feea3ee9edf2a08f4846af6fa6cfe7 86 81 2013-11-02T18:07:24Z David M. Rogers 2 wikitext text/x-wiki I'm constantly finding that life is like a bunch of little projects, sandwiching a few much larger projects. Here's some free advice for the little projects. * [[HowTo:CleanUpUbuntu|Clean Up Ubuntu 12]] * [[HowTo:VirtualMachine|Build a virtual machine]] * [[HowTo:GNUOSX|Setup Mac OSX for Linux Development and GNU Programs]] * [http://flurdy.com/docs/postfix/ Setup Postfix] * [http://pllab.is.ocha.ac.jp/~asai/cw2011tutorial/ Work With Delimited Continuations] * [[HowTo:ScreenCast|ScreenCast]] * [[HowTo:AndroidPhoto|Archive Photos From the Android]] 547de63f7109694d08d88b3cfb48b2f5dda470d4 HowTo:ScreenCast 0 27 80 2013-10-24T14:53:14Z David M. Rogers 2 Created page with "On Mac OSX, you should be able to create screen recordings from QuickTime (File -> Screen Recording). There are two great methods for screen capture on Linux. The first is an o…" wikitext text/x-wiki On Mac OSX, you should be able to create screen recordings from QuickTime (File -> Screen Recording). There are two great methods for screen capture on Linux. The first is an old-school terminal capture agent, ttyrec and ttyplay. They store and play back the traditional 80x24 color terminal to millisecond accuracy. The second is a X-windows based capture from our friends at ffmpeg, and worked out by a friendly hacker [http://ubuntuforums.org/showthread.php?t=1392026]. The command that worked for me was: <source lang="bash"> ffmpeg -f alsa -ac 2 -i pulse -f x11grab -r 30 -s 1024x600 -i :0.0 -sameq -acodec pcm_s16le output.avi </source> You can also single out a window using: <source lang="bash"> xwininfo | grep -e Width -e Height -e Absolute </source> and the clicking in a window, adding (e.g.) the options to ffmpeg <source lang="bash"> -s 664x486 -i :0.0+383,184 </source> The result can be compressed with <source lang="bash"> ffmpeg -i output.avi -acodec libmp3lame -ab 128k -ac 2 -vcodec libxvid -qscale 8 -me_method full -mbd rd -flags +gmc+qpel+mv4 -trellis 1 -threads 0 our-final-product.avi # or ffmpeg -i output.avi -an -vcodec libvpx -b 1000k -pass 1 our-final-product.webm ffmpeg -i output.avi -acodec libvorbis -ab 128k -ac 2 -vcodec libvpx -b 1000k -threads 2 -pass 2 our-final-product.webm # or ffmpeg -i output.avi -acodec libvorbis -ab 128k -ac 2 -vcodec libtheora -b 1000k our-final-product.ogg </source> for a completely free file. A range can be selected with, e.g. <source lang="bash"> -ss 00:00:10 -t 00:07:22 </source> The [http://www.mediawiki.org/wiki/Extension:HTML5video HTML5Video] MediaWiki extension lets you play these formats easily within most modern browsers. d226afcd25ecc384456d89f3d297251a5a9a67a5 82 80 2013-10-24T14:55:20Z David M. Rogers 2 moved [[HowTo:ScreeCast]] to [[HowTo:ScreenCast]]:&#32;Today's letter is 'n'. wikitext text/x-wiki On Mac OSX, you should be able to create screen recordings from QuickTime (File -> Screen Recording). There are two great methods for screen capture on Linux. The first is an old-school terminal capture agent, ttyrec and ttyplay. They store and play back the traditional 80x24 color terminal to millisecond accuracy. The second is a X-windows based capture from our friends at ffmpeg, and worked out by a friendly hacker [http://ubuntuforums.org/showthread.php?t=1392026]. The command that worked for me was: <source lang="bash"> ffmpeg -f alsa -ac 2 -i pulse -f x11grab -r 30 -s 1024x600 -i :0.0 -sameq -acodec pcm_s16le output.avi </source> You can also single out a window using: <source lang="bash"> xwininfo | grep -e Width -e Height -e Absolute </source> and the clicking in a window, adding (e.g.) the options to ffmpeg <source lang="bash"> -s 664x486 -i :0.0+383,184 </source> The result can be compressed with <source lang="bash"> ffmpeg -i output.avi -acodec libmp3lame -ab 128k -ac 2 -vcodec libxvid -qscale 8 -me_method full -mbd rd -flags +gmc+qpel+mv4 -trellis 1 -threads 0 our-final-product.avi # or ffmpeg -i output.avi -an -vcodec libvpx -b 1000k -pass 1 our-final-product.webm ffmpeg -i output.avi -acodec libvorbis -ab 128k -ac 2 -vcodec libvpx -b 1000k -threads 2 -pass 2 our-final-product.webm # or ffmpeg -i output.avi -acodec libvorbis -ab 128k -ac 2 -vcodec libtheora -b 1000k our-final-product.ogg </source> for a completely free file. A range can be selected with, e.g. <source lang="bash"> -ss 00:00:10 -t 00:07:22 </source> The [http://www.mediawiki.org/wiki/Extension:HTML5video HTML5Video] MediaWiki extension lets you play these formats easily within most modern browsers. d226afcd25ecc384456d89f3d297251a5a9a67a5 HowTo:ScreeCast 0 28 83 2013-10-24T14:55:20Z David M. Rogers 2 moved [[HowTo:ScreeCast]] to [[HowTo:ScreenCast]]:&#32;Today's letter is 'n'. wikitext text/x-wiki #REDIRECT [[HowTo:ScreenCast]] 3c68ac5b4eef56ed8e1a9f702d1bdcf5dd0c2e4e File:HW3.pdf 6 29 85 2013-10-31T18:54:55Z David M. Rogers 2 wikitext text/x-wiki da39a3ee5e6b4b0d3255bfef95601890afd80709 HowTo:AndroidPhoto 0 30 87 2013-11-02T18:14:57Z David M. Rogers 2 Created page with "One-time setup: <source lang="bash"> aptitude install libusb1-dev golang-go mtp-tools fuse-utils libfuse2 mtp-detect # (will tell you specific vendor and product id) # These id-s…" wikitext text/x-wiki One-time setup: <source lang="bash"> aptitude install libusb1-dev golang-go mtp-tools fuse-utils libfuse2 mtp-detect # (will tell you specific vendor and product id) # These id-s (18d1 and 4ee1) are specific for the Nexus 4: echo 'ATTRS{idVendor}=="18d1",ATTRS{idProduct}=="4ee1",MODE="0666",GROUP="plugdev"' >/etc/udev/rules.d/50-android.rules # - add yourself to 'fuse' group (fuse line in /etc/group) # - log back in to take effect mkdir $HOME/golang export GOPATH=$HOME/golang go get github.com/hanwen/go-mtpfs ln -s $GOPATH/bin/go-mtpfs $HOME/bin </source> Since the picture filenames all contain the date (e.g. '''IMG_20130401_000007.jpg'''), you can use '''cut''' to sort them by month. <source lang="bash"> # mtp-detect # go-mtpfs droid # cd droid/Internal\ storage/DCIM/Camera for i in *; do d=`cut -d _ -f 2 <<<"$i"` y=`cut -b 1-4 <<< $d` m=`cut -b 5-6 <<< $d` mkdir -p ~/Pictures/$y/$m cp "$i" ~/Pictures/$y/$m echo "$i" done # cd # fusermount -u droid </source> Otherwise, sorting by file date would have required <source lang="bash"> find . -newermt "01/01/2013" -and -not -newermt "02/01/2013" </source> (which lists the file in the month you're looking for). acbbed376c2378da1500b43f7459a63a454b3569 88 87 2013-11-02T18:15:57Z David M. Rogers 2 wikitext text/x-wiki One-time setup: <source lang="bash"> sudo aptitude install libusb1-dev golang-go mtp-tools fuse-utils libfuse2 sudo mtp-detect # (will tell you specific vendor and product id) # These id-s (18d1 and 4ee1) are specific for the Nexus 4: sudo echo 'ATTRS{idVendor}=="18d1",ATTRS{idProduct}=="4ee1",MODE="0666",GROUP="plugdev"' >/etc/udev/rules.d/50-android.rules # - add yourself to 'fuse' group (fuse line in /etc/group) # - log back in to take effect mkdir $HOME/golang export GOPATH=$HOME/golang go get github.com/hanwen/go-mtpfs ln -s $GOPATH/bin/go-mtpfs $HOME/bin </source> Since the picture filenames all contain the date (e.g. '''IMG_20130401_000007.jpg'''), you can use '''cut''' to sort them by month. <source lang="bash"> # mtp-detect # go-mtpfs droid # cd droid/Internal\ storage/DCIM/Camera for i in *; do d=`cut -d _ -f 2 <<<"$i"` y=`cut -b 1-4 <<< $d` m=`cut -b 5-6 <<< $d` mkdir -p ~/Pictures/$y/$m cp "$i" ~/Pictures/$y/$m echo "$i" done # cd # fusermount -u droid </source> Otherwise, sorting by file date would have required <source lang="bash"> find . -newermt "01/01/2013" -and -not -newermt "02/01/2013" </source> (which lists the file in the month you're looking for). 63ef74dd9b38e932dedbd4d079fe910cccb8e7fc Courses 0 16 89 29 2013-11-04T13:46:37Z David M. Rogers 2 wikitext text/x-wiki Here's a list of courses with useful online materials: == Courses == * [[GradQuantumFall2013| USF Graduate Quantum Mechanics]] * [http://lambda-the-ultimate.org/classic/Courses.html Functional Programming] == Lecture Series == * [http://www.esqc.org/lectures European Summer School in Quantum Chemistry] == Tutorials == * [http://www.mathematica-journal.com/2012/02/evaluation-of-gaussian-molecular-integrals Evaluating Matrix Elements] * [http://www.haskell.org/tutorial/ Haskell] * [http://monads.haskell.cz/html/index.html Monads] * [http://www.yosefk.com/blog/my-history-with-forth-stack-machines.html The Forth Language] == Reference Material == * [http://dft.sandia.gov/Quest/DFT_codes.html List of DFT Codes] * [http://docs.python.org/3/tutorial/ Python Tutorial] * [http://www.nwchem-sw.org/index.php/Release62:NWChem_Documentation NWChem Documentation] * [http://www.ebi.ac.uk/pdbe-srv/pdbechem/ PDB Ligand Structures] 6b0095a60eacaa985afcad40941899146a571da6 105 89 2013-11-15T04:54:24Z David M. Rogers 2 /* Courses */ wikitext text/x-wiki Here's a list of courses with useful online materials: == Courses == * [[GradQuantumFall2013| USF Graduate Quantum Mechanics I]] * [[GradQuantumSpring2014| USF Graduate Quantum Mechanics II]] * [http://lambda-the-ultimate.org/classic/Courses.html Functional Programming] == Lecture Series == * [http://www.esqc.org/lectures European Summer School in Quantum Chemistry] == Tutorials == * [http://www.mathematica-journal.com/2012/02/evaluation-of-gaussian-molecular-integrals Evaluating Matrix Elements] * [http://www.haskell.org/tutorial/ Haskell] * [http://monads.haskell.cz/html/index.html Monads] * [http://www.yosefk.com/blog/my-history-with-forth-stack-machines.html The Forth Language] == Reference Material == * [http://dft.sandia.gov/Quest/DFT_codes.html List of DFT Codes] * [http://docs.python.org/3/tutorial/ Python Tutorial] * [http://www.nwchem-sw.org/index.php/Release62:NWChem_Documentation NWChem Documentation] * [http://www.ebi.ac.uk/pdbe-srv/pdbechem/ PDB Ligand Structures] ca188099603530ec7800b25fe5f864197e40857e 107 105 2013-11-15T05:07:44Z David M. Rogers 2 Undo revision 105 by [[Special:Contributions/David M. Rogers|David M. Rogers]] ([[User talk:David M. Rogers|Talk]]) wikitext text/x-wiki Here's a list of courses with useful online materials: == Courses == * [[GradQuantumFall2013| USF Graduate Quantum Mechanics]] * [http://lambda-the-ultimate.org/classic/Courses.html Functional Programming] == Lecture Series == * [http://www.esqc.org/lectures European Summer School in Quantum Chemistry] == Tutorials == * [http://www.mathematica-journal.com/2012/02/evaluation-of-gaussian-molecular-integrals Evaluating Matrix Elements] * [http://www.haskell.org/tutorial/ Haskell] * [http://monads.haskell.cz/html/index.html Monads] * [http://www.yosefk.com/blog/my-history-with-forth-stack-machines.html The Forth Language] == Reference Material == * [http://dft.sandia.gov/Quest/DFT_codes.html List of DFT Codes] * [http://docs.python.org/3/tutorial/ Python Tutorial] * [http://www.nwchem-sw.org/index.php/Release62:NWChem_Documentation NWChem Documentation] * [http://www.ebi.ac.uk/pdbe-srv/pdbechem/ PDB Ligand Structures] 6b0095a60eacaa985afcad40941899146a571da6 Code 0 18 90 40 2013-11-04T14:02:54Z David M. Rogers 2 wikitext text/x-wiki == Python Libraries == === Geometric Algebra === The [http://www.predictivestatmech.org/code/galg.py Multivector] class implements geometric algebra using Python's operator overloading. It works with minimal space for any number of spatial dimensions, since it's not based on the matrix / spinor representation of Clifford algebra. Instead, it takes the basis blade approach recommended by Dorst, Fondijne, and Mann [http://www.geometricalgebra.net]. It's really just as easy as ordering all the basis vectors, and keeping track of the commutator (+/- <math>\hat 1</math>). == Templates == The real world have forms, computation has templates. Pick one up, fill in the blanks, and send it down the chute. * [[NWChem|NWChem Jobs]] * [[Code:SGE|SGE (USF Circe)]] == Code Humor == Put this into your makefile: <source lang=bash> Clint\ Eastwood: myday echo "I feel great!" </source> 00aa203634fd99731162b0c467c5342bb5a141b5 Code:SGE 0 32 94 2013-11-04T14:11:04Z David M. Rogers 2 Created page with "Here's a basic template for queuing a job using MPI (here 4 cpus and 6h max run-time). <source lang="bash"> #$ -N a-test-job #$ -cwd #$ -o job-$JOB_ID.out #$ -e job-$JOB_ID.err …" wikitext text/x-wiki Here's a basic template for queuing a job using MPI (here 4 cpus and 6h max run-time). <source lang="bash"> #$ -N a-test-job #$ -cwd #$ -o job-$JOB_ID.out #$ -e job-$JOB_ID.err #$ -l pcpus=4,h_rt=06:00:00 # Example minimum memory request: #$ -l mpj=10G # Max run-time sets queue: # queue max run-time # devel 1 hour # short 6 hours # medium 2 day # long 1 week mpirun parallel-executable </source> Submit with <source lang="bash"> qsub job.sh </source> For execution and status, use '''qstat''' For more info, see [https://cwa.rc.usf.edu/projects/research-computing/wiki/Guide_to_GridEngine the CIRCE SGE guide.] Here's a run-down on the environment variables available during running (for scripting): <source lang="bash"> # Environment Menu: # $JOB_ID: The job number assigned by the scheduler to your job # 1844896 # $JOBDIR: The directory your job is currently running in # <blank> # $USER: The username of the person currently running the job # anyuser # $TMPDIR: The directory containing informational files about the job e.g. the machines allocated to run the job, etc. # /tmp/1844896.1.default # $SGE_O_WORKDIR: Similar to $JOBDIR # /home/a/anyuser/test # $HOME: User's home directory on execution machine # /home/d/anyuser # $JOB_NAME: The job name specified by -N option # a-test-job # $HOSTNAME: Name of execution host # wh-520-7-5.rc.usf.edu # $TASK_ID: You can submit array jobs. This would be the TASK number in the array job of the current task # <blank> # $SGE_CELL: SGE cell that the job is currently running in # default # $SGE_O_SHELL: Invoking shell of the current SGE job # /bin/bash # $QUEUE: Current running queue # default </source> b240f6b5e02de461e116aa3570648767a418e9a4 NWChem 0 33 95 2013-11-04T14:30:44Z David M. Rogers 2 Created page with "A simple SCF energy calculation on the input file '''start.xyz''' can be done with: start en_scf title "Pople SCF energy" geometry units angstrom load start.xyz end ba…" wikitext text/x-wiki A simple SCF energy calculation on the input file '''start.xyz''' can be done with: start en_scf title "Pople SCF energy" geometry units angstrom load start.xyz end basis # * library cc-pvdz # * library 6-31G* * library 3-21G end task scf energy Running a geometry optimization just requires replacing the '''task''' directive. Here, we've also added a block of parameters controlling the minimization algorithm. start opt_scf title "Pople SCF geometry optimization" geometry units angstrom load start.xyz end basis # * library cc-pvdz # * library 6-31G* * library 3-21G end driver loose maxiter 150 end task scf optimize You can also use DFT rather than HF (SCF) by changing the appropriate keywords and adding a DFT block to specify its functional: start opt_dft title "Pople DFT geometry optimization" geometry units angstrom load start.xyz end basis # * library cc-pvdz # * library 6-31G* * library 3-21G end dft xc xpbe96 1.0 \ pw91lda local 1.0 \ cpbe96 nonlocal 1.0 direct iterations 150 grid fine disp vdw 2 end driver loose maxiter 150 end task dft optimize 303beca0fa46c59535c298376c1218d8e30323bc 96 95 2013-11-04T14:47:28Z David M. Rogers 2 wikitext text/x-wiki A simple SCF energy calculation on the input file '''start.xyz''' can be done with: start en_scf title "Pople SCF energy" geometry units angstrom load start.xyz end basis # * library cc-pvdz # * library 6-31G* * library 3-21G end task scf energy Running a geometry optimization just requires replacing the '''task''' directive. Here, we've also added a block of parameters controlling the minimization algorithm. start opt_scf title "Pople SCF geometry optimization" geometry units angstrom load start.xyz end basis # * library cc-pvdz # * library 6-31G* * library 3-21G end driver loose maxiter 150 end task scf optimize You can also use DFT rather than HF (SCF) by changing the appropriate keywords and adding a DFT block to specify its functional: start opt_dft title "Pople DFT geometry optimization" geometry units angstrom load start.xyz end basis # * library cc-pvdz # * library 6-31G* * library 3-21G end dft xc xpbe96 1.0 \ pw91lda local 1.0 \ cpbe96 nonlocal 1.0 direct iterations 150 grid fine disp vdw 2 end driver loose maxiter 150 end task dft optimize Of course, we need to be able to specify the charge and total spin for most systems as well. Here's an input example appropriate for Fe3+ (5 spin-up electrons making up a half-filled d-shell): start en_scf title "Pople SCF energy" geometry start units angstrom load start.xyz end basis # * library cc-pvdz # * library 6-31G* * library 3-21G end set geometry start charge 3 scf sextet end task scf energy cb13f559a02dfb76a5203ec6af827e3d5d835418 97 96 2013-11-04T14:52:28Z David M. Rogers 2 wikitext text/x-wiki A simple SCF energy calculation on the input file '''start.xyz''' can be done with: start en_scf title "Pople SCF energy" geometry units angstrom load start.xyz end basis # * library cc-pvdz # * library 6-31G* * library 3-21G end task scf energy Running a geometry optimization just requires replacing the '''task''' directive. Here, we've also added a block of parameters controlling the minimization algorithm. start opt_scf title "Pople SCF geometry optimization" geometry units angstrom load start.xyz end basis # * library cc-pvdz # * library 6-31G* * library 3-21G end driver loose maxiter 150 end task scf optimize You can also use DFT rather than HF (SCF) by changing the appropriate keywords and adding a DFT block to specify its functional: start opt_dft title "Pople DFT geometry optimization" geometry units angstrom load start.xyz end basis # * library cc-pvdz # * library 6-31G* * library 3-21G end dft xc xpbe96 1.0 \ pw91lda local 1.0 \ cpbe96 nonlocal 1.0 direct iterations 150 grid fine disp vdw 2 end driver loose maxiter 150 end task dft optimize Of course, we need to be able to specify the charge and total spin for most systems as well. Here's an input example appropriate for Fe3+ (5 spin-up electrons making up a half-filled d-shell): start en_scf title "Pople SCF energy" geometry start units angstrom load start.xyz end basis # Fe library "Ahlrichs pVDZ" # better basis * library 3-21G end set geometry start charge 3 scf sextet end task scf energy 1e9b95b3090476d3d990b052d735484e04db3d64 98 97 2013-11-04T15:02:15Z David M. Rogers 2 wikitext text/x-wiki When in doubt, check the [http://www.nwchem-sw.org/index.php/Release62:NWChem_Documentation Documentation], and test! == Energy Calculation == A simple SCF energy calculation on the input file '''start.xyz''' can be done with: start en_scf title "Pople SCF energy" geometry units angstrom load start.xyz end basis # * library cc-pvdz # * library 6-31G* * library 3-21G end task scf energy == Geometry Optimization == Running a geometry optimization just requires replacing the '''task''' directive. Here, we've also added a block of parameters controlling the minimization algorithm. start opt_scf title "Pople SCF geometry optimization" geometry units angstrom load start.xyz end basis # * library cc-pvdz # * library 6-31G* * library 3-21G end driver loose maxiter 150 xyz opt end task scf optimize == DFT == You can also use DFT rather than HF (SCF) by changing the appropriate keywords and adding a DFT block to specify its functional: start opt_dft title "Pople DFT geometry optimization" geometry units angstrom load start.xyz end basis # * library cc-pvdz # * library 6-31G* * library 3-21G end dft xc xpbe96 1.0 \ pw91lda local 1.0 \ cpbe96 nonlocal 1.0 direct iterations 150 grid fine disp vdw 2 end driver loose maxiter 150 xyz opt end task dft optimize The "xyz opt" causes NWChem to write out coordinate files, e.g. '''opt-001.xyz''', ... as the optimization is proceeding. == Specifying Charge and Spin == Of course, we need to be able to specify the charge and total spin for most systems as well. Here's an input example appropriate for Fe3+ (5 spin-up electrons making up a half-filled d-shell): start en_scf title "Pople SCF energy" geometry start units angstrom load start.xyz end basis # Fe library "Ahlrichs pVDZ" # better basis * library 3-21G end set geometry start charge 3 scf sextet end task scf energy == Vibrational Frequencies == At a minimum, the second derivatives of the potential energy surface with respect to the nuclear coordinates make up a 3Nx3N matrix. The eigenvectors represent vibrational 'modes,' and the eigenvalues represent their force constants. Analyzing each mode as a harmonic oscillator leads to a set of vibrational frequencies, which give thermochemical information on the molecule as well as IR spectroscopic information. From a minimized set of coordinates, all you should require is to add the appropriate task (and optionally a block of parameters) task scf frequencies 4a93588727bdd153d5dcfde212e0e961d8365505 99 98 2013-11-05T13:44:47Z David M. Rogers 2 wikitext text/x-wiki When in doubt, check the [http://www.nwchem-sw.org/index.php/Release62:NWChem_Documentation Documentation], and test! == Running NWChem == First, login to a system (e.g. circe) with nwchem installed. Next, load the NWChem module and set up a working dir. <source lang="bash"> module load apps/nwchem/6.1.1 mkdir nw-test cd nw-test </source> Then create a molecule (you can download an sdf file from the PDB ligand structure database listed in the [[Courses|course reference material]] (Search by molecule name -> Download Links (on left panel) -> Ideal Molfile). Next, paste the molecule into a file, e.g. <source lang="bash"> cat >start.sdf <<. FOR.sdf -ISIS- 3D 4 3 0 0 0 0 0 0 0 0 0 V2000 0.6070 0.0000 0.0000 C 0 0 0 0 0 -0.6000 0.0000 0.0000 O 0 0 0 0 0 1.1470 0.9350 0.0020 H 0 0 0 0 0 1.1470 -0.9350 0.0020 H 0 0 0 0 0 1 2 2 0 0 0 1 3 1 0 0 0 1 4 1 0 0 0 M END $$$$ . </source> You'll also need to paste one of the templates below (they work without changes) into an NWChem control file called '''en_scf.nw'''. Use the 'cat' command to paste into the file as above. Finally, convert '''start.sdf''' to an xyz format for NWChem and run nwchem. <source lang="bash"> babel start.sdf start.xyz nwchem en_scf.nw >en_scf.log </source> All your output will be in en_scf.log (scp/download it to your local system). In the future, use the batch queue system with <source lang="bash"> cat >en_job.sh <<. #$ -N a-test-job #$ -cwd #$ -o job-$JOB_ID.out #$ -e job-$JOB_ID.err #$ -l pcpus=4,h_rt=06:00:00 module load apps/nwchem/6.1.1 cd $HOME/nw-test mpirun `which nwchem` en_scf.nw >en_scf.log . </source> This runs on 4 cpus in parallel, so it will be faster than running (as before) directly on the login node. Of course, you'll also want to change some options in the run file eventually (especially the basis set). You can also manually edit the xyz file and scan the energy vs some coordinate. See the templates below for more ideas. Note that you can also edit the files on your system and transfer, or edit locally on circe using your favorite linux editor. Nano is easy to use. <source lang="bash"> nano en_scf.nw </source> == Energy Calculation == A simple SCF energy calculation on the input file '''start.xyz''' can be done with: start en_scf title "Pople SCF energy" geometry units angstrom load start.xyz end basis # * library cc-pvdz # * library 6-31G* * library 3-21G end task scf energy == Geometry Optimization == Running a geometry optimization just requires replacing the '''task''' directive. Here, we've also added a block of parameters controlling the minimization algorithm. start opt_scf title "Pople SCF geometry optimization" geometry units angstrom load start.xyz end basis # * library cc-pvdz # * library 6-31G* * library 3-21G end driver loose maxiter 150 xyz opt end task scf optimize == DFT == You can also use DFT rather than HF (SCF) by changing the appropriate keywords and adding a DFT block to specify its functional: start opt_dft title "Pople DFT geometry optimization" geometry units angstrom load start.xyz end basis # * library cc-pvdz # * library 6-31G* * library 3-21G end dft xc xpbe96 1.0 \ pw91lda local 1.0 \ cpbe96 nonlocal 1.0 direct iterations 150 grid fine disp vdw 2 end driver loose maxiter 150 xyz opt end task dft optimize The "xyz opt" causes NWChem to write out coordinate files, e.g. '''opt-001.xyz''', ... as the optimization is proceeding. == Specifying Charge and Spin == Of course, we need to be able to specify the charge and total spin for most systems as well. Here's an input example appropriate for Fe3+ (5 spin-up electrons making up a half-filled d-shell): start en_scf title "Pople SCF energy" geometry start units angstrom load start.xyz end basis # Fe library "Ahlrichs pVDZ" # better basis * library 3-21G end set geometry start charge 3 scf sextet end task scf energy == Vibrational Frequencies == At a minimum, the second derivatives of the potential energy surface with respect to the nuclear coordinates make up a 3Nx3N matrix. The eigenvectors represent vibrational 'modes,' and the eigenvalues represent their force constants. Analyzing each mode as a harmonic oscillator leads to a set of vibrational frequencies, which give thermochemical information on the molecule as well as IR spectroscopic information. From a minimized set of coordinates, all you should require is to add the appropriate task (and optionally a block of parameters) task scf frequencies c08882913d973a2c0fb64e04115fc4a35e50bb98 100 99 2013-11-05T13:46:29Z David M. Rogers 2 /* Running NWChem */ wikitext text/x-wiki When in doubt, check the [http://www.nwchem-sw.org/index.php/Release62:NWChem_Documentation Documentation], and test! == Running NWChem == First, login to a system (e.g. circe) with nwchem installed. Next, load the NWChem module and set up a working dir. <source lang="bash"> module load apps/nwchem/6.1.1 mkdir nw-test cd nw-test </source> Then create a molecule (you can download an sdf file from the PDB ligand structure database listed in the [[Courses|course reference material]] (Search by molecule name -> Download Links (on left panel) -> Ideal Molfile). Next, paste the molecule into a file, e.g. <source lang="bash"> cat >start.sdf <<. FOR.sdf -ISIS- 3D 4 3 0 0 0 0 0 0 0 0 0 V2000 0.6070 0.0000 0.0000 C 0 0 0 0 0 -0.6000 0.0000 0.0000 O 0 0 0 0 0 1.1470 0.9350 0.0020 H 0 0 0 0 0 1.1470 -0.9350 0.0020 H 0 0 0 0 0 1 2 2 0 0 0 1 3 1 0 0 0 1 4 1 0 0 0 M END $$$$ . </source> You'll also need to paste one of the templates below (they work without changes) into an NWChem control file called '''en_scf.nw'''. Use the 'cat' command to paste into the file as above. Finally, convert '''start.sdf''' to an xyz format for NWChem and run nwchem. <source lang="bash"> babel start.sdf start.xyz nwchem en_scf.nw >en_scf.log </source> All your output will be in en_scf.log (scp/download it to your local system). In the future, use the batch queue system with <source lang="bash"> cat >en_job.sh <<. #$ -N a-test-job #$ -cwd #$ -o job-$JOB_ID.out #$ -e job-$JOB_ID.err #$ -l pcpus=4,h_rt=06:00:00 module load apps/nwchem/6.1.1 cd $HOME/nw-test mpirun `which nwchem` en_scf.nw >en_scf.log . qsub en_job.sh qstat -u $USER -t </source> This runs on 4 cpus in parallel, so it will be faster than running (as before) directly on the login node. Of course, you'll also want to change some options in the run file eventually (especially the basis set). You can also manually edit the xyz file and scan the energy vs some coordinate. See the templates below for more ideas. Note that you can also edit the files on your system and transfer, or edit locally on circe using your favorite linux editor. Nano is easy to use. <source lang="bash"> nano en_scf.nw </source> == Energy Calculation == A simple SCF energy calculation on the input file '''start.xyz''' can be done with: start en_scf title "Pople SCF energy" geometry units angstrom load start.xyz end basis # * library cc-pvdz # * library 6-31G* * library 3-21G end task scf energy == Geometry Optimization == Running a geometry optimization just requires replacing the '''task''' directive. Here, we've also added a block of parameters controlling the minimization algorithm. start opt_scf title "Pople SCF geometry optimization" geometry units angstrom load start.xyz end basis # * library cc-pvdz # * library 6-31G* * library 3-21G end driver loose maxiter 150 xyz opt end task scf optimize == DFT == You can also use DFT rather than HF (SCF) by changing the appropriate keywords and adding a DFT block to specify its functional: start opt_dft title "Pople DFT geometry optimization" geometry units angstrom load start.xyz end basis # * library cc-pvdz # * library 6-31G* * library 3-21G end dft xc xpbe96 1.0 \ pw91lda local 1.0 \ cpbe96 nonlocal 1.0 direct iterations 150 grid fine disp vdw 2 end driver loose maxiter 150 xyz opt end task dft optimize The "xyz opt" causes NWChem to write out coordinate files, e.g. '''opt-001.xyz''', ... as the optimization is proceeding. == Specifying Charge and Spin == Of course, we need to be able to specify the charge and total spin for most systems as well. Here's an input example appropriate for Fe3+ (5 spin-up electrons making up a half-filled d-shell): start en_scf title "Pople SCF energy" geometry start units angstrom load start.xyz end basis # Fe library "Ahlrichs pVDZ" # better basis * library 3-21G end set geometry start charge 3 scf sextet end task scf energy == Vibrational Frequencies == At a minimum, the second derivatives of the potential energy surface with respect to the nuclear coordinates make up a 3Nx3N matrix. The eigenvectors represent vibrational 'modes,' and the eigenvalues represent their force constants. Analyzing each mode as a harmonic oscillator leads to a set of vibrational frequencies, which give thermochemical information on the molecule as well as IR spectroscopic information. From a minimized set of coordinates, all you should require is to add the appropriate task (and optionally a block of parameters) task scf frequencies 81c9dd1f5fd4f960b1ad22bcce11ac957c75334c File:CH3.xyz 6 34 101 2013-11-07T14:25:13Z David M. Rogers 2 wikitext text/x-wiki da39a3ee5e6b4b0d3255bfef95601890afd80709 File:HW4.pdf 6 35 103 2013-11-13T15:01:47Z David M. Rogers 2 wikitext text/x-wiki da39a3ee5e6b4b0d3255bfef95601890afd80709 GradQuantumSpring2014 0 36 106 2013-11-15T05:06:31Z David M. Rogers 2 Created page with " Advanced Reference Material: [http://usf.eblib.com.ezproxy.lib.usf.edu/patron/FullRecord.aspx?p=1214609 D.R. Yarkony, ed., Modern Electronic Structure Theory, (World Scientific,…" wikitext text/x-wiki Advanced Reference Material: [http://usf.eblib.com.ezproxy.lib.usf.edu/patron/FullRecord.aspx?p=1214609 D.R. Yarkony, ed., Modern Electronic Structure Theory, (World Scientific, Singapore, 1995).] c2cd40e18ae06e369998b4799d83d43a21ec5d1b GradQuantumFall2013 0 15 111 110 2013-11-23T14:58:06Z David M. Rogers 2 /* Course Outline */ wikitext text/x-wiki <BIG>Graduate Quantum Mechanics</BIG> [[Media:CHM6938.005-syllabus.doc|Text Syllabus]] == Meeting Time == CHM 6938-005 (Quantum Mechanics I) will meet Mondays and Wednesdays from 10:45am-12:00pm in NES 104. The instructor may be reached anytime by phone 4-4298 or email (username: davidrogers on usf.edu). == Course Overview & Objectives == Nanoscience has already reached its natural quantum limit, bringing the 'spooky' behavior of quantum systems into the center of a revolution. This course will rigorously develop the fundamentals of quantum mechanics required for understanding the interplay of electricity and magnetism with electronic structure. By the end of the course, you will be able to determine which problems in chemistry and physics have an essentially quantum nature. For those that do, you will know the rules for formulating the solution mathematically and the tools and special tricks for completing the solution. You will also learn aspects of numerical solutions and partial differential equations that apply to many aspect of modern technology outside of QM. As a research course, you will be expected to finish with a high-level understanding of where to find worked projects similar to new and open questions, and to mix, match, and evaluate solution techniques before diving into differentiation or trial and error. == Grading & Due Dates == Your work will be graded based on homework assignments (80%) and one student project (20%). * Homework 1: Problems from Bes, 2007 Chapter 2 - due Monday, September 9 * [[Media:HW2.pdf|Homework 2]]: Problems based on Bes, Ch. 4, 5 and 9 - due Monday, October 7 * [[Media:HW3.pdf|Homework 3]]: Worked Examples of the Schrodinger Equation - due Monday, October 28 * [[Media:HW4.pdf|Homework 4]]: Introduction to Group Theory - due Monday, November 18 == Some Useful Preliminaries == Partial differential equations, linear algebra, Fourier series These will be reviewed in the course, but undergraduate calculus is required. == Textbooks == * Quantum Mechanics: A Modern and Concise Introductory Course, Daniel Bes (Springer, 2007 (2nd ed) or 2012 (3rd ed)) Bes gives an excellent survey of the myriad applications of QM, and is detailed enough to provide all the tools and intuition needed to do the math. It does as well as anyone should expect in getting at the whys and hows of the confusion that is quantum, including various manifestations of the measurement problem. [http://usf.catalog.fcla.edu/permalink.jsp?24SF020303747 eBook] * McQuarrie (Quantum Chemistry, 2nd ed., Univ. Sci. 2007) McQuarrie focuses in on molecular electronic structure, providing a chemistry compliment to Bes' physics-oriented book. It covers what we need to understand molecular computations, including spectroscopy, thermochemistry, Hartree-Fock and Slater determinants, molecular orbitals, density-functional theory. Leung and Marshall have written a solutions manual, Problems and Solutions for McQuarrie's QM, Univ. Sci., 2007. Both these texts are available at the library (possibly in course reserves), and purchasing them is not required for the course. === Other QM Texts === * Pauling (free book on archive.org) ** Early, but presciently maps out the next ~30 y. of developments * Atkins * Griffiths * Levine * Shankar (Principles of QM, 2nd ed., Plenum 1994) ** Introduces Quantization using commutation... * Landau & Lifschitz 3 & 4 * Advanced Quantum Mechanics, Dick Rainer (Springer, 2012) - chem/phys. * [http://usf.catalog.fcla.edu/permalink.jsp?24SF030655622 Bes, QM 2012 edition] == Course Outline == # for((i=0;i<120;i+=7)); do date -v8m -v26d -v+"$i"d; done (01) Aug 26 Class intro., failures of classical mechanics, Planck's hypothesis. [[Media:LectA.pdf|Notes]] Weeks 1-4 correspond roughly to Bes' Chapters 1-4 and Chapter 13 on the history of QM. Pages 11-28 of the [http://science.energy.gov/~/media/bes/pdf/reports/files/gc_rpt.pdf DOE Grand Challenges report] also make for great related reading. (02) Sep 2 (Mon. = Labor Day) Review of the Schrodinger equation, Heisenberg states and all that. Basic linear algebra. [[Media:notes.pdf|Typed Class Notes]] (03) Sep 9 Eigenvalue decompositions and measurements in QM. (04) Sep 16 Worked solutions to HW1. (05) Sep 23 One-dimensional problems - review of the potential well. New applications for the Helmholtz equation - bound and scattering states. Variational solutions. <!-- Perturbation theory calculations, also applied to H<math>_2</math>. --> Interspersed with background on group projects. (06) Sep 30 Applications of the Helmholtz equation, continued - tunneling, radioactive decay and diffraction. Time-dependent perturbation theory and the interpretation of off-diagonal matrix elements. This covers material in Bes, Ch. 9. (07) Oct 7 Review of HW2. (08) Oct 14 Mathematics of rotation and solution of the 2-body Kepler problem. Application to rotational (far infrared) spectroscopy. Week 8 corresponds roughly to Bes' Chapter 5 and rotational spectroscopy in McQuarrie. (09) Oct 21 Review of the harmonic oscillator and hydrogen atom, introduction to multi-particle statistics. Week 9 corresponds roughly to Bes' Chapters 6-7. (10) Oct 28 Introduction to molecular symmetry operations. Electronic (UV) and vibrational (IR) polarizability. Molecular point groups and symmetry properties. Your reference for the group theory material is McQuarrie's book. (11) Nov 4 Numerical solution of Schrodinger's equation and QM software intro. [[NWChem]] Review of HW3 solutions. (12) Nov 11 (Mon. = Veteran's Day) Group theory and spectroscopy review. (13) Nov 18 Example group project presentation - EPR paradox, the Bell inequalities, and Bohm's suggestion. (14) Nov 25 (Fri. Nov 29 = Day after Thanksgiving) Nov. 25 - Understanding HF output and visualizing orbitals with NWChem. Nov. 27 - Variational calculation of H2 energy. (15) Dec 2 Dec. 2 - Transition state theory and numerical solution of Schrodinger. Dec. 4 - Working problems with the class. (16) Dec 9 - final exam week (no class) Coming up next semester: Running large parallel electronic structure calculations and plotting molecular orbitals. The role of basis functions and convergence. Electronic polarization and its role in UV absorption and dispersion forces. QM/MM methods applicable to the condensed phase - the many representations of solvent. Basic statistics of Boson and Fermion energy distributions - statistics on top of statistics. Statistics of an electron gas. The Kohn-Sham decomposition and the resulting alphabet soup of density functionals. Thermochemistry, chemical reactions and kinetics. Feynman's path integral representation of QM - derivation of classical mechanics, Heisenberg and Schrodinger. Elementary path integrals, and the concepts of coupled-cluster perturbation. Emerging research areas in molecular physics simulation and statistics. Optional material: Quaternion representation of rotations and the Dirac equation. <!-- Weeks 8-9 correspond roughly to Bes' Chapters 7-9. More material from McQuarrie will be brought in at this point. --> == List of Group Study Topics == # Einstein, Podolsky and Rosen's paradox and Bell's inequality. # [http://prola.aps.org/toc/PR/v85/i2 Bohm's quantum interpretation of quantum mechanics] (see also [http://link.springer.com/article/10.1007/BF01889272 Bell's later response]) # [http://shodor.org/succeed-1.0/programs/compchem98/labs/sto/ Gaussian-type orbitals, exponents, and integrals][http://www.computationalscience.org/ccce/Lesson2/02_lab_basissets.pdf] for the H<math>_2</math> atom. # Calculating electron hopping rates using the [http://www.jetp.ac.ru/cgi-bin/dn/e_020_04_1018.pdf Non-equilibrium Green's function] method #* see Keldysh, "Diagram Technique for Nonequilibrium Processes," Keldysh, Sov. Phys. 1965. and Ch. 10 of Physical Kinetics, Lifshitz # Eyring's [http://scitation.aip.org.ezproxy.lib.usf.edu/content/aip/journal/jcp/3/2/10.1063/1.1749604 transition-state-theory][http://dx.doi.org/10.1021/cr60056a006] [http://dx.doi.org/10.1021/jp953748q] and reaction diagrams using [http://en.wikipedia.org/wiki/Marcus_theory Marcus Theory] lit ref: [http://dx.doi.org/10.1017/S0033583501003730 Warshel and Parson] [http://dx.doi.org/10.1063/1.1740102]. # Formulation of QM expectations using path integrals # Numerical solution methods for 1D problems. Choose an interesting topic in groups of no more than 3 students by Friday, Oct. 4. [[Media:GroupAssignment.pdf |Group Assignment Instructions]] 8a5836635433eef0ed424a5631b1783146438281 NWChem 0 33 112 100 2013-11-25T19:47:34Z David M. Rogers 2 wikitext text/x-wiki When in doubt, check the [http://www.nwchem-sw.org/index.php/Release62:NWChem_Documentation Documentation], and test! == Running NWChem == First, login to a system (e.g. circe) with nwchem installed. Next, load the NWChem module and set up a working dir. <source lang="bash"> module load apps/nwchem/6.1.1 mkdir nw-test cd nw-test </source> Then create a molecule (you can download an sdf file from the PDB ligand structure database listed in the [[Courses|course reference material]] (Search by molecule name -> Download Links (on left panel) -> Ideal Molfile). Next, paste the molecule into a file, e.g. <source lang="bash"> cat >start.sdf <<. FOR.sdf -ISIS- 3D 4 3 0 0 0 0 0 0 0 0 0 V2000 0.6070 0.0000 0.0000 C 0 0 0 0 0 -0.6000 0.0000 0.0000 O 0 0 0 0 0 1.1470 0.9350 0.0020 H 0 0 0 0 0 1.1470 -0.9350 0.0020 H 0 0 0 0 0 1 2 2 0 0 0 1 3 1 0 0 0 1 4 1 0 0 0 M END $$$$ . </source> You'll also need to paste one of the templates below (they work without changes) into an NWChem control file called '''en_scf.nw'''. Use the 'cat' command to paste into the file as above. Finally, convert '''start.sdf''' to an xyz format for NWChem and run nwchem. <source lang="bash"> babel start.sdf start.xyz nwchem en_scf.nw >en_scf.log </source> All your output will be in en_scf.log (scp/download it to your local system). In the future, use the batch queue system with <source lang="bash"> cat >en_job.sh <<. #$ -N a-test-job #$ -cwd #$ -o job-$JOB_ID.out #$ -e job-$JOB_ID.err #$ -l pcpus=4,h_rt=06:00:00 module load apps/nwchem/6.1.1 cd $HOME/nw-test mpirun `which nwchem` en_scf.nw >en_scf.log . qsub en_job.sh qstat -u $USER -t </source> This runs on 4 cpus in parallel, so it will be faster than running (as before) directly on the login node. Of course, you'll also want to change some options in the run file eventually (especially the basis set). You can also manually edit the xyz file and scan the energy vs some coordinate. See the templates below for more ideas. Note that you can also edit the files on your system and transfer, or edit locally on circe using your favorite linux editor. Nano is easy to use. <source lang="bash"> nano en_scf.nw </source> == Energy Calculation == A simple SCF energy calculation on the input file '''start.xyz''' can be done with: start en_scf title "Pople SCF energy" geometry units angstrom load start.xyz end basis # * library cc-pvdz # * library 6-31G* * library 3-21G end task scf energy == Geometry Optimization == Running a geometry optimization just requires replacing the '''task''' directive. Here, we've also added a block of parameters controlling the minimization algorithm. start opt_scf title "Pople SCF geometry optimization" geometry units angstrom load start.xyz end basis # * library cc-pvdz # * library 6-31G* * library 3-21G end driver loose maxiter 150 xyz opt end task scf optimize == DFT == You can also use DFT rather than HF (SCF) by changing the appropriate keywords and adding a DFT block to specify its functional: start opt_dft title "Pople DFT geometry optimization" geometry units angstrom load start.xyz end basis # * library cc-pvdz # * library 6-31G* * library 3-21G end dft xc xpbe96 1.0 \ pw91lda local 1.0 \ cpbe96 nonlocal 1.0 direct iterations 150 grid fine disp vdw 2 end driver loose maxiter 150 xyz opt end task dft optimize The "xyz opt" causes NWChem to write out coordinate files, e.g. '''opt-001.xyz''', ... as the optimization is proceeding. == Specifying Charge and Spin == Of course, we need to be able to specify the charge and total spin for most systems as well. Here's an input example appropriate for Fe3+ (5 spin-up electrons making up a half-filled d-shell): start en_scf title "Pople SCF energy" geometry start units angstrom load start.xyz end basis # Fe library "Ahlrichs pVDZ" # better basis * library 3-21G end set geometry start charge 3 scf sextet end task scf energy == Vibrational Frequencies == At a minimum, the second derivatives of the potential energy surface with respect to the nuclear coordinates make up a 3Nx3N matrix. The eigenvectors represent vibrational 'modes,' and the eigenvalues represent their force constants. Analyzing each mode as a harmonic oscillator leads to a set of vibrational frequencies, which give thermochemical information on the molecule as well as IR spectroscopic information. From a minimized set of coordinates, all you should require is to add the appropriate task (and optionally a block of parameters) task scf frequencies == Orbital Analysis == Molecular orbital analysis is relatively easy once the HF equations have been solved, since the linear combinations of atomic orbitals that make up each of the molecular orbitals are stored in a file '''(jobname).movecs'''. To plot the total density and the contents of orbitals numbered 54 and 55 (from checking through the HF output), use: dplot title dens vectors en_scf.movecs LimitXYZ -5.0 5.0 30 -5.0 5.0 30 -5.0 5.0 30 spin total gaussian output dens.cube end task dplot dplot title homo vectors en_scf.movecs LimitXYZ -5.0 5.0 30 -5.0 5.0 30 -5.0 5.0 30 spin total orbitals view; 1; 54 gaussian output homo.cube end task dplot dplot Title lumo vectors en_scf.movecs LimitXYZ -5.0 5.0 30 -5.0 5.0 30 -5.0 5.0 30 spin total orbitals view; 1; 55 gaussian output lumo.cube end task dplot The Gaussian-format cube files can be opened with pymol and visualized by typing, e.g. isomesh mesh1, dens, 0.1, all, carve=1.6 isomesh mesh2, lumo, 0.01, all, carve=1.6 isomesh mesh3, lumo, -0.01, all, carve=1.6 to create isosurfaces at the values 0.1 for the density and <math>\pm 0.01</math> for the LUMO's wavefunction. Adam Hogan noted that (according to [http://www.nwchem-sw.org/index.php/Special:AWCforum/st/id309]) these orbitals are still associated with HF theory. To compute MP2-level quantities (natural orbitals), you instead use a matrix of derivatives of the orbitals to calculate matrix elements of an operator<math>\langle \psi | O | \psi \rangle<\math>. To get those, you have to run '''task mp2 gradient''', which creates '''(jobname).mp2nos'''. You then replace '''vectors en_scf.movecs''' with '''vectors en_scf.mp2nos''' inside the '''dens''' blocks above to get the high-level densities. Here's an example of using mo2nos values to get the electrostatic potential: mp2 tight freeze atomic end task MP2 gradient set "esp:input vectors" en_scf.mp2nos esp recalculate probe 0.07 range 0.3 factor 1 spacing 0.02 end task esp 56f8c2ebba29da3af2becfde061098fa26bfeb47 113 112 2013-11-25T19:48:23Z David M. Rogers 2 /* Orbital Analysis */ wikitext text/x-wiki When in doubt, check the [http://www.nwchem-sw.org/index.php/Release62:NWChem_Documentation Documentation], and test! == Running NWChem == First, login to a system (e.g. circe) with nwchem installed. Next, load the NWChem module and set up a working dir. <source lang="bash"> module load apps/nwchem/6.1.1 mkdir nw-test cd nw-test </source> Then create a molecule (you can download an sdf file from the PDB ligand structure database listed in the [[Courses|course reference material]] (Search by molecule name -> Download Links (on left panel) -> Ideal Molfile). Next, paste the molecule into a file, e.g. <source lang="bash"> cat >start.sdf <<. FOR.sdf -ISIS- 3D 4 3 0 0 0 0 0 0 0 0 0 V2000 0.6070 0.0000 0.0000 C 0 0 0 0 0 -0.6000 0.0000 0.0000 O 0 0 0 0 0 1.1470 0.9350 0.0020 H 0 0 0 0 0 1.1470 -0.9350 0.0020 H 0 0 0 0 0 1 2 2 0 0 0 1 3 1 0 0 0 1 4 1 0 0 0 M END $$$$ . </source> You'll also need to paste one of the templates below (they work without changes) into an NWChem control file called '''en_scf.nw'''. Use the 'cat' command to paste into the file as above. Finally, convert '''start.sdf''' to an xyz format for NWChem and run nwchem. <source lang="bash"> babel start.sdf start.xyz nwchem en_scf.nw >en_scf.log </source> All your output will be in en_scf.log (scp/download it to your local system). In the future, use the batch queue system with <source lang="bash"> cat >en_job.sh <<. #$ -N a-test-job #$ -cwd #$ -o job-$JOB_ID.out #$ -e job-$JOB_ID.err #$ -l pcpus=4,h_rt=06:00:00 module load apps/nwchem/6.1.1 cd $HOME/nw-test mpirun `which nwchem` en_scf.nw >en_scf.log . qsub en_job.sh qstat -u $USER -t </source> This runs on 4 cpus in parallel, so it will be faster than running (as before) directly on the login node. Of course, you'll also want to change some options in the run file eventually (especially the basis set). You can also manually edit the xyz file and scan the energy vs some coordinate. See the templates below for more ideas. Note that you can also edit the files on your system and transfer, or edit locally on circe using your favorite linux editor. Nano is easy to use. <source lang="bash"> nano en_scf.nw </source> == Energy Calculation == A simple SCF energy calculation on the input file '''start.xyz''' can be done with: start en_scf title "Pople SCF energy" geometry units angstrom load start.xyz end basis # * library cc-pvdz # * library 6-31G* * library 3-21G end task scf energy == Geometry Optimization == Running a geometry optimization just requires replacing the '''task''' directive. Here, we've also added a block of parameters controlling the minimization algorithm. start opt_scf title "Pople SCF geometry optimization" geometry units angstrom load start.xyz end basis # * library cc-pvdz # * library 6-31G* * library 3-21G end driver loose maxiter 150 xyz opt end task scf optimize == DFT == You can also use DFT rather than HF (SCF) by changing the appropriate keywords and adding a DFT block to specify its functional: start opt_dft title "Pople DFT geometry optimization" geometry units angstrom load start.xyz end basis # * library cc-pvdz # * library 6-31G* * library 3-21G end dft xc xpbe96 1.0 \ pw91lda local 1.0 \ cpbe96 nonlocal 1.0 direct iterations 150 grid fine disp vdw 2 end driver loose maxiter 150 xyz opt end task dft optimize The "xyz opt" causes NWChem to write out coordinate files, e.g. '''opt-001.xyz''', ... as the optimization is proceeding. == Specifying Charge and Spin == Of course, we need to be able to specify the charge and total spin for most systems as well. Here's an input example appropriate for Fe3+ (5 spin-up electrons making up a half-filled d-shell): start en_scf title "Pople SCF energy" geometry start units angstrom load start.xyz end basis # Fe library "Ahlrichs pVDZ" # better basis * library 3-21G end set geometry start charge 3 scf sextet end task scf energy == Vibrational Frequencies == At a minimum, the second derivatives of the potential energy surface with respect to the nuclear coordinates make up a 3Nx3N matrix. The eigenvectors represent vibrational 'modes,' and the eigenvalues represent their force constants. Analyzing each mode as a harmonic oscillator leads to a set of vibrational frequencies, which give thermochemical information on the molecule as well as IR spectroscopic information. From a minimized set of coordinates, all you should require is to add the appropriate task (and optionally a block of parameters) task scf frequencies == Orbital Analysis == Molecular orbital analysis is relatively easy once the HF equations have been solved, since the linear combinations of atomic orbitals that make up each of the molecular orbitals are stored in a file '''(jobname).movecs'''. To plot the total density and the contents of orbitals numbered 54 and 55 (from checking through the HF output), use: dplot title dens vectors en_scf.movecs LimitXYZ -5.0 5.0 30 -5.0 5.0 30 -5.0 5.0 30 spin total gaussian output dens.cube end task dplot dplot title homo vectors en_scf.movecs LimitXYZ -5.0 5.0 30 -5.0 5.0 30 -5.0 5.0 30 spin total orbitals view; 1; 54 gaussian output homo.cube end task dplot dplot Title lumo vectors en_scf.movecs LimitXYZ -5.0 5.0 30 -5.0 5.0 30 -5.0 5.0 30 spin total orbitals view; 1; 55 gaussian output lumo.cube end task dplot The Gaussian-format cube files can be opened with pymol and visualized by typing, e.g. isomesh mesh1, dens, 0.1, all, carve=1.6 isomesh mesh2, lumo, 0.01, all, carve=1.6 isomesh mesh3, lumo, -0.01, all, carve=1.6 to create isosurfaces at the values 0.1 for the density and <math>\pm 0.01</math> for the LUMO's wavefunction. Adam Hogan noted that (according to [http://www.nwchem-sw.org/index.php/Special:AWCforum/st/id309]) these orbitals are still associated with HF theory. To compute MP2-level quantities (natural orbitals), you instead use a matrix of derivatives of the orbitals to calculate matrix elements of an operator<math>\langle \psi | O | \psi \rangle<\math>. To get those, you have to run '''task mp2 gradient''', which creates '''(jobname).mp2nos'''. You then replace '''vectors en_scf.movecs''' with '''vectors en_scf.mp2nos''' inside the '''dens''' blocks above to get the high-level densities. Here's an example of using mo2nos values to get the electrostatic potential: mp2 tight freeze atomic end task MP2 gradient set "esp:input vectors" en_scf.mp2nos esp recalculate probe 0.07 range 0.3 factor 1 spacing 0.02 end task esp 3561059441762e922a67186e1749d8bcc1d48cd4 114 113 2013-11-25T19:51:03Z David M. Rogers 2 /* Orbital Analysis */ wikitext text/x-wiki When in doubt, check the [http://www.nwchem-sw.org/index.php/Release62:NWChem_Documentation Documentation], and test! == Running NWChem == First, login to a system (e.g. circe) with nwchem installed. Next, load the NWChem module and set up a working dir. <source lang="bash"> module load apps/nwchem/6.1.1 mkdir nw-test cd nw-test </source> Then create a molecule (you can download an sdf file from the PDB ligand structure database listed in the [[Courses|course reference material]] (Search by molecule name -> Download Links (on left panel) -> Ideal Molfile). Next, paste the molecule into a file, e.g. <source lang="bash"> cat >start.sdf <<. FOR.sdf -ISIS- 3D 4 3 0 0 0 0 0 0 0 0 0 V2000 0.6070 0.0000 0.0000 C 0 0 0 0 0 -0.6000 0.0000 0.0000 O 0 0 0 0 0 1.1470 0.9350 0.0020 H 0 0 0 0 0 1.1470 -0.9350 0.0020 H 0 0 0 0 0 1 2 2 0 0 0 1 3 1 0 0 0 1 4 1 0 0 0 M END $$$$ . </source> You'll also need to paste one of the templates below (they work without changes) into an NWChem control file called '''en_scf.nw'''. Use the 'cat' command to paste into the file as above. Finally, convert '''start.sdf''' to an xyz format for NWChem and run nwchem. <source lang="bash"> babel start.sdf start.xyz nwchem en_scf.nw >en_scf.log </source> All your output will be in en_scf.log (scp/download it to your local system). In the future, use the batch queue system with <source lang="bash"> cat >en_job.sh <<. #$ -N a-test-job #$ -cwd #$ -o job-$JOB_ID.out #$ -e job-$JOB_ID.err #$ -l pcpus=4,h_rt=06:00:00 module load apps/nwchem/6.1.1 cd $HOME/nw-test mpirun `which nwchem` en_scf.nw >en_scf.log . qsub en_job.sh qstat -u $USER -t </source> This runs on 4 cpus in parallel, so it will be faster than running (as before) directly on the login node. Of course, you'll also want to change some options in the run file eventually (especially the basis set). You can also manually edit the xyz file and scan the energy vs some coordinate. See the templates below for more ideas. Note that you can also edit the files on your system and transfer, or edit locally on circe using your favorite linux editor. Nano is easy to use. <source lang="bash"> nano en_scf.nw </source> == Energy Calculation == A simple SCF energy calculation on the input file '''start.xyz''' can be done with: start en_scf title "Pople SCF energy" geometry units angstrom load start.xyz end basis # * library cc-pvdz # * library 6-31G* * library 3-21G end task scf energy == Geometry Optimization == Running a geometry optimization just requires replacing the '''task''' directive. Here, we've also added a block of parameters controlling the minimization algorithm. start opt_scf title "Pople SCF geometry optimization" geometry units angstrom load start.xyz end basis # * library cc-pvdz # * library 6-31G* * library 3-21G end driver loose maxiter 150 xyz opt end task scf optimize == DFT == You can also use DFT rather than HF (SCF) by changing the appropriate keywords and adding a DFT block to specify its functional: start opt_dft title "Pople DFT geometry optimization" geometry units angstrom load start.xyz end basis # * library cc-pvdz # * library 6-31G* * library 3-21G end dft xc xpbe96 1.0 \ pw91lda local 1.0 \ cpbe96 nonlocal 1.0 direct iterations 150 grid fine disp vdw 2 end driver loose maxiter 150 xyz opt end task dft optimize The "xyz opt" causes NWChem to write out coordinate files, e.g. '''opt-001.xyz''', ... as the optimization is proceeding. == Specifying Charge and Spin == Of course, we need to be able to specify the charge and total spin for most systems as well. Here's an input example appropriate for Fe3+ (5 spin-up electrons making up a half-filled d-shell): start en_scf title "Pople SCF energy" geometry start units angstrom load start.xyz end basis # Fe library "Ahlrichs pVDZ" # better basis * library 3-21G end set geometry start charge 3 scf sextet end task scf energy == Vibrational Frequencies == At a minimum, the second derivatives of the potential energy surface with respect to the nuclear coordinates make up a 3Nx3N matrix. The eigenvectors represent vibrational 'modes,' and the eigenvalues represent their force constants. Analyzing each mode as a harmonic oscillator leads to a set of vibrational frequencies, which give thermochemical information on the molecule as well as IR spectroscopic information. From a minimized set of coordinates, all you should require is to add the appropriate task (and optionally a block of parameters) task scf frequencies == Orbital Analysis == Molecular orbital analysis is relatively easy once the HF equations have been solved, since the linear combinations of atomic orbitals that make up each of the molecular orbitals are stored in a file '''(jobname).movecs'''. To plot the total density and the contents of orbitals numbered 54 and 55 (from checking through the HF output), use: dplot title dens vectors en_scf.movecs LimitXYZ -5.0 5.0 30 -5.0 5.0 30 -5.0 5.0 30 spin total gaussian output dens.cube end task dplot dplot title homo vectors en_scf.movecs LimitXYZ -5.0 5.0 30 -5.0 5.0 30 -5.0 5.0 30 spin total orbitals view; 1; 54 gaussian output homo.cube end task dplot dplot Title lumo vectors en_scf.movecs LimitXYZ -5.0 5.0 30 -5.0 5.0 30 -5.0 5.0 30 spin total orbitals view; 1; 55 gaussian output lumo.cube end task dplot The Gaussian-format cube files can be opened with pymol and visualized by typing, e.g. isomesh mesh1, dens, 0.1, all, carve=1.6 isomesh mesh2, lumo, 0.01, all, carve=1.6 isomesh mesh3, lumo, -0.01, all, carve=1.6 to create isosurfaces at the values 0.1 for the density and <math>\pm 0.01</math> for the LUMO's wavefunction. Adam Hogan noted that (according to [http://www.nwchem-sw.org/index.php/Special:AWCforum/st/id309]) these orbitals are still associated with HF theory. To compute MP2-level quantities (natural orbitals), you instead use a matrix of derivatives of the orbitals to calculate matrix elements of an operator <math>\langle \psi | O | \psi \rangle</math>. To get those, you have to run '''task mp2 gradient''', which creates '''(jobname).mp2nos'''. You then replace '''vectors en_scf.movecs''' with '''vectors en_scf.mp2nos''' inside the '''dens''' blocks above to get the high-level densities. Here's an example of using mo2nos values to get the electrostatic potential: mp2 tight freeze atomic end task MP2 gradient set "esp:input vectors" en_scf.mp2nos esp recalculate probe 0.07 range 0.3 factor 1 spacing 0.02 end task esp 1022870be4dc138115a1a38568a1fc0a92e08bc1 Code:SGE 0 32 115 94 2013-11-26T03:52:23Z David M. Rogers 2 wikitext text/x-wiki == User environment == Zeroth, set up your own system (for linux), by adding a host def for circe to your '''$HOME/.ssh/config''' file. Then you don't have to keep typing in circe's full path and your username when running ssh from linux. Host circe User <username on circe> Hostname circe.rc.usf.edu ServerAliveInterval 30 ServerAliveCountMax 120 ForwardX11 yes On circe, first, setup your user environment by creating/editing a '''$HOME/.bashrc''' <source lang="bash"> # .bashrc # Source global definitions if [ -f /etc/bashrc ]; then . /etc/bashrc fi # User specific aliases and functions alias mystat="qstat -u $USER -t" </source> Then create $HOME/.bash_profile, which is run for interactive, login sessions on circe. <source lang="bash"> # .bash_profile # Get the aliases and functions if [ -f ~/.bashrc ]; then . ~/.bashrc fi # User specific environment and startup programs PATH=$PATH:$HOME/bin #module load compilers/intel/11.1.064 mpi/openmpi-1.4.1/intel-11.1.064 module purge module load compilers/intel/11.1.064 mpi/openmpi-1.4.1/intel-11.1.064 apps/cuda/5.0.35 # apps/nwchem/6.1.1 #module load apps/namd/2.7 apps/iso2mesh/0.8.0 apps/netcdf/4.2.0 apps/gaussian/03e01_em64t apps/gromacs/4.5.5a export PATH </source> == Queue == Here's a basic template for queuing a job using MPI (here 4 cpus and 6h max run-time). <source lang="bash"> #$ -N a-test-job #$ -cwd #$ -o job-$JOB_ID.out #$ -e job-$JOB_ID.err #$ -l pcpus=4,h_rt=06:00:00 # Example minimum memory request: #$ -l mpj=10G # Max run-time sets queue: # queue max run-time # devel 1 hour # short 6 hours # medium 2 day # long 1 week mpirun parallel-executable </source> Submit with <source lang="bash"> qsub job.sh </source> For execution and status, use '''qstat''', or the '''mystat''' command, defined as an alias in '''.bashrc'''. For more info, see [https://cwa.rc.usf.edu/projects/research-computing/wiki/Guide_to_GridEngine the CIRCE SGE guide.] Here's a run-down on the environment variables available during running (for scripting): <source lang="bash"> # Environment Menu: # $JOB_ID: The job number assigned by the scheduler to your job # 1844896 # $JOBDIR: The directory your job is currently running in # <blank> # $USER: The username of the person currently running the job # anyuser # $TMPDIR: The directory containing informational files about the job e.g. the machines allocated to run the job, etc. # /tmp/1844896.1.default # $SGE_O_WORKDIR: Similar to $JOBDIR # /home/a/anyuser/test # $HOME: User's home directory on execution machine # /home/d/anyuser # $JOB_NAME: The job name specified by -N option # a-test-job # $HOSTNAME: Name of execution host # wh-520-7-5.rc.usf.edu # $TASK_ID: You can submit array jobs. This would be the TASK number in the array job of the current task # <blank> # $SGE_CELL: SGE cell that the job is currently running in # default # $SGE_O_SHELL: Invoking shell of the current SGE job # /bin/bash # $QUEUE: Current running queue # default </source> 9da0f0706de4bea18105415bc0dbd3d6a3491390 HowTo 0 13 116 86 2013-12-20T20:11:00Z David M. Rogers 2 wikitext text/x-wiki I'm constantly finding that life is like a bunch of little projects, sandwiching a few much larger projects. Here's some free advice for the little projects. * [[HowTo:CleanUpUbuntu|Clean Up Ubuntu 12]] * [[HowTo:VirtualMachine|Build a virtual machine]] * [[HowTo:GNUOSX|Setup Mac OSX for Linux Development and GNU Programs]] * [http://flurdy.com/docs/postfix/ Setup Postfix] * [http://pllab.is.ocha.ac.jp/~asai/cw2011tutorial/ Work With Delimited Continuations] * [[HowTo:ScreenCast|ScreenCast]] * [[HowTo:AndroidPhoto|Archive Photos From the Android]] * [[HowTo:PGP|Set up a client/server protocol using TLS and GNU-PGP authentication]] 2236df49049d500098f674fa56efa1cfa98360a7 HowTo:PGP 0 37 117 2013-12-20T21:49:01Z David M. Rogers 2 Created page with "Online services are the foundation of distributed computing, but security is often overlooked at the beginnings of these projects. Here, I'll explain a really simple way to lock…" wikitext text/x-wiki Online services are the foundation of distributed computing, but security is often overlooked at the beginnings of these projects. Here, I'll explain a really simple way to lock down access to your precious protocols at the transport layer. There are essentially no changes required to the communication protocol. In addition, the method dovetails with the [http://www.gnupg.org/index.html GnuPG] suite for message signature and encryption. == Get Started with GnuPG == Why? GnuPG uses a chain of public-key '''certificates,''' similar to the x.509 '''certificates''' that we're all familiar with our web-browsers constantly complaining about. Each certificate has some private information (that the owner keeps) and some identifying public information that is distributed like a user-id, name and birthdate, or the like. The difference with those other numbers is that revealing the public key doesn't compromise your security, like a password social security number would. Instead, the public key is used to check that a communication could only have come from the person knowing the private key. Things get complicated when more than two people get involved. How do I know a person's public key is '''trusted''' to do something? PGP does this by having one key sign another key. If I want my webserver to recognize a set of users, I can create a server private key and use it to sign the public keys of trusted users. Then I have a chain of signatures that '''validate''' the user's public key. When the user connects, I use that public key to make sure the user knows the corresponding private key. Secure internet servers use x.509 certificates in a similar way to prove that you can trust them. Your browser has a list of '''trusted root''' certificates from places like Verisign and Thawte. When you connect to a random server using HTTPS, the server gives you a public key. Your browser then checks whether that public key has been signed by one of the '''trusted root''' certificates it knows about. Although similar to x.509 server certificates, PGP doesn't have a centrally based set of '''trusted root''' certificate authorities. In fact, anyone can sign for anyone else in the PGP scheme. This makes it much more user-centric. I can, for example, sign source code packages I produce and people who have my public key can verify that they haven't been tampered with. I could produce a hierarchy of keys to sign things like code, purchase orders, or server access. I could use these to delegate those responsibilities. At the same time, I could get those keys signed ''by'' other people (like the manager of a coding project, an accountant, or a server admin). === Install === Use a package-manager to look for a '''gnupg''' or equivalent. <source lang="bash"> apt-get install gnupg # Trisquel / Debian / Mint / Ubuntu fink install gnupg # OSX + Fink yum install gnupg # RHEL / Centos / Scientific Linux / Fedora </source> === Create a Keyring === GnuPG does almost everything through options to the '''gpg''' command. Following along with,[http://www.dewinter.com/gnupg_howto/english/GPGMiniHowto-3.html] <source lang="bash"> gpg --gen-key </source> <pre> gpg (GnuPG) 1.4.13; Copyright (C) 2012 Free Software Foundation, Inc. This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Please select what kind of key you want: (1) RSA and RSA (default) (2) DSA and Elgamal (3) DSA (sign only) (4) RSA (sign only) Your selection? 1 RSA keys may be between 1024 and 4096 bits long. What keysize do you want? (2048) Requested keysize is 2048 bits Please specify how long the key should be valid. 0 = key does not expire <n> = key expires in n days <n>w = key expires in n weeks <n>m = key expires in n months <n>y = key expires in n years Key is valid for? (0) Key does not expire at all Is this correct? (y/N) y You need a user ID to identify your key; the software constructs the user ID from the Real Name, Comment and Email Address in this form: "Heinrich Heine (Der Dichter) <heinrichh@duesseldorf.de>" Real name: David M. Rogers Email address: predictivestatmech@gmail.com Comment: You selected this USER-ID: "David M. Rogers <predictivestatmech@gmail.com>" Change (N)ame, (C)omment, (E)mail or (O)kay/(Q)uit? o You need a Passphrase to protect your secret key. We need to generate a lot of random bytes. It is a good idea to perform some other action (type on the keyboard, move the mouse, utilize the disks) during the prime generation; this gives the random number generator a better chance to gain enough entropy. . We need to generate a lot of random bytes. It is a good idea to perform some other action (type on the keyboard, move the mouse, utilize the disks) during the prime generation; this gives the random number generator a better chance to gain enough entropy. . gpg: ~/.gnupg/trustdb.gpg: trustdb created gpg: key 262B259C marked as ultimately trusted public and secret key created and signed. gpg: checking the trustdb gpg: 3 marginal(s) needed, 1 complete(s) needed, PGP trust model gpg: depth: 0 valid: 1 signed: 0 trust: 0-, 0q, 0n, 0m, 0f, 1u pub 2048R/262B259C 2013-12-20 Key fingerprint = D1CE 9C6A 5099 6753 8FC4 81F5 5B64 9362 262B 259C uid David M. Rogers <predictivestatmech@gmail.com> sub 2048R/E494F149 2013-12-20 </pre> Next, you'll want to double-check that it worked and make sure gnupg's directory has no read or write permissions for anyone other than yourself. <source lang="bash"> gpg --list-keys ls -ld ~/.gnupg </source> For the client/server example, we'll also want to write the public key to a separate file. <source lang="bash"> gpg --export 262B259C --ascii >~/.gnupg/predictivestatmech.asc </source> Next, we'll generate a certificate belonging to my laptop. I'll choose to use this one for allowing users to connect to a new protocol I'm developing. It can't have a password according the GNUTLS manual. <source lang="bash"> gpg --gen-key </source> <pre> gpg (GnuPG) 1.4.13; Copyright (C) 2012 Free Software Foundation, Inc. This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Please select what kind of key you want: (1) RSA and RSA (default) (2) DSA and Elgamal (3) DSA (sign only) (4) RSA (sign only) Your selection? 4 RSA keys may be between 1024 and 4096 bits long. What keysize do you want? (2048) Requested keysize is 2048 bits Please specify how long the key should be valid. 0 = key does not expire <n> = key expires in n days <n>w = key expires in n weeks <n>m = key expires in n months <n>y = key expires in n years Key is valid for? (0) 3y Key expires at Mon Dec 19 15:04:37 2016 EST Is this correct? (y/N) y You need a user ID to identify your key; the software constructs the user ID from the Real Name, Comment and Email Address in this form: "Heinrich Heine (Der Dichter) <heinrichh@duesseldorf.de>" Real name: kubotan Email address: davidrogers@usf.edu Comment: MBPR Laptop You selected this USER-ID: "kubotan (MBPR Laptop) <davidrogers@usf.edu>" Change (N)ame, (C)omment, (E)mail or (O)kay/(Q)uit? o You need a Passphrase to protect your secret key. You don't want a passphrase - this is probably a *bad* idea! I will do it anyway. You can change your passphrase at any time, using this program with the option "--edit-key". We need to generate a lot of random bytes. It is a good idea to perform some other action (type on the keyboard, move the mouse, utilize the disks) during the prime generation; this gives the random number generator a better chance to gain enough entropy. . gpg: key 03357392 marked as ultimately trusted public and secret key created and signed. gpg: checking the trustdb gpg: 3 marginal(s) needed, 1 complete(s) needed, PGP trust model gpg: depth: 0 valid: 2 signed: 0 trust: 0-, 0q, 0n, 0m, 0f, 2u gpg: next trustdb check due at 2016-12-19 pub 2048R/03357392 2013-12-20 [expires: 2016-12-19] Key fingerprint = C417 3765 AB3A 139B 72C3 F093 D35C FD07 0335 7392 uid kubotan (MBPR Laptop) <davidrogers@usf.edu> Note that this key cannot be used for encryption. You may want to use the command "--edit-key" to generate a subkey for this purpose. </pre> Following the suggestion, I'll sign this one with my user key. <source lang="bash"> gpg --edit-key kubotan </source> <pre> gpg (GnuPG) 1.4.13; Copyright (C) 2012 Free Software Foundation, Inc. This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Secret key is available. pub 2048R/03357392 created: 2013-12-20 expires: 2016-12-19 usage: SC trust: ultimate validity: ultimate [ultimate] (1). kubotan (MBPR Laptop) <davidrogers@usf.edu> gpg> sign pub 2048R/03357392 created: 2013-12-20 expires: 2016-12-19 usage: SC trust: ultimate validity: ultimate Primary key fingerprint: C417 3765 AB3A 139B 72C3 F093 D35C FD07 0335 7392 kubotan (MBPR Laptop) <davidrogers@usf.edu> This key is due to expire on 2016-12-19. Are you sure that you want to sign this key with your key "David M. Rogers <predictivestatmech@gmail.com>" (262B259C) Really sign? (y/N) y You need a passphrase to unlock the secret key for user: "David M. Rogers <predictivestatmech@gmail.com>" 2048-bit RSA key, ID 262B259C, created 2013-12-20 gpg> quit Save changes? (y/N) y </pre> My signature belongs to kubotan's key now, so GPG saves my signature there. <source lang="bash" gpg --list-sigs </source> <pre> gpg: checking the trustdb gpg: 3 marginal(s) needed, 1 complete(s) needed, PGP trust model gpg: depth: 0 valid: 2 signed: 0 trust: 0-, 0q, 0n, 0m, 0f, 2u gpg: next trustdb check due at 2016-12-19 /Users/rogers/.gnupg/pubring.gpg -------------------------------- pub 2048R/262B259C 2013-12-20 uid David M. Rogers <predictivestatmech@gmail.com> sig 3 262B259C 2013-12-20 David M. Rogers <predictivestatmech@gmail.com> sub 2048R/E494F149 2013-12-20 sig 262B259C 2013-12-20 David M. Rogers <predictivestatmech@gmail.com> pub 2048R/03357392 2013-12-20 [expires: 2016-12-19] uid kubotan (MBPR Laptop) <davidrogers@usf.edu> sig 3 03357392 2013-12-20 kubotan (MBPR Laptop) <davidrogers@usf.edu> sig 262B259C 2013-12-20 David M. Rogers <predictivestatmech@gmail.com> </pre> I need both its public and private sections to use in the server code, so I'll extract them, and mark them self-read-only. <source lang="bash"> gpg --armor --export "kubotan" >~/.gnupg/kubotan.asc gpg --armor --export-secret-key "kubotan" >~/.gnupg/kubotan-secret.asc chmod 400 ~/.gnupg/*.asc </source> These keys are all you need to sign or encrypt messages as well. To see the usage for those, check the chapters in the [http://www.dewinter.com/gnupg_howto/english/GPGMiniHowto.html GPG Mini-Howto]. == Server == Next, let's get started with some client/server code. TLS stands for transport-layer-security. Normal communications (e.g. http/telnet/ftp) merrily go about sending messages (commands, files, output, etc.) over TCP. TLS-enabled communications (e.g. HTTPS/SSH/SFTP) start a connection by figuring out how to encrypt the session. They can also check signatures to '''authenticate''' the user ''and the server''. After that, all communications are encrypted to prevent data leaking to the local packet sniffing red-team. Although incorporating a 'STARTTLS' message into your protocol has been recommended if you need to talk before authenticating, the lazy way is to just authenticate and start TLS at connection. The GNU TLS library makes this especially easy by handling certificates, doing the initial TLS handshake, and encrypting/decrypting messages passed through gnutls_record_send / gnutls_record_recv. === Installation === The GNUTLS library is under heavy development, and I found that the examples in the manual[http://www.gnutls.org/manual/gnutls.html] would not run with the package manager's version 2.2. So, I installed [http://www.lysator.liu.se/~nisse/archive/nettle-2.7.1.tar.gz nettle 2.7.1] (''--enable-shared'') and gnutls 3.2.7[ftp://ftp.gnutls.org/gcrypt/gnutls/v3.2/gnutls-3.2.7.tar.xz] from source. Apparently someone's been using strerror in gnutls, and someone else has been replacing strerror with repl_strerror to teach them a lesson - so we have to deal with the collateral damage. <source lang="bash"> sed -i.bak -e 's|strerror([^)]*)|""|g' lib/nettle/egd.c sed -i.bak -e 's|strerror([^)]*)|""|g' lib/nettle/rnd.c </source> === Usage === The [http://www.gnutls.org/manual/gnutls.html#Echo-server-with-OpenPGP-authentication server code] for OpenPGP authentication and [http://www.gnutls.org/manual/gnutls.html#Simple-client-example-with-X_002e509-certificate-support client code] for the very similar x.509 authentication are available. Between those two and the code for [http://www.gnutls.org/manual/gnutls.html#Verifying-a-certificate verifying a certificate], we can hack together a client/server pair authenticating using OpenPGP. I'm in the process of adding this to the libixp library for authenticated 9P sessions. c181ab3fad3bd70461df2681077c265c461998ae 118 117 2013-12-20T21:56:40Z David M. Rogers 2 /* Create a Keyring */ wikitext text/x-wiki Online services are the foundation of distributed computing, but security is often overlooked at the beginnings of these projects. Here, I'll explain a really simple way to lock down access to your precious protocols at the transport layer. There are essentially no changes required to the communication protocol. In addition, the method dovetails with the [http://www.gnupg.org/index.html GnuPG] suite for message signature and encryption. == Get Started with GnuPG == Why? GnuPG uses a chain of public-key '''certificates,''' similar to the x.509 '''certificates''' that we're all familiar with our web-browsers constantly complaining about. Each certificate has some private information (that the owner keeps) and some identifying public information that is distributed like a user-id, name and birthdate, or the like. The difference with those other numbers is that revealing the public key doesn't compromise your security, like a password social security number would. Instead, the public key is used to check that a communication could only have come from the person knowing the private key. Things get complicated when more than two people get involved. How do I know a person's public key is '''trusted''' to do something? PGP does this by having one key sign another key. If I want my webserver to recognize a set of users, I can create a server private key and use it to sign the public keys of trusted users. Then I have a chain of signatures that '''validate''' the user's public key. When the user connects, I use that public key to make sure the user knows the corresponding private key. Secure internet servers use x.509 certificates in a similar way to prove that you can trust them. Your browser has a list of '''trusted root''' certificates from places like Verisign and Thawte. When you connect to a random server using HTTPS, the server gives you a public key. Your browser then checks whether that public key has been signed by one of the '''trusted root''' certificates it knows about. Although similar to x.509 server certificates, PGP doesn't have a centrally based set of '''trusted root''' certificate authorities. In fact, anyone can sign for anyone else in the PGP scheme. This makes it much more user-centric. I can, for example, sign source code packages I produce and people who have my public key can verify that they haven't been tampered with. I could produce a hierarchy of keys to sign things like code, purchase orders, or server access. I could use these to delegate those responsibilities. At the same time, I could get those keys signed ''by'' other people (like the manager of a coding project, an accountant, or a server admin). === Install === Use a package-manager to look for a '''gnupg''' or equivalent. <source lang="bash"> apt-get install gnupg # Trisquel / Debian / Mint / Ubuntu fink install gnupg # OSX + Fink yum install gnupg # RHEL / Centos / Scientific Linux / Fedora </source> === Create a Keyring === GnuPG does almost everything through options to the '''gpg''' command. Following along with,[http://www.dewinter.com/gnupg_howto/english/GPGMiniHowto-3.html] <source lang="bash"> gpg --gen-key </source> <pre class="mw-collapsible mw-collapsed"> gpg (GnuPG) 1.4.13; Copyright (C) 2012 Free Software Foundation, Inc. This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Please select what kind of key you want: (1) RSA and RSA (default) (2) DSA and Elgamal (3) DSA (sign only) (4) RSA (sign only) Your selection? 1 RSA keys may be between 1024 and 4096 bits long. What keysize do you want? (2048) Requested keysize is 2048 bits Please specify how long the key should be valid. 0 = key does not expire <n> = key expires in n days <n>w = key expires in n weeks <n>m = key expires in n months <n>y = key expires in n years Key is valid for? (0) Key does not expire at all Is this correct? (y/N) y You need a user ID to identify your key; the software constructs the user ID from the Real Name, Comment and Email Address in this form: "Heinrich Heine (Der Dichter) <heinrichhduesseldorf.de>" Real name: David M. Rogers Email address: predictivestatmechgmail.com Comment: You selected this USER-ID: "David M. Rogers <predictivestatmechgmail.com>" Change (N)ame, (C)omment, (E)mail or (O)kay/(Q)uit? o You need a Passphrase to protect your secret key. We need to generate a lot of random bytes. It is a good idea to perform some other action (type on the keyboard, move the mouse, utilize the disks) during the prime generation; this gives the random number generator a better chance to gain enough entropy. . We need to generate a lot of random bytes. It is a good idea to perform some other action (type on the keyboard, move the mouse, utilize the disks) during the prime generation; this gives the random number generator a better chance to gain enough entropy. . gpg: ~/.gnupg/trustdb.gpg: trustdb created gpg: key 262B259C marked as ultimately trusted public and secret key created and signed. gpg: checking the trustdb gpg: 3 marginal(s) needed, 1 complete(s) needed, PGP trust model gpg: depth: 0 valid: 1 signed: 0 trust: 0-, 0q, 0n, 0m, 0f, 1u pub 2048R/262B259C 2013-12-20 Key fingerprint = D1CE 9C6A 5099 6753 8FC4 81F5 5B64 9362 262B 259C uid David M. Rogers <predictivestatmechgmail.com> sub 2048R/E494F149 2013-12-20 </pre> Next, you'll want to double-check that it worked and make sure gnupg's directory has no read or write permissions for anyone other than yourself. <source lang="bash"> gpg --list-keys ls -ld ~/.gnupg </source> For the client/server example, we'll also want to write the public key to a separate file. <source lang="bash"> gpg --export 262B259C --ascii >~/.gnupg/predictivestatmech.asc </source> Next, we'll generate a certificate belonging to my laptop. I'll choose to use this one for allowing users to connect to a new protocol I'm developing. It can't have a password according the GNUTLS manual. <source lang="bash"> gpg --gen-key </source> <pre> gpg (GnuPG) 1.4.13; Copyright (C) 2012 Free Software Foundation, Inc. This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Please select what kind of key you want: (1) RSA and RSA (default) (2) DSA and Elgamal (3) DSA (sign only) (4) RSA (sign only) Your selection? 4 RSA keys may be between 1024 and 4096 bits long. What keysize do you want? (2048) Requested keysize is 2048 bits Please specify how long the key should be valid. 0 = key does not expire <n> = key expires in n days <n>w = key expires in n weeks <n>m = key expires in n months <n>y = key expires in n years Key is valid for? (0) 3y Key expires at Mon Dec 19 15:04:37 2016 EST Is this correct? (y/N) y You need a user ID to identify your key; the software constructs the user ID from the Real Name, Comment and Email Address in this form: "Heinrich Heine (Der Dichter) <heinrichhduesseldorf.de>" Real name: kubotan Email address: davidrogersusf.edu Comment: MBPR Laptop You selected this USER-ID: "kubotan (MBPR Laptop) <davidrogersusf.edu>" Change (N)ame, (C)omment, (E)mail or (O)kay/(Q)uit? o You need a Passphrase to protect your secret key. You don't want a passphrase - this is probably a *bad* idea! I will do it anyway. You can change your passphrase at any time, using this program with the option "--edit-key". We need to generate a lot of random bytes. It is a good idea to perform some other action (type on the keyboard, move the mouse, utilize the disks) during the prime generation; this gives the random number generator a better chance to gain enough entropy. . gpg: key 03357392 marked as ultimately trusted public and secret key created and signed. gpg: checking the trustdb gpg: 3 marginal(s) needed, 1 complete(s) needed, PGP trust model gpg: depth: 0 valid: 2 signed: 0 trust: 0-, 0q, 0n, 0m, 0f, 2u gpg: next trustdb check due at 2016-12-19 pub 2048R/03357392 2013-12-20 [expires: 2016-12-19] Key fingerprint = C417 3765 AB3A 139B 72C3 F093 D35C FD07 0335 7392 uid kubotan (MBPR Laptop) <davidrogersusf.edu> Note that this key cannot be used for encryption. You may want to use the command "--edit-key" to generate a subkey for this purpose. </pre> Following the suggestion, I'll sign this one with my user key. <source lang="bash"> gpg --edit-key kubotan </source> <pre> gpg (GnuPG) 1.4.13; Copyright (C) 2012 Free Software Foundation, Inc. This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Secret key is available. pub 2048R/03357392 created: 2013-12-20 expires: 2016-12-19 usage: SC trust: ultimate validity: ultimate [ultimate] (1). kubotan (MBPR Laptop) <davidrogersusf.edu> gpg> sign pub 2048R/03357392 created: 2013-12-20 expires: 2016-12-19 usage: SC trust: ultimate validity: ultimate Primary key fingerprint: C417 3765 AB3A 139B 72C3 F093 D35C FD07 0335 7392 kubotan (MBPR Laptop) <davidrogersusf.edu> This key is due to expire on 2016-12-19. Are you sure that you want to sign this key with your key "David M. Rogers <predictivestatmechgmail.com>" (262B259C) Really sign? (y/N) y You need a passphrase to unlock the secret key for user: "David M. Rogers <predictivestatmechgmail.com>" 2048-bit RSA key, ID 262B259C, created 2013-12-20 gpg> quit Save changes? (y/N) y </pre> My signature belongs to kubotan's key now, so GPG saves it there. <source lang="bash"> gpg --list-sigs </source> <pre> gpg: checking the trustdb gpg: 3 marginal(s) needed, 1 complete(s) needed, PGP trust model gpg: depth: 0 valid: 2 signed: 0 trust: 0-, 0q, 0n, 0m, 0f, 2u gpg: next trustdb check due at 2016-12-19 /Users/rogers/.gnupg/pubring.gpg -------------------------------- pub 2048R/262B259C 2013-12-20 uid David M. Rogers <predictivestatmechgmail.com> sig 3 262B259C 2013-12-20 David M. Rogers <predictivestatmechgmail.com> sub 2048R/E494F149 2013-12-20 sig 262B259C 2013-12-20 David M. Rogers <predictivestatmechgmail.com> pub 2048R/03357392 2013-12-20 [expires: 2016-12-19] uid kubotan (MBPR Laptop) <davidrogersusf.edu> sig 3 03357392 2013-12-20 kubotan (MBPR Laptop) <davidrogersusf.edu> sig 262B259C 2013-12-20 David M. Rogers <predictivestatmechgmail.com> </pre> I need both its public and private sections to use in the server code, so I'll extract them, and mark them self-read-only. <source lang="bash"> gpg --armor --export "kubotan" >~/.gnupg/kubotan.asc gpg --armor --export-secret-key "kubotan" >~/.gnupg/kubotan-secret.asc chmod 400 ~/.gnupg/*.asc </source> These keys are all you need to sign or encrypt messages as well. To see the usage for those, check the chapters in the [http://www.dewinter.com/gnupg_howto/english/GPGMiniHowto.html GPG Mini-Howto]. == Server == Next, let's get started with some client/server code. TLS stands for transport-layer-security. Normal communications (e.g. http/telnet/ftp) merrily go about sending messages (commands, files, output, etc.) over TCP. TLS-enabled communications (e.g. HTTPS/SSH/SFTP) start a connection by figuring out how to encrypt the session. They can also check signatures to '''authenticate''' the user ''and the server''. After that, all communications are encrypted to prevent data leaking to the local packet sniffing red-team. Although incorporating a 'STARTTLS' message into your protocol has been recommended if you need to talk before authenticating, the lazy way is to just authenticate and start TLS at connection. The GNU TLS library makes this especially easy by handling certificates, doing the initial TLS handshake, and encrypting/decrypting messages passed through gnutls_record_send / gnutls_record_recv. === Installation === The GNUTLS library is under heavy development, and I found that the examples in the manual[http://www.gnutls.org/manual/gnutls.html] would not run with the package manager's version 2.2. So, I installed [http://www.lysator.liu.se/~nisse/archive/nettle-2.7.1.tar.gz nettle 2.7.1] (''--enable-shared'') and gnutls 3.2.7[ftp://ftp.gnutls.org/gcrypt/gnutls/v3.2/gnutls-3.2.7.tar.xz] from source. Apparently someone's been using strerror in gnutls, and someone else has been replacing strerror with repl_strerror to teach them a lesson - so we have to deal with the collateral damage. <source lang="bash"> sed -i.bak -e 's|strerror([^)]*)|""|g' lib/nettle/egd.c sed -i.bak -e 's|strerror([^)]*)|""|g' lib/nettle/rnd.c </source> === Usage === The [http://www.gnutls.org/manual/gnutls.html#Echo-server-with-OpenPGP-authentication server code] for OpenPGP authentication and [http://www.gnutls.org/manual/gnutls.html#Simple-client-example-with-X_002e509-certificate-support client code] for the very similar x.509 authentication are available. Between those two and the code for [http://www.gnutls.org/manual/gnutls.html#Verifying-a-certificate verifying a certificate], we can hack together a client/server pair authenticating using OpenPGP. I'm in the process of adding this to the libixp library for authenticated 9P sessions. 3b9c2946ec31836bc6a85fa3bcbfe74c7afac10d 119 118 2013-12-20T22:56:58Z David M. Rogers 2 wikitext text/x-wiki Online services are the foundation of distributed computing, but security is often overlooked at the beginnings of these projects. Here, I'll explain a really simple way to lock down access to your precious protocols at the transport layer. There are essentially no changes required to the communication protocol. In addition, the method dovetails with the [http://www.gnupg.org/index.html GnuPG] suite for message signature and encryption. == Get Started with GnuPG == Why? GnuPG uses a chain of public-key '''certificates,''' similar to the x.509 '''certificates''' that we're all familiar with our web-browsers constantly complaining about. Each certificate has some private information (that the owner keeps) and some identifying public information that is distributed like a user-id, name and birthdate, or the like. The difference with those other numbers is that revealing the public key doesn't compromise your security, like a password social security number would. Instead, the public key is used to check that a communication could only have come from the person knowing the private key. Things get complicated when more than two people get involved. How do I know a person's public key is '''trusted''' to do something? PGP does this by having one key sign another key. If I want my webserver to recognize a set of users, I can create a server private key and use it to sign the public keys of trusted users. Then I have a chain of signatures that '''validate''' the user's public key. When the user connects, I use that public key to make sure the user knows the corresponding private key. Secure internet servers use x.509 certificates in a similar way to prove that you can trust them. Your browser has a list of '''trusted root''' certificates from places like Verisign and Thawte. When you connect to a random server using HTTPS, the server gives you a public key. Your browser then checks whether that public key has been signed by one of the '''trusted root''' certificates it knows about. Although similar to x.509 server certificates, PGP doesn't have a centrally based set of '''trusted root''' certificate authorities. In fact, anyone can sign for anyone else in the PGP scheme. This makes it much more user-centric. I can, for example, sign source code packages I produce and people who have my public key can verify that they haven't been tampered with. I could produce a hierarchy of keys to sign things like code, purchase orders, or server access. I could use these to delegate those responsibilities. At the same time, I could get those keys signed ''by'' other people (like the manager of a coding project, an accountant, or a server admin). === Install === Use a package-manager to look for a '''gnupg''' or equivalent. <source lang="bash"> apt-get install gnupg # Trisquel / Debian / Mint / Ubuntu fink install gnupg # OSX + Fink yum install gnupg # RHEL / Centos / Scientific Linux / Fedora </source> === Create a Keyring === GnuPG does almost everything through options to the '''gpg''' command. Following along with,[http://www.dewinter.com/gnupg_howto/english/GPGMiniHowto-3.html] <source lang="bash"> gpg --gen-key </source> <pre class="mw-collapsible mw-collapsed"> gpg (GnuPG) 1.4.13; Copyright (C) 2012 Free Software Foundation, Inc. This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Please select what kind of key you want: (1) RSA and RSA (default) (2) DSA and Elgamal (3) DSA (sign only) (4) RSA (sign only) Your selection? 1 RSA keys may be between 1024 and 4096 bits long. What keysize do you want? (2048) Requested keysize is 2048 bits Please specify how long the key should be valid. 0 = key does not expire <n> = key expires in n days <n>w = key expires in n weeks <n>m = key expires in n months <n>y = key expires in n years Key is valid for? (0) Key does not expire at all Is this correct? (y/N) y You need a user ID to identify your key; the software constructs the user ID from the Real Name, Comment and Email Address in this form: "Heinrich Heine (Der Dichter) <heinrichhduesseldorf.de>" Real name: David M. Rogers Email address: predictivestatmechgmail.com Comment: You selected this USER-ID: "David M. Rogers <predictivestatmechgmail.com>" Change (N)ame, (C)omment, (E)mail or (O)kay/(Q)uit? o You need a Passphrase to protect your secret key. We need to generate a lot of random bytes. It is a good idea to perform some other action (type on the keyboard, move the mouse, utilize the disks) during the prime generation; this gives the random number generator a better chance to gain enough entropy. . We need to generate a lot of random bytes. It is a good idea to perform some other action (type on the keyboard, move the mouse, utilize the disks) during the prime generation; this gives the random number generator a better chance to gain enough entropy. . gpg: ~/.gnupg/trustdb.gpg: trustdb created gpg: key 262B259C marked as ultimately trusted public and secret key created and signed. gpg: checking the trustdb gpg: 3 marginal(s) needed, 1 complete(s) needed, PGP trust model gpg: depth: 0 valid: 1 signed: 0 trust: 0-, 0q, 0n, 0m, 0f, 1u pub 2048R/262B259C 2013-12-20 Key fingerprint = D1CE 9C6A 5099 6753 8FC4 81F5 5B64 9362 262B 259C uid David M. Rogers <predictivestatmechgmail.com> sub 2048R/E494F149 2013-12-20 </pre> Next, you'll want to double-check that it worked and make sure gnupg's directory has no read or write permissions for anyone other than yourself. <source lang="bash"> gpg --list-keys ls -ld ~/.gnupg </source> For the client/server example, we'll also want to write the public key to a separate file. <source lang="bash"> gpg --export 262B259C --ascii >~/.gnupg/predictivestatmech.asc </source> Next, we'll generate a certificate belonging to my laptop. I'll choose to use this one for allowing users to connect to a new protocol I'm developing. It can't have a password according the GNUTLS manual. <source lang="bash"> gpg --gen-key </source> <pre> gpg (GnuPG) 1.4.13; Copyright (C) 2012 Free Software Foundation, Inc. This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Please select what kind of key you want: (1) RSA and RSA (default) (2) DSA and Elgamal (3) DSA (sign only) (4) RSA (sign only) Your selection? 4 RSA keys may be between 1024 and 4096 bits long. What keysize do you want? (2048) Requested keysize is 2048 bits Please specify how long the key should be valid. 0 = key does not expire <n> = key expires in n days <n>w = key expires in n weeks <n>m = key expires in n months <n>y = key expires in n years Key is valid for? (0) 3y Key expires at Mon Dec 19 15:04:37 2016 EST Is this correct? (y/N) y You need a user ID to identify your key; the software constructs the user ID from the Real Name, Comment and Email Address in this form: "Heinrich Heine (Der Dichter) <heinrichhduesseldorf.de>" Real name: kubotan Email address: davidrogersusf.edu Comment: MBPR Laptop You selected this USER-ID: "kubotan (MBPR Laptop) <davidrogersusf.edu>" Change (N)ame, (C)omment, (E)mail or (O)kay/(Q)uit? o You need a Passphrase to protect your secret key. You don't want a passphrase - this is probably a *bad* idea! I will do it anyway. You can change your passphrase at any time, using this program with the option "--edit-key". We need to generate a lot of random bytes. It is a good idea to perform some other action (type on the keyboard, move the mouse, utilize the disks) during the prime generation; this gives the random number generator a better chance to gain enough entropy. . gpg: key 03357392 marked as ultimately trusted public and secret key created and signed. gpg: checking the trustdb gpg: 3 marginal(s) needed, 1 complete(s) needed, PGP trust model gpg: depth: 0 valid: 2 signed: 0 trust: 0-, 0q, 0n, 0m, 0f, 2u gpg: next trustdb check due at 2016-12-19 pub 2048R/03357392 2013-12-20 [expires: 2016-12-19] Key fingerprint = C417 3765 AB3A 139B 72C3 F093 D35C FD07 0335 7392 uid kubotan (MBPR Laptop) <davidrogersusf.edu> Note that this key cannot be used for encryption. You may want to use the command "--edit-key" to generate a subkey for this purpose. </pre> Following the suggestion, I'll sign this one with my user key. <source lang="bash"> gpg --edit-key kubotan </source> <pre> gpg (GnuPG) 1.4.13; Copyright (C) 2012 Free Software Foundation, Inc. This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Secret key is available. pub 2048R/03357392 created: 2013-12-20 expires: 2016-12-19 usage: SC trust: ultimate validity: ultimate [ultimate] (1). kubotan (MBPR Laptop) <davidrogersusf.edu> gpg> sign pub 2048R/03357392 created: 2013-12-20 expires: 2016-12-19 usage: SC trust: ultimate validity: ultimate Primary key fingerprint: C417 3765 AB3A 139B 72C3 F093 D35C FD07 0335 7392 kubotan (MBPR Laptop) <davidrogersusf.edu> This key is due to expire on 2016-12-19. Are you sure that you want to sign this key with your key "David M. Rogers <predictivestatmechgmail.com>" (262B259C) Really sign? (y/N) y You need a passphrase to unlock the secret key for user: "David M. Rogers <predictivestatmechgmail.com>" 2048-bit RSA key, ID 262B259C, created 2013-12-20 gpg> quit Save changes? (y/N) y </pre> My signature belongs to kubotan's key now, so GPG saves it there. <source lang="bash"> gpg --list-sigs </source> <pre> gpg: checking the trustdb gpg: 3 marginal(s) needed, 1 complete(s) needed, PGP trust model gpg: depth: 0 valid: 2 signed: 0 trust: 0-, 0q, 0n, 0m, 0f, 2u gpg: next trustdb check due at 2016-12-19 /Users/rogers/.gnupg/pubring.gpg -------------------------------- pub 2048R/262B259C 2013-12-20 uid David M. Rogers <predictivestatmechgmail.com> sig 3 262B259C 2013-12-20 David M. Rogers <predictivestatmechgmail.com> sub 2048R/E494F149 2013-12-20 sig 262B259C 2013-12-20 David M. Rogers <predictivestatmechgmail.com> pub 2048R/03357392 2013-12-20 [expires: 2016-12-19] uid kubotan (MBPR Laptop) <davidrogersusf.edu> sig 3 03357392 2013-12-20 kubotan (MBPR Laptop) <davidrogersusf.edu> sig 262B259C 2013-12-20 David M. Rogers <predictivestatmechgmail.com> </pre> I need both its public and private sections to use in the server code, so I'll extract them, and mark them self-read-only. <source lang="bash"> gpg --armor --export "kubotan" >~/.gnupg/kubotan.asc gpg --armor --export-secret-key "kubotan" >~/.gnupg/kubotan-secret.asc chmod 400 ~/.gnupg/*.asc </source> These keys are all you need to sign or encrypt messages as well. To see the usage for those, check the chapters in the [http://www.dewinter.com/gnupg_howto/english/GPGMiniHowto.html GPG Mini-Howto]. == Server == Next, let's get started with some client/server code. TLS stands for transport-layer-security. Normal communications (e.g. http/telnet/ftp) merrily go about sending messages (commands, files, output, etc.) over TCP. TLS-enabled communications (e.g. HTTPS/SSH/SFTP) start a connection by figuring out how to encrypt the session. They can also check signatures to '''authenticate''' the user ''and the server''. After that, all communications are encrypted to prevent data leaking to the local packet sniffing red-team. Although incorporating a 'STARTTLS' message into your protocol has been recommended if you need to talk before authenticating, the lazy way is to just authenticate and start TLS at connection. The GNU TLS library makes this especially easy by handling certificates, doing the initial TLS handshake, and encrypting/decrypting messages passed through gnutls_record_send / gnutls_record_recv. === Installation === The GNUTLS library is under heavy development, and I found that the examples in the manual[http://www.gnutls.org/manual/gnutls.html] would not run with the package manager's version 2.2. So, I installed [http://www.lysator.liu.se/~nisse/archive/nettle-2.7.1.tar.gz nettle 2.7.1] (''--enable-shared'') and gnutls 3.2.7[ftp://ftp.gnutls.org/gcrypt/gnutls/v3.2/gnutls-3.2.7.tar.xz] from source. Apparently someone's been using strerror in gnutls, and someone else has been replacing strerror with repl_strerror to teach them a lesson - so we have to deal with the collateral damage. <source lang="bash"> sed -i.bak -e 's|strerror([^)]*)|""|g' lib/nettle/egd.c sed -i.bak -e 's|strerror([^)]*)|""|g' lib/nettle/rnd.c </source> === Usage === The [http://www.gnutls.org/manual/gnutls.html#Echo-server-with-OpenPGP-authentication server code] for OpenPGP authentication and [http://www.gnutls.org/manual/gnutls.html#Simple-client-example-with-X_002e509-certificate-support client code] for the very similar x.509 authentication are available. But the best starting place for hacking together a client/server pair authenticating using OpenPGP are the generic implementations in '''gnutls-3.2.7/src/serv.c''' and '''gnutls-3.2.7/src/cli.c'''. Those commands are bundled with gnutls and are easy to test out with <source lang="bash"> gnutls-serv \ -p 5556 \ --priority NORMAL:+CTYPE-OPENPGP \ --pgpcertfile ~/.gnupg/kubotan.asc \ --pgpkeyfile ~/.gnupg/kubotan-secret.asc & gnutls-cli \ -p 5556 \ --priority NORMAL:+CTYPE-OPENPGP \ --pgpkeyring=$HOME/.gnupg/pubring.gpg \ --insecure \ localhost </source> when you run into the inevitable [http://lists.gnutls.org/pipermail/gnutls-help/2012-August/002840.html error]. I'm in the process of adding this to the libixp library for authenticated 9P sessions. 2156d1cb6999abd7e916bc337f1201629dc8541e 120 119 2013-12-20T23:14:03Z David M. Rogers 2 /* Usage */ wikitext text/x-wiki Online services are the foundation of distributed computing, but security is often overlooked at the beginnings of these projects. Here, I'll explain a really simple way to lock down access to your precious protocols at the transport layer. There are essentially no changes required to the communication protocol. In addition, the method dovetails with the [http://www.gnupg.org/index.html GnuPG] suite for message signature and encryption. == Get Started with GnuPG == Why? GnuPG uses a chain of public-key '''certificates,''' similar to the x.509 '''certificates''' that we're all familiar with our web-browsers constantly complaining about. Each certificate has some private information (that the owner keeps) and some identifying public information that is distributed like a user-id, name and birthdate, or the like. The difference with those other numbers is that revealing the public key doesn't compromise your security, like a password social security number would. Instead, the public key is used to check that a communication could only have come from the person knowing the private key. Things get complicated when more than two people get involved. How do I know a person's public key is '''trusted''' to do something? PGP does this by having one key sign another key. If I want my webserver to recognize a set of users, I can create a server private key and use it to sign the public keys of trusted users. Then I have a chain of signatures that '''validate''' the user's public key. When the user connects, I use that public key to make sure the user knows the corresponding private key. Secure internet servers use x.509 certificates in a similar way to prove that you can trust them. Your browser has a list of '''trusted root''' certificates from places like Verisign and Thawte. When you connect to a random server using HTTPS, the server gives you a public key. Your browser then checks whether that public key has been signed by one of the '''trusted root''' certificates it knows about. Although similar to x.509 server certificates, PGP doesn't have a centrally based set of '''trusted root''' certificate authorities. In fact, anyone can sign for anyone else in the PGP scheme. This makes it much more user-centric. I can, for example, sign source code packages I produce and people who have my public key can verify that they haven't been tampered with. I could produce a hierarchy of keys to sign things like code, purchase orders, or server access. I could use these to delegate those responsibilities. At the same time, I could get those keys signed ''by'' other people (like the manager of a coding project, an accountant, or a server admin). === Install === Use a package-manager to look for a '''gnupg''' or equivalent. <source lang="bash"> apt-get install gnupg # Trisquel / Debian / Mint / Ubuntu fink install gnupg # OSX + Fink yum install gnupg # RHEL / Centos / Scientific Linux / Fedora </source> === Create a Keyring === GnuPG does almost everything through options to the '''gpg''' command. Following along with,[http://www.dewinter.com/gnupg_howto/english/GPGMiniHowto-3.html] <source lang="bash"> gpg --gen-key </source> <pre class="mw-collapsible mw-collapsed"> gpg (GnuPG) 1.4.13; Copyright (C) 2012 Free Software Foundation, Inc. This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Please select what kind of key you want: (1) RSA and RSA (default) (2) DSA and Elgamal (3) DSA (sign only) (4) RSA (sign only) Your selection? 1 RSA keys may be between 1024 and 4096 bits long. What keysize do you want? (2048) Requested keysize is 2048 bits Please specify how long the key should be valid. 0 = key does not expire <n> = key expires in n days <n>w = key expires in n weeks <n>m = key expires in n months <n>y = key expires in n years Key is valid for? (0) Key does not expire at all Is this correct? (y/N) y You need a user ID to identify your key; the software constructs the user ID from the Real Name, Comment and Email Address in this form: "Heinrich Heine (Der Dichter) <heinrichhduesseldorf.de>" Real name: David M. Rogers Email address: predictivestatmechgmail.com Comment: You selected this USER-ID: "David M. Rogers <predictivestatmechgmail.com>" Change (N)ame, (C)omment, (E)mail or (O)kay/(Q)uit? o You need a Passphrase to protect your secret key. We need to generate a lot of random bytes. It is a good idea to perform some other action (type on the keyboard, move the mouse, utilize the disks) during the prime generation; this gives the random number generator a better chance to gain enough entropy. . We need to generate a lot of random bytes. It is a good idea to perform some other action (type on the keyboard, move the mouse, utilize the disks) during the prime generation; this gives the random number generator a better chance to gain enough entropy. . gpg: ~/.gnupg/trustdb.gpg: trustdb created gpg: key 262B259C marked as ultimately trusted public and secret key created and signed. gpg: checking the trustdb gpg: 3 marginal(s) needed, 1 complete(s) needed, PGP trust model gpg: depth: 0 valid: 1 signed: 0 trust: 0-, 0q, 0n, 0m, 0f, 1u pub 2048R/262B259C 2013-12-20 Key fingerprint = D1CE 9C6A 5099 6753 8FC4 81F5 5B64 9362 262B 259C uid David M. Rogers <predictivestatmechgmail.com> sub 2048R/E494F149 2013-12-20 </pre> Next, you'll want to double-check that it worked and make sure gnupg's directory has no read or write permissions for anyone other than yourself. <source lang="bash"> gpg --list-keys ls -ld ~/.gnupg </source> For the client/server example, we'll also want to write the public key to a separate file. <source lang="bash"> gpg --export 262B259C --ascii >~/.gnupg/predictivestatmech.asc </source> Next, we'll generate a certificate belonging to my laptop. I'll choose to use this one for allowing users to connect to a new protocol I'm developing. It can't have a password according the GNUTLS manual. <source lang="bash"> gpg --gen-key </source> <pre> gpg (GnuPG) 1.4.13; Copyright (C) 2012 Free Software Foundation, Inc. This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Please select what kind of key you want: (1) RSA and RSA (default) (2) DSA and Elgamal (3) DSA (sign only) (4) RSA (sign only) Your selection? 4 RSA keys may be between 1024 and 4096 bits long. What keysize do you want? (2048) Requested keysize is 2048 bits Please specify how long the key should be valid. 0 = key does not expire <n> = key expires in n days <n>w = key expires in n weeks <n>m = key expires in n months <n>y = key expires in n years Key is valid for? (0) 3y Key expires at Mon Dec 19 15:04:37 2016 EST Is this correct? (y/N) y You need a user ID to identify your key; the software constructs the user ID from the Real Name, Comment and Email Address in this form: "Heinrich Heine (Der Dichter) <heinrichhduesseldorf.de>" Real name: kubotan Email address: davidrogersusf.edu Comment: MBPR Laptop You selected this USER-ID: "kubotan (MBPR Laptop) <davidrogersusf.edu>" Change (N)ame, (C)omment, (E)mail or (O)kay/(Q)uit? o You need a Passphrase to protect your secret key. You don't want a passphrase - this is probably a *bad* idea! I will do it anyway. You can change your passphrase at any time, using this program with the option "--edit-key". We need to generate a lot of random bytes. It is a good idea to perform some other action (type on the keyboard, move the mouse, utilize the disks) during the prime generation; this gives the random number generator a better chance to gain enough entropy. . gpg: key 03357392 marked as ultimately trusted public and secret key created and signed. gpg: checking the trustdb gpg: 3 marginal(s) needed, 1 complete(s) needed, PGP trust model gpg: depth: 0 valid: 2 signed: 0 trust: 0-, 0q, 0n, 0m, 0f, 2u gpg: next trustdb check due at 2016-12-19 pub 2048R/03357392 2013-12-20 [expires: 2016-12-19] Key fingerprint = C417 3765 AB3A 139B 72C3 F093 D35C FD07 0335 7392 uid kubotan (MBPR Laptop) <davidrogersusf.edu> Note that this key cannot be used for encryption. You may want to use the command "--edit-key" to generate a subkey for this purpose. </pre> Following the suggestion, I'll sign this one with my user key. <source lang="bash"> gpg --edit-key kubotan </source> <pre> gpg (GnuPG) 1.4.13; Copyright (C) 2012 Free Software Foundation, Inc. This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Secret key is available. pub 2048R/03357392 created: 2013-12-20 expires: 2016-12-19 usage: SC trust: ultimate validity: ultimate [ultimate] (1). kubotan (MBPR Laptop) <davidrogersusf.edu> gpg> sign pub 2048R/03357392 created: 2013-12-20 expires: 2016-12-19 usage: SC trust: ultimate validity: ultimate Primary key fingerprint: C417 3765 AB3A 139B 72C3 F093 D35C FD07 0335 7392 kubotan (MBPR Laptop) <davidrogersusf.edu> This key is due to expire on 2016-12-19. Are you sure that you want to sign this key with your key "David M. Rogers <predictivestatmechgmail.com>" (262B259C) Really sign? (y/N) y You need a passphrase to unlock the secret key for user: "David M. Rogers <predictivestatmechgmail.com>" 2048-bit RSA key, ID 262B259C, created 2013-12-20 gpg> quit Save changes? (y/N) y </pre> My signature belongs to kubotan's key now, so GPG saves it there. <source lang="bash"> gpg --list-sigs </source> <pre> gpg: checking the trustdb gpg: 3 marginal(s) needed, 1 complete(s) needed, PGP trust model gpg: depth: 0 valid: 2 signed: 0 trust: 0-, 0q, 0n, 0m, 0f, 2u gpg: next trustdb check due at 2016-12-19 /Users/rogers/.gnupg/pubring.gpg -------------------------------- pub 2048R/262B259C 2013-12-20 uid David M. Rogers <predictivestatmechgmail.com> sig 3 262B259C 2013-12-20 David M. Rogers <predictivestatmechgmail.com> sub 2048R/E494F149 2013-12-20 sig 262B259C 2013-12-20 David M. Rogers <predictivestatmechgmail.com> pub 2048R/03357392 2013-12-20 [expires: 2016-12-19] uid kubotan (MBPR Laptop) <davidrogersusf.edu> sig 3 03357392 2013-12-20 kubotan (MBPR Laptop) <davidrogersusf.edu> sig 262B259C 2013-12-20 David M. Rogers <predictivestatmechgmail.com> </pre> I need both its public and private sections to use in the server code, so I'll extract them, and mark them self-read-only. <source lang="bash"> gpg --armor --export "kubotan" >~/.gnupg/kubotan.asc gpg --armor --export-secret-key "kubotan" >~/.gnupg/kubotan-secret.asc chmod 400 ~/.gnupg/*.asc </source> These keys are all you need to sign or encrypt messages as well. To see the usage for those, check the chapters in the [http://www.dewinter.com/gnupg_howto/english/GPGMiniHowto.html GPG Mini-Howto]. == Server == Next, let's get started with some client/server code. TLS stands for transport-layer-security. Normal communications (e.g. http/telnet/ftp) merrily go about sending messages (commands, files, output, etc.) over TCP. TLS-enabled communications (e.g. HTTPS/SSH/SFTP) start a connection by figuring out how to encrypt the session. They can also check signatures to '''authenticate''' the user ''and the server''. After that, all communications are encrypted to prevent data leaking to the local packet sniffing red-team. Although incorporating a 'STARTTLS' message into your protocol has been recommended if you need to talk before authenticating, the lazy way is to just authenticate and start TLS at connection. The GNU TLS library makes this especially easy by handling certificates, doing the initial TLS handshake, and encrypting/decrypting messages passed through gnutls_record_send / gnutls_record_recv. === Installation === The GNUTLS library is under heavy development, and I found that the examples in the manual[http://www.gnutls.org/manual/gnutls.html] would not run with the package manager's version 2.2. So, I installed [http://www.lysator.liu.se/~nisse/archive/nettle-2.7.1.tar.gz nettle 2.7.1] (''--enable-shared'') and gnutls 3.2.7[ftp://ftp.gnutls.org/gcrypt/gnutls/v3.2/gnutls-3.2.7.tar.xz] from source. Apparently someone's been using strerror in gnutls, and someone else has been replacing strerror with repl_strerror to teach them a lesson - so we have to deal with the collateral damage. <source lang="bash"> sed -i.bak -e 's|strerror([^)]*)|""|g' lib/nettle/egd.c sed -i.bak -e 's|strerror([^)]*)|""|g' lib/nettle/rnd.c </source> === Usage === The [http://www.gnutls.org/manual/gnutls.html#Echo-server-with-OpenPGP-authentication server code] for OpenPGP authentication and [http://www.gnutls.org/manual/gnutls.html#Simple-client-example-with-X_002e509-certificate-support client code] for the very similar x.509 authentication are available. But the best starting place for hacking together a client/server pair authenticating using OpenPGP are the generic implementations in '''gnutls-3.2.7/src/serv.c''' and '''gnutls-3.2.7/src/cli.c'''. Those commands are bundled with gnutls and are easy to test out with <source lang="bash"> gnutls-serv \ -p 5556 \ --priority NORMAL:+CTYPE-OPENPGP \ --pgpkeyring=$HOME/.gnupg/pubring.gpg \ --pgpcertfile $HOME/.gnupg/kubotan.asc \ --pgpkeyfile $HOME/.gnupg/kubotan-secret.asc & gnutls-cli \ -p 5556 \ --priority NORMAL:+CTYPE-OPENPGP \ --pgpkeyring=$HOME/.gnupg/pubring.gpg \ --no-ca-verification \ localhost # two options to client causing segfault... # --pgpcertfile $HOME/.gnupg/kubotan.asc \ # --pgpkeyfile $HOME/.gnupg/kubotan-secret.asc \ </source> when you run into the inevitable [http://lists.gnutls.org/pipermail/gnutls-help/2012-August/002840.html error]. I'm in the process of adding this to the libixp library for authenticated 9P sessions. 5db30488d5e1c393df721c4c5a5c0b681dd28107 148 120 2014-06-04T19:23:35Z David M. Rogers 2 /* Usage */ wikitext text/x-wiki Online services are the foundation of distributed computing, but security is often overlooked at the beginnings of these projects. Here, I'll explain a really simple way to lock down access to your precious protocols at the transport layer. There are essentially no changes required to the communication protocol. In addition, the method dovetails with the [http://www.gnupg.org/index.html GnuPG] suite for message signature and encryption. == Get Started with GnuPG == Why? GnuPG uses a chain of public-key '''certificates,''' similar to the x.509 '''certificates''' that we're all familiar with our web-browsers constantly complaining about. Each certificate has some private information (that the owner keeps) and some identifying public information that is distributed like a user-id, name and birthdate, or the like. The difference with those other numbers is that revealing the public key doesn't compromise your security, like a password social security number would. Instead, the public key is used to check that a communication could only have come from the person knowing the private key. Things get complicated when more than two people get involved. How do I know a person's public key is '''trusted''' to do something? PGP does this by having one key sign another key. If I want my webserver to recognize a set of users, I can create a server private key and use it to sign the public keys of trusted users. Then I have a chain of signatures that '''validate''' the user's public key. When the user connects, I use that public key to make sure the user knows the corresponding private key. Secure internet servers use x.509 certificates in a similar way to prove that you can trust them. Your browser has a list of '''trusted root''' certificates from places like Verisign and Thawte. When you connect to a random server using HTTPS, the server gives you a public key. Your browser then checks whether that public key has been signed by one of the '''trusted root''' certificates it knows about. Although similar to x.509 server certificates, PGP doesn't have a centrally based set of '''trusted root''' certificate authorities. In fact, anyone can sign for anyone else in the PGP scheme. This makes it much more user-centric. I can, for example, sign source code packages I produce and people who have my public key can verify that they haven't been tampered with. I could produce a hierarchy of keys to sign things like code, purchase orders, or server access. I could use these to delegate those responsibilities. At the same time, I could get those keys signed ''by'' other people (like the manager of a coding project, an accountant, or a server admin). === Install === Use a package-manager to look for a '''gnupg''' or equivalent. <source lang="bash"> apt-get install gnupg # Trisquel / Debian / Mint / Ubuntu fink install gnupg # OSX + Fink yum install gnupg # RHEL / Centos / Scientific Linux / Fedora </source> === Create a Keyring === GnuPG does almost everything through options to the '''gpg''' command. Following along with,[http://www.dewinter.com/gnupg_howto/english/GPGMiniHowto-3.html] <source lang="bash"> gpg --gen-key </source> <pre class="mw-collapsible mw-collapsed"> gpg (GnuPG) 1.4.13; Copyright (C) 2012 Free Software Foundation, Inc. This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Please select what kind of key you want: (1) RSA and RSA (default) (2) DSA and Elgamal (3) DSA (sign only) (4) RSA (sign only) Your selection? 1 RSA keys may be between 1024 and 4096 bits long. What keysize do you want? (2048) Requested keysize is 2048 bits Please specify how long the key should be valid. 0 = key does not expire <n> = key expires in n days <n>w = key expires in n weeks <n>m = key expires in n months <n>y = key expires in n years Key is valid for? (0) Key does not expire at all Is this correct? (y/N) y You need a user ID to identify your key; the software constructs the user ID from the Real Name, Comment and Email Address in this form: "Heinrich Heine (Der Dichter) <heinrichhduesseldorf.de>" Real name: David M. Rogers Email address: predictivestatmechgmail.com Comment: You selected this USER-ID: "David M. Rogers <predictivestatmechgmail.com>" Change (N)ame, (C)omment, (E)mail or (O)kay/(Q)uit? o You need a Passphrase to protect your secret key. We need to generate a lot of random bytes. It is a good idea to perform some other action (type on the keyboard, move the mouse, utilize the disks) during the prime generation; this gives the random number generator a better chance to gain enough entropy. . We need to generate a lot of random bytes. It is a good idea to perform some other action (type on the keyboard, move the mouse, utilize the disks) during the prime generation; this gives the random number generator a better chance to gain enough entropy. . gpg: ~/.gnupg/trustdb.gpg: trustdb created gpg: key 262B259C marked as ultimately trusted public and secret key created and signed. gpg: checking the trustdb gpg: 3 marginal(s) needed, 1 complete(s) needed, PGP trust model gpg: depth: 0 valid: 1 signed: 0 trust: 0-, 0q, 0n, 0m, 0f, 1u pub 2048R/262B259C 2013-12-20 Key fingerprint = D1CE 9C6A 5099 6753 8FC4 81F5 5B64 9362 262B 259C uid David M. Rogers <predictivestatmechgmail.com> sub 2048R/E494F149 2013-12-20 </pre> Next, you'll want to double-check that it worked and make sure gnupg's directory has no read or write permissions for anyone other than yourself. <source lang="bash"> gpg --list-keys ls -ld ~/.gnupg </source> For the client/server example, we'll also want to write the public key to a separate file. <source lang="bash"> gpg --export 262B259C --ascii >~/.gnupg/predictivestatmech.asc </source> Next, we'll generate a certificate belonging to my laptop. I'll choose to use this one for allowing users to connect to a new protocol I'm developing. It can't have a password according the GNUTLS manual. <source lang="bash"> gpg --gen-key </source> <pre> gpg (GnuPG) 1.4.13; Copyright (C) 2012 Free Software Foundation, Inc. This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Please select what kind of key you want: (1) RSA and RSA (default) (2) DSA and Elgamal (3) DSA (sign only) (4) RSA (sign only) Your selection? 4 RSA keys may be between 1024 and 4096 bits long. What keysize do you want? (2048) Requested keysize is 2048 bits Please specify how long the key should be valid. 0 = key does not expire <n> = key expires in n days <n>w = key expires in n weeks <n>m = key expires in n months <n>y = key expires in n years Key is valid for? (0) 3y Key expires at Mon Dec 19 15:04:37 2016 EST Is this correct? (y/N) y You need a user ID to identify your key; the software constructs the user ID from the Real Name, Comment and Email Address in this form: "Heinrich Heine (Der Dichter) <heinrichhduesseldorf.de>" Real name: kubotan Email address: davidrogersusf.edu Comment: MBPR Laptop You selected this USER-ID: "kubotan (MBPR Laptop) <davidrogersusf.edu>" Change (N)ame, (C)omment, (E)mail or (O)kay/(Q)uit? o You need a Passphrase to protect your secret key. You don't want a passphrase - this is probably a *bad* idea! I will do it anyway. You can change your passphrase at any time, using this program with the option "--edit-key". We need to generate a lot of random bytes. It is a good idea to perform some other action (type on the keyboard, move the mouse, utilize the disks) during the prime generation; this gives the random number generator a better chance to gain enough entropy. . gpg: key 03357392 marked as ultimately trusted public and secret key created and signed. gpg: checking the trustdb gpg: 3 marginal(s) needed, 1 complete(s) needed, PGP trust model gpg: depth: 0 valid: 2 signed: 0 trust: 0-, 0q, 0n, 0m, 0f, 2u gpg: next trustdb check due at 2016-12-19 pub 2048R/03357392 2013-12-20 [expires: 2016-12-19] Key fingerprint = C417 3765 AB3A 139B 72C3 F093 D35C FD07 0335 7392 uid kubotan (MBPR Laptop) <davidrogersusf.edu> Note that this key cannot be used for encryption. You may want to use the command "--edit-key" to generate a subkey for this purpose. </pre> Following the suggestion, I'll sign this one with my user key. <source lang="bash"> gpg --edit-key kubotan </source> <pre> gpg (GnuPG) 1.4.13; Copyright (C) 2012 Free Software Foundation, Inc. This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Secret key is available. pub 2048R/03357392 created: 2013-12-20 expires: 2016-12-19 usage: SC trust: ultimate validity: ultimate [ultimate] (1). kubotan (MBPR Laptop) <davidrogersusf.edu> gpg> sign pub 2048R/03357392 created: 2013-12-20 expires: 2016-12-19 usage: SC trust: ultimate validity: ultimate Primary key fingerprint: C417 3765 AB3A 139B 72C3 F093 D35C FD07 0335 7392 kubotan (MBPR Laptop) <davidrogersusf.edu> This key is due to expire on 2016-12-19. Are you sure that you want to sign this key with your key "David M. Rogers <predictivestatmechgmail.com>" (262B259C) Really sign? (y/N) y You need a passphrase to unlock the secret key for user: "David M. Rogers <predictivestatmechgmail.com>" 2048-bit RSA key, ID 262B259C, created 2013-12-20 gpg> quit Save changes? (y/N) y </pre> My signature belongs to kubotan's key now, so GPG saves it there. <source lang="bash"> gpg --list-sigs </source> <pre> gpg: checking the trustdb gpg: 3 marginal(s) needed, 1 complete(s) needed, PGP trust model gpg: depth: 0 valid: 2 signed: 0 trust: 0-, 0q, 0n, 0m, 0f, 2u gpg: next trustdb check due at 2016-12-19 /Users/rogers/.gnupg/pubring.gpg -------------------------------- pub 2048R/262B259C 2013-12-20 uid David M. Rogers <predictivestatmechgmail.com> sig 3 262B259C 2013-12-20 David M. Rogers <predictivestatmechgmail.com> sub 2048R/E494F149 2013-12-20 sig 262B259C 2013-12-20 David M. Rogers <predictivestatmechgmail.com> pub 2048R/03357392 2013-12-20 [expires: 2016-12-19] uid kubotan (MBPR Laptop) <davidrogersusf.edu> sig 3 03357392 2013-12-20 kubotan (MBPR Laptop) <davidrogersusf.edu> sig 262B259C 2013-12-20 David M. Rogers <predictivestatmechgmail.com> </pre> I need both its public and private sections to use in the server code, so I'll extract them, and mark them self-read-only. <source lang="bash"> gpg --armor --export "kubotan" >~/.gnupg/kubotan.asc gpg --armor --export-secret-key "kubotan" >~/.gnupg/kubotan-secret.asc chmod 400 ~/.gnupg/*.asc </source> These keys are all you need to sign or encrypt messages as well. To see the usage for those, check the chapters in the [http://www.dewinter.com/gnupg_howto/english/GPGMiniHowto.html GPG Mini-Howto]. == Server == Next, let's get started with some client/server code. TLS stands for transport-layer-security. Normal communications (e.g. http/telnet/ftp) merrily go about sending messages (commands, files, output, etc.) over TCP. TLS-enabled communications (e.g. HTTPS/SSH/SFTP) start a connection by figuring out how to encrypt the session. They can also check signatures to '''authenticate''' the user ''and the server''. After that, all communications are encrypted to prevent data leaking to the local packet sniffing red-team. Although incorporating a 'STARTTLS' message into your protocol has been recommended if you need to talk before authenticating, the lazy way is to just authenticate and start TLS at connection. The GNU TLS library makes this especially easy by handling certificates, doing the initial TLS handshake, and encrypting/decrypting messages passed through gnutls_record_send / gnutls_record_recv. === Installation === The GNUTLS library is under heavy development, and I found that the examples in the manual[http://www.gnutls.org/manual/gnutls.html] would not run with the package manager's version 2.2. So, I installed [http://www.lysator.liu.se/~nisse/archive/nettle-2.7.1.tar.gz nettle 2.7.1] (''--enable-shared'') and gnutls 3.2.7[ftp://ftp.gnutls.org/gcrypt/gnutls/v3.2/gnutls-3.2.7.tar.xz] from source. Apparently someone's been using strerror in gnutls, and someone else has been replacing strerror with repl_strerror to teach them a lesson - so we have to deal with the collateral damage. <source lang="bash"> sed -i.bak -e 's|strerror([^)]*)|""|g' lib/nettle/egd.c sed -i.bak -e 's|strerror([^)]*)|""|g' lib/nettle/rnd.c </source> === Usage === The [http://www.gnutls.org/manual/gnutls.html#Echo-server-with-OpenPGP-authentication server code] for OpenPGP authentication and [http://www.gnutls.org/manual/gnutls.html#Simple-client-example-with-X_002e509-certificate-support client code] for the very similar x.509 authentication are available. But the best starting place for hacking together a client/server pair authenticating using OpenPGP are the generic implementations in '''gnutls-3.2.7/src/serv.c''' and '''gnutls-3.2.7/src/cli.c'''. Those commands are bundled with gnutls and are easy to test out with <source lang="bash"> gnutls-serv \ -p 5556 \ --priority NORMAL:+CTYPE-OPENPGP \ --pgpkeyring=$HOME/.gnupg/pubring.gpg \ --pgpcertfile $HOME/.gnupg/kubotan.asc \ --pgpkeyfile $HOME/.gnupg/kubotan-secret.asc & gnutls-cli \ -p 5556 \ --priority NORMAL:+CTYPE-OPENPGP \ --pgpkeyring=$HOME/.gnupg/pubring.gpg \ --no-ca-verification \ localhost You will get a segfault if you read an ascii key (.asc) in binary mode or vice-versa. </source> Some uses of gnutls require a lot of work. For example, the keyring is basically a list of keys. If I want to check whether a given public key exists in the list, I have to go through the following torture: <source lang="C"> /* Test code for OpenPGP Certificates and keyrings. */ #ifdef HAVE_CONFIG_H #include <config.h> #endif #include <stdio.h> #include <stdlib.h> #include <string.h> #include <gnutls/gnutls.h> #include <gnutls/openpgp.h> gnutls_openpgp_keyring_t keyring; gnutls_openpgp_crt_t auth_crt; gnutls_openpgp_keyring_t load_keyring_file(char *ringfile); gnutls_openpgp_crt_t load_crt_file(char *name); /*int cert_verify_callback(gnutls_session_t session); int tcp_connect(const char *srv, int port); void tcp_close(int sd);*/ char *get_peer_name(gnutls_openpgp_crt_t crt, int idx); // NOT thread safe!! static const char *bin2hex(const void *bin, size_t bin_size) { static char printable[110]; const unsigned char *_bin = bin; char *print; size_t i; if (bin_size > 50) bin_size = 50; print = printable; for (i = 0; i < bin_size; i++) { sprintf(print, "%.2x ", _bin[i]); print += 2; } return printable; } int main(int argc, char **argv) { int status, ret, loadkey = 0; gnutls_openpgp_keyring_t kring; gnutls_openpgp_crt_t crt; char id[GNUTLS_OPENPGP_KEYID_SIZE]; if(argc < 3) { fprintf(stderr, "Usage: %s <keyring.gpg> <pubkey.asc>\n", argv[0]); return 1; } if(!strcmp(argv[1], "-k")) { loadkey = 1; argv += 1; argc--; if(argc < 3) { fprintf(stderr, "Usage: %s <keyring.gpg> <pubkey.asc>\n", argv[0]); return 1; } } /* Load data */ gnutls_global_init(); if( (kring = load_keyring_file(argv[1])) == NULL) { fprintf(stderr, "Unable to load keyring from %s.\n", argv[1]); return 1; } /*if(loadkey && gnutls_openpgp_keyring_init(&kring)) { perror("gnutls_openpgp_keyring_init"); return 1; }*/ if( (crt = load_crt_file(argv[2])) == NULL) { fprintf(stderr, "Unable to load crt from %s.\n", argv[2]); return 1; } /* Run */ if( gnutls_openpgp_crt_get_key_id(crt, id) < 0) { fprintf(stderr, "get_key_id()\n"); return -2; } printf("keyID: %s\n", bin2hex(id, 8)); if( (ret = gnutls_openpgp_keyring_check_id(kring, id, 0)) < 0) { printf("Key not found in keyring.\n"); } else { printf("Key found!\n"); } ret = gnutls_openpgp_crt_verify_ring(crt, kring, 0, &status); printf("crt_verify_ring(%d) -> gnutls_certificate_status_t 0%3o\n", ret, status); gnutls_openpgp_crt_deinit(crt); gnutls_openpgp_keyring_deinit(kring); gnutls_global_deinit(); return 0; } </source> This is only half the battle for message verification. Once I've established the key is in the keyring (hence proving I have trusted them enough to put them in the list), I still have to check that the digital signature on the message was produced by the private key corresponding to the public one I just checked. ff3f18fd3ce39cc05859aee3f212a6c72a18ef35 149 148 2014-06-04T19:25:23Z David M. Rogers 2 /* Usage */ wikitext text/x-wiki Online services are the foundation of distributed computing, but security is often overlooked at the beginnings of these projects. Here, I'll explain a really simple way to lock down access to your precious protocols at the transport layer. There are essentially no changes required to the communication protocol. In addition, the method dovetails with the [http://www.gnupg.org/index.html GnuPG] suite for message signature and encryption. == Get Started with GnuPG == Why? GnuPG uses a chain of public-key '''certificates,''' similar to the x.509 '''certificates''' that we're all familiar with our web-browsers constantly complaining about. Each certificate has some private information (that the owner keeps) and some identifying public information that is distributed like a user-id, name and birthdate, or the like. The difference with those other numbers is that revealing the public key doesn't compromise your security, like a password social security number would. Instead, the public key is used to check that a communication could only have come from the person knowing the private key. Things get complicated when more than two people get involved. How do I know a person's public key is '''trusted''' to do something? PGP does this by having one key sign another key. If I want my webserver to recognize a set of users, I can create a server private key and use it to sign the public keys of trusted users. Then I have a chain of signatures that '''validate''' the user's public key. When the user connects, I use that public key to make sure the user knows the corresponding private key. Secure internet servers use x.509 certificates in a similar way to prove that you can trust them. Your browser has a list of '''trusted root''' certificates from places like Verisign and Thawte. When you connect to a random server using HTTPS, the server gives you a public key. Your browser then checks whether that public key has been signed by one of the '''trusted root''' certificates it knows about. Although similar to x.509 server certificates, PGP doesn't have a centrally based set of '''trusted root''' certificate authorities. In fact, anyone can sign for anyone else in the PGP scheme. This makes it much more user-centric. I can, for example, sign source code packages I produce and people who have my public key can verify that they haven't been tampered with. I could produce a hierarchy of keys to sign things like code, purchase orders, or server access. I could use these to delegate those responsibilities. At the same time, I could get those keys signed ''by'' other people (like the manager of a coding project, an accountant, or a server admin). === Install === Use a package-manager to look for a '''gnupg''' or equivalent. <source lang="bash"> apt-get install gnupg # Trisquel / Debian / Mint / Ubuntu fink install gnupg # OSX + Fink yum install gnupg # RHEL / Centos / Scientific Linux / Fedora </source> === Create a Keyring === GnuPG does almost everything through options to the '''gpg''' command. Following along with,[http://www.dewinter.com/gnupg_howto/english/GPGMiniHowto-3.html] <source lang="bash"> gpg --gen-key </source> <pre class="mw-collapsible mw-collapsed"> gpg (GnuPG) 1.4.13; Copyright (C) 2012 Free Software Foundation, Inc. This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Please select what kind of key you want: (1) RSA and RSA (default) (2) DSA and Elgamal (3) DSA (sign only) (4) RSA (sign only) Your selection? 1 RSA keys may be between 1024 and 4096 bits long. What keysize do you want? (2048) Requested keysize is 2048 bits Please specify how long the key should be valid. 0 = key does not expire <n> = key expires in n days <n>w = key expires in n weeks <n>m = key expires in n months <n>y = key expires in n years Key is valid for? (0) Key does not expire at all Is this correct? (y/N) y You need a user ID to identify your key; the software constructs the user ID from the Real Name, Comment and Email Address in this form: "Heinrich Heine (Der Dichter) <heinrichhduesseldorf.de>" Real name: David M. Rogers Email address: predictivestatmechgmail.com Comment: You selected this USER-ID: "David M. Rogers <predictivestatmechgmail.com>" Change (N)ame, (C)omment, (E)mail or (O)kay/(Q)uit? o You need a Passphrase to protect your secret key. We need to generate a lot of random bytes. It is a good idea to perform some other action (type on the keyboard, move the mouse, utilize the disks) during the prime generation; this gives the random number generator a better chance to gain enough entropy. . We need to generate a lot of random bytes. It is a good idea to perform some other action (type on the keyboard, move the mouse, utilize the disks) during the prime generation; this gives the random number generator a better chance to gain enough entropy. . gpg: ~/.gnupg/trustdb.gpg: trustdb created gpg: key 262B259C marked as ultimately trusted public and secret key created and signed. gpg: checking the trustdb gpg: 3 marginal(s) needed, 1 complete(s) needed, PGP trust model gpg: depth: 0 valid: 1 signed: 0 trust: 0-, 0q, 0n, 0m, 0f, 1u pub 2048R/262B259C 2013-12-20 Key fingerprint = D1CE 9C6A 5099 6753 8FC4 81F5 5B64 9362 262B 259C uid David M. Rogers <predictivestatmechgmail.com> sub 2048R/E494F149 2013-12-20 </pre> Next, you'll want to double-check that it worked and make sure gnupg's directory has no read or write permissions for anyone other than yourself. <source lang="bash"> gpg --list-keys ls -ld ~/.gnupg </source> For the client/server example, we'll also want to write the public key to a separate file. <source lang="bash"> gpg --export 262B259C --ascii >~/.gnupg/predictivestatmech.asc </source> Next, we'll generate a certificate belonging to my laptop. I'll choose to use this one for allowing users to connect to a new protocol I'm developing. It can't have a password according the GNUTLS manual. <source lang="bash"> gpg --gen-key </source> <pre> gpg (GnuPG) 1.4.13; Copyright (C) 2012 Free Software Foundation, Inc. This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Please select what kind of key you want: (1) RSA and RSA (default) (2) DSA and Elgamal (3) DSA (sign only) (4) RSA (sign only) Your selection? 4 RSA keys may be between 1024 and 4096 bits long. What keysize do you want? (2048) Requested keysize is 2048 bits Please specify how long the key should be valid. 0 = key does not expire <n> = key expires in n days <n>w = key expires in n weeks <n>m = key expires in n months <n>y = key expires in n years Key is valid for? (0) 3y Key expires at Mon Dec 19 15:04:37 2016 EST Is this correct? (y/N) y You need a user ID to identify your key; the software constructs the user ID from the Real Name, Comment and Email Address in this form: "Heinrich Heine (Der Dichter) <heinrichhduesseldorf.de>" Real name: kubotan Email address: davidrogersusf.edu Comment: MBPR Laptop You selected this USER-ID: "kubotan (MBPR Laptop) <davidrogersusf.edu>" Change (N)ame, (C)omment, (E)mail or (O)kay/(Q)uit? o You need a Passphrase to protect your secret key. You don't want a passphrase - this is probably a *bad* idea! I will do it anyway. You can change your passphrase at any time, using this program with the option "--edit-key". We need to generate a lot of random bytes. It is a good idea to perform some other action (type on the keyboard, move the mouse, utilize the disks) during the prime generation; this gives the random number generator a better chance to gain enough entropy. . gpg: key 03357392 marked as ultimately trusted public and secret key created and signed. gpg: checking the trustdb gpg: 3 marginal(s) needed, 1 complete(s) needed, PGP trust model gpg: depth: 0 valid: 2 signed: 0 trust: 0-, 0q, 0n, 0m, 0f, 2u gpg: next trustdb check due at 2016-12-19 pub 2048R/03357392 2013-12-20 [expires: 2016-12-19] Key fingerprint = C417 3765 AB3A 139B 72C3 F093 D35C FD07 0335 7392 uid kubotan (MBPR Laptop) <davidrogersusf.edu> Note that this key cannot be used for encryption. You may want to use the command "--edit-key" to generate a subkey for this purpose. </pre> Following the suggestion, I'll sign this one with my user key. <source lang="bash"> gpg --edit-key kubotan </source> <pre> gpg (GnuPG) 1.4.13; Copyright (C) 2012 Free Software Foundation, Inc. This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Secret key is available. pub 2048R/03357392 created: 2013-12-20 expires: 2016-12-19 usage: SC trust: ultimate validity: ultimate [ultimate] (1). kubotan (MBPR Laptop) <davidrogersusf.edu> gpg> sign pub 2048R/03357392 created: 2013-12-20 expires: 2016-12-19 usage: SC trust: ultimate validity: ultimate Primary key fingerprint: C417 3765 AB3A 139B 72C3 F093 D35C FD07 0335 7392 kubotan (MBPR Laptop) <davidrogersusf.edu> This key is due to expire on 2016-12-19. Are you sure that you want to sign this key with your key "David M. Rogers <predictivestatmechgmail.com>" (262B259C) Really sign? (y/N) y You need a passphrase to unlock the secret key for user: "David M. Rogers <predictivestatmechgmail.com>" 2048-bit RSA key, ID 262B259C, created 2013-12-20 gpg> quit Save changes? (y/N) y </pre> My signature belongs to kubotan's key now, so GPG saves it there. <source lang="bash"> gpg --list-sigs </source> <pre> gpg: checking the trustdb gpg: 3 marginal(s) needed, 1 complete(s) needed, PGP trust model gpg: depth: 0 valid: 2 signed: 0 trust: 0-, 0q, 0n, 0m, 0f, 2u gpg: next trustdb check due at 2016-12-19 /Users/rogers/.gnupg/pubring.gpg -------------------------------- pub 2048R/262B259C 2013-12-20 uid David M. Rogers <predictivestatmechgmail.com> sig 3 262B259C 2013-12-20 David M. Rogers <predictivestatmechgmail.com> sub 2048R/E494F149 2013-12-20 sig 262B259C 2013-12-20 David M. Rogers <predictivestatmechgmail.com> pub 2048R/03357392 2013-12-20 [expires: 2016-12-19] uid kubotan (MBPR Laptop) <davidrogersusf.edu> sig 3 03357392 2013-12-20 kubotan (MBPR Laptop) <davidrogersusf.edu> sig 262B259C 2013-12-20 David M. Rogers <predictivestatmechgmail.com> </pre> I need both its public and private sections to use in the server code, so I'll extract them, and mark them self-read-only. <source lang="bash"> gpg --armor --export "kubotan" >~/.gnupg/kubotan.asc gpg --armor --export-secret-key "kubotan" >~/.gnupg/kubotan-secret.asc chmod 400 ~/.gnupg/*.asc </source> These keys are all you need to sign or encrypt messages as well. To see the usage for those, check the chapters in the [http://www.dewinter.com/gnupg_howto/english/GPGMiniHowto.html GPG Mini-Howto]. == Server == Next, let's get started with some client/server code. TLS stands for transport-layer-security. Normal communications (e.g. http/telnet/ftp) merrily go about sending messages (commands, files, output, etc.) over TCP. TLS-enabled communications (e.g. HTTPS/SSH/SFTP) start a connection by figuring out how to encrypt the session. They can also check signatures to '''authenticate''' the user ''and the server''. After that, all communications are encrypted to prevent data leaking to the local packet sniffing red-team. Although incorporating a 'STARTTLS' message into your protocol has been recommended if you need to talk before authenticating, the lazy way is to just authenticate and start TLS at connection. The GNU TLS library makes this especially easy by handling certificates, doing the initial TLS handshake, and encrypting/decrypting messages passed through gnutls_record_send / gnutls_record_recv. === Installation === The GNUTLS library is under heavy development, and I found that the examples in the manual[http://www.gnutls.org/manual/gnutls.html] would not run with the package manager's version 2.2. So, I installed [http://www.lysator.liu.se/~nisse/archive/nettle-2.7.1.tar.gz nettle 2.7.1] (''--enable-shared'') and gnutls 3.2.7[ftp://ftp.gnutls.org/gcrypt/gnutls/v3.2/gnutls-3.2.7.tar.xz] from source. Apparently someone's been using strerror in gnutls, and someone else has been replacing strerror with repl_strerror to teach them a lesson - so we have to deal with the collateral damage. <source lang="bash"> sed -i.bak -e 's|strerror([^)]*)|""|g' lib/nettle/egd.c sed -i.bak -e 's|strerror([^)]*)|""|g' lib/nettle/rnd.c </source> === Usage === The [http://www.gnutls.org/manual/gnutls.html#Echo-server-with-OpenPGP-authentication server code] for OpenPGP authentication and [http://www.gnutls.org/manual/gnutls.html#Simple-client-example-with-X_002e509-certificate-support client code] for the very similar x.509 authentication are available. But the best starting place for hacking together a client/server pair authenticating using OpenPGP are the generic implementations in '''gnutls-3.2.7/src/serv.c''' and '''gnutls-3.2.7/src/cli.c'''. Those commands are bundled with gnutls and are easy to test out with <source lang="bash"> gnutls-serv \ -p 5556 \ --priority NORMAL:+CTYPE-OPENPGP \ --pgpkeyring=$HOME/.gnupg/pubring.gpg \ --pgpcertfile $HOME/.gnupg/kubotan.asc \ --pgpkeyfile $HOME/.gnupg/kubotan-secret.asc & gnutls-cli \ -p 5556 \ --priority NORMAL:+CTYPE-OPENPGP \ --pgpkeyring=$HOME/.gnupg/pubring.gpg \ --no-ca-verification \ localhost </source> You will get a segfault if you read an ascii key (.asc) in binary mode or vice-versa. dc2c3babb34878b7e067466448cebd075e2a87a7 150 149 2014-06-04T19:55:24Z David M. Rogers 2 wikitext text/x-wiki Online services are the foundation of distributed computing, but security is often overlooked at the beginnings of these projects. Here, I'll explain a really simple way to lock down access to your precious protocols at the transport layer. There are essentially no changes required to the communication protocol. In addition, the method dovetails with the [http://www.gnupg.org/index.html GnuPG] suite for message signature and encryption. == Get Started with GnuPG == Why? GnuPG uses a chain of public-key '''certificates,''' similar to the x.509 '''certificates''' that we're all familiar with our web-browsers constantly complaining about. Each certificate has some private information (that the owner keeps) and some identifying public information that is distributed like a user-id, name and birthdate, or the like. The difference with those other numbers is that revealing the public key doesn't compromise your security, like a password social security number would. Instead, the public key is used to check that a communication could only have come from the person knowing the private key. Things get complicated when more than two people get involved. How do I know a person's public key is '''trusted''' to do something? PGP does this by having one key sign another key. If I want my webserver to recognize a set of users, I can create a server private key and use it to sign the public keys of trusted users. Then I have a chain of signatures that '''validate''' the user's public key. When the user connects, I use that public key to make sure the user knows the corresponding private key. Secure internet servers use x.509 certificates in a similar way to prove that you can trust them. Your browser has a list of '''trusted root''' certificates from places like Verisign and Thawte. When you connect to a random server using HTTPS, the server gives you a public key. Your browser then checks whether that public key has been signed by one of the '''trusted root''' certificates it knows about. Although similar to x.509 server certificates, PGP doesn't have a centrally based set of '''trusted root''' certificate authorities. In fact, anyone can sign for anyone else in the PGP scheme. This makes it much more user-centric. I can, for example, sign source code packages I produce and people who have my public key can verify that they haven't been tampered with. I could produce a hierarchy of keys to sign things like code, purchase orders, or server access. I could use these to delegate those responsibilities. At the same time, I could get those keys signed ''by'' other people (like the manager of a coding project, an accountant, or a server admin). === Install === Use a package-manager to look for a '''gnupg''' or equivalent. <source lang="bash"> apt-get install gnupg # Trisquel / Debian / Mint / Ubuntu fink install gnupg # OSX + Fink yum install gnupg # RHEL / Centos / Scientific Linux / Fedora </source> === Create a Keyring === GnuPG does almost everything through options to the '''gpg''' command. Following along with,[http://www.dewinter.com/gnupg_howto/english/GPGMiniHowto-3.html] <source lang="bash"> gpg --gen-key </source> <pre class="mw-collapsible mw-collapsed"> gpg (GnuPG) 1.4.13; Copyright (C) 2012 Free Software Foundation, Inc. This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Please select what kind of key you want: (1) RSA and RSA (default) (2) DSA and Elgamal (3) DSA (sign only) (4) RSA (sign only) Your selection? 1 RSA keys may be between 1024 and 4096 bits long. What keysize do you want? (2048) Requested keysize is 2048 bits Please specify how long the key should be valid. 0 = key does not expire <n> = key expires in n days <n>w = key expires in n weeks <n>m = key expires in n months <n>y = key expires in n years Key is valid for? (0) Key does not expire at all Is this correct? (y/N) y You need a user ID to identify your key; the software constructs the user ID from the Real Name, Comment and Email Address in this form: "Heinrich Heine (Der Dichter) <heinrichhduesseldorf.de>" Real name: David M. Rogers Email address: predictivestatmechgmail.com Comment: You selected this USER-ID: "David M. Rogers <predictivestatmechgmail.com>" Change (N)ame, (C)omment, (E)mail or (O)kay/(Q)uit? o You need a Passphrase to protect your secret key. We need to generate a lot of random bytes. It is a good idea to perform some other action (type on the keyboard, move the mouse, utilize the disks) during the prime generation; this gives the random number generator a better chance to gain enough entropy. . We need to generate a lot of random bytes. It is a good idea to perform some other action (type on the keyboard, move the mouse, utilize the disks) during the prime generation; this gives the random number generator a better chance to gain enough entropy. . gpg: ~/.gnupg/trustdb.gpg: trustdb created gpg: key 262B259C marked as ultimately trusted public and secret key created and signed. gpg: checking the trustdb gpg: 3 marginal(s) needed, 1 complete(s) needed, PGP trust model gpg: depth: 0 valid: 1 signed: 0 trust: 0-, 0q, 0n, 0m, 0f, 1u pub 2048R/262B259C 2013-12-20 Key fingerprint = D1CE 9C6A 5099 6753 8FC4 81F5 5B64 9362 262B 259C uid David M. Rogers <predictivestatmechgmail.com> sub 2048R/E494F149 2013-12-20 </pre> Next, you'll want to double-check that it worked and make sure gnupg's directory has no read or write permissions for anyone other than yourself. <source lang="bash"> gpg --list-keys ls -ld ~/.gnupg </source> For the client/server example, we'll also want to write the public key to a separate file. <source lang="bash"> gpg --export 262B259C --ascii >~/.gnupg/predictivestatmech.asc </source> Next, we'll generate a certificate belonging to my laptop. I'll choose to use this one for allowing users to connect to a new protocol I'm developing. It can't have a password according the GNUTLS manual. <source lang="bash"> gpg --gen-key </source> <pre> gpg (GnuPG) 1.4.13; Copyright (C) 2012 Free Software Foundation, Inc. This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Please select what kind of key you want: (1) RSA and RSA (default) (2) DSA and Elgamal (3) DSA (sign only) (4) RSA (sign only) Your selection? 4 RSA keys may be between 1024 and 4096 bits long. What keysize do you want? (2048) Requested keysize is 2048 bits Please specify how long the key should be valid. 0 = key does not expire <n> = key expires in n days <n>w = key expires in n weeks <n>m = key expires in n months <n>y = key expires in n years Key is valid for? (0) 3y Key expires at Mon Dec 19 15:04:37 2016 EST Is this correct? (y/N) y You need a user ID to identify your key; the software constructs the user ID from the Real Name, Comment and Email Address in this form: "Heinrich Heine (Der Dichter) <heinrichhduesseldorf.de>" Real name: kubotan Email address: davidrogersusf.edu Comment: MBPR Laptop You selected this USER-ID: "kubotan (MBPR Laptop) <davidrogersusf.edu>" Change (N)ame, (C)omment, (E)mail or (O)kay/(Q)uit? o You need a Passphrase to protect your secret key. You don't want a passphrase - this is probably a *bad* idea! I will do it anyway. You can change your passphrase at any time, using this program with the option "--edit-key". We need to generate a lot of random bytes. It is a good idea to perform some other action (type on the keyboard, move the mouse, utilize the disks) during the prime generation; this gives the random number generator a better chance to gain enough entropy. . gpg: key 03357392 marked as ultimately trusted public and secret key created and signed. gpg: checking the trustdb gpg: 3 marginal(s) needed, 1 complete(s) needed, PGP trust model gpg: depth: 0 valid: 2 signed: 0 trust: 0-, 0q, 0n, 0m, 0f, 2u gpg: next trustdb check due at 2016-12-19 pub 2048R/03357392 2013-12-20 [expires: 2016-12-19] Key fingerprint = C417 3765 AB3A 139B 72C3 F093 D35C FD07 0335 7392 uid kubotan (MBPR Laptop) <davidrogersusf.edu> Note that this key cannot be used for encryption. You may want to use the command "--edit-key" to generate a subkey for this purpose. </pre> Following the suggestion, I'll sign this one with my user key. <source lang="bash"> gpg --edit-key kubotan </source> <pre> gpg (GnuPG) 1.4.13; Copyright (C) 2012 Free Software Foundation, Inc. This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Secret key is available. pub 2048R/03357392 created: 2013-12-20 expires: 2016-12-19 usage: SC trust: ultimate validity: ultimate [ultimate] (1). kubotan (MBPR Laptop) <davidrogersusf.edu> gpg> sign pub 2048R/03357392 created: 2013-12-20 expires: 2016-12-19 usage: SC trust: ultimate validity: ultimate Primary key fingerprint: C417 3765 AB3A 139B 72C3 F093 D35C FD07 0335 7392 kubotan (MBPR Laptop) <davidrogersusf.edu> This key is due to expire on 2016-12-19. Are you sure that you want to sign this key with your key "David M. Rogers <predictivestatmechgmail.com>" (262B259C) Really sign? (y/N) y You need a passphrase to unlock the secret key for user: "David M. Rogers <predictivestatmechgmail.com>" 2048-bit RSA key, ID 262B259C, created 2013-12-20 gpg> quit Save changes? (y/N) y </pre> My signature belongs to kubotan's key now, so GPG saves it there. <source lang="bash"> gpg --list-sigs </source> <pre> gpg: checking the trustdb gpg: 3 marginal(s) needed, 1 complete(s) needed, PGP trust model gpg: depth: 0 valid: 2 signed: 0 trust: 0-, 0q, 0n, 0m, 0f, 2u gpg: next trustdb check due at 2016-12-19 /Users/rogers/.gnupg/pubring.gpg -------------------------------- pub 2048R/262B259C 2013-12-20 uid David M. Rogers <predictivestatmechgmail.com> sig 3 262B259C 2013-12-20 David M. Rogers <predictivestatmechgmail.com> sub 2048R/E494F149 2013-12-20 sig 262B259C 2013-12-20 David M. Rogers <predictivestatmechgmail.com> pub 2048R/03357392 2013-12-20 [expires: 2016-12-19] uid kubotan (MBPR Laptop) <davidrogersusf.edu> sig 3 03357392 2013-12-20 kubotan (MBPR Laptop) <davidrogersusf.edu> sig 262B259C 2013-12-20 David M. Rogers <predictivestatmechgmail.com> </pre> I need both its public and private sections to use in the server code, so I'll extract them, and mark them self-read-only. <source lang="bash"> gpg --armor --export "kubotan" >~/.gnupg/kubotan.asc gpg --armor --export-secret-key "kubotan" >~/.gnupg/kubotan-secret.asc chmod 400 ~/.gnupg/*.asc </source> These keys are all you need to sign or encrypt messages as well. To see the usage for those, check the chapters in the [http://www.dewinter.com/gnupg_howto/english/GPGMiniHowto.html GPG Mini-Howto]. == Server == Next, let's get started with some client/server code. TLS stands for transport-layer-security. Normal communications (e.g. http/telnet/ftp) merrily go about sending messages (commands, files, output, etc.) over TCP. TLS-enabled communications (e.g. HTTPS/SSH/SFTP) start a connection by figuring out how to encrypt the session. They can also check signatures to '''authenticate''' the user ''and the server''. After that, all communications are encrypted to prevent data leaking to the local packet sniffing red-team. Although incorporating a 'STARTTLS' message into your protocol has been recommended if you need to talk before authenticating, the lazy way is to just authenticate and start TLS at connection. The GNU TLS library makes this especially easy by handling certificates, doing the initial TLS handshake, and encrypting/decrypting messages passed through gnutls_record_send / gnutls_record_recv. === Installation === The GNUTLS library is under heavy development, and I found that the examples in the manual[http://www.gnutls.org/manual/gnutls.html] would not run with the package manager's version 2.2. So, I installed [http://www.lysator.liu.se/~nisse/archive/nettle-2.7.1.tar.gz nettle 2.7.1] (''--enable-shared'') and gnutls 3.2.7[ftp://ftp.gnutls.org/gcrypt/gnutls/v3.2/gnutls-3.2.7.tar.xz] from source. Apparently someone's been using strerror in gnutls, and someone else has been replacing strerror with repl_strerror to teach them a lesson - so we have to deal with the collateral damage. <source lang="bash"> sed -i.bak -e 's|strerror([^)]*)|""|g' lib/nettle/egd.c sed -i.bak -e 's|strerror([^)]*)|""|g' lib/nettle/rnd.c </source> === Usage === The [http://www.gnutls.org/manual/gnutls.html#Echo-server-with-OpenPGP-authentication server code] for OpenPGP authentication and [http://www.gnutls.org/manual/gnutls.html#Simple-client-example-with-X_002e509-certificate-support client code] for the very similar x.509 authentication are available. But the best starting place for hacking together a client/server pair authenticating using OpenPGP are the generic implementations in '''gnutls-3.2.7/src/serv.c''' and '''gnutls-3.2.7/src/cli.c'''. Those commands are bundled with gnutls and are easy to test out with <source lang="bash"> gnutls-serv \ -p 5556 \ --priority NORMAL:+CTYPE-OPENPGP \ --pgpkeyring=$HOME/.gnupg/pubring.gpg \ --pgpcertfile $HOME/.gnupg/kubotan.asc \ --pgpkeyfile $HOME/.gnupg/kubotan-secret.asc & gnutls-cli \ -p 5556 \ --priority NORMAL:+CTYPE-OPENPGP \ --pgpkeyring=$HOME/.gnupg/pubring.gpg \ --no-ca-verification \ localhost </source> You will get a segfault if you read an ascii key (.asc) in binary mode or vice-versa. === Server Code === I've added the following code to interface with libixp. It contains all the necessary bits to put the libraries together, including keyring initialization, session creation, and certificate validation. <source> /* Extra goodies required for using GNUTLS * Copyright (C) David M. Rogers * This file is released under the GNU LGPLv3 */ #include <stdio.h> #include <stdlib.h> #include <unistd.h> #include <sys/socket.h> #include "ixp_local.h" char *get_peer_name(gnutls_session_t); gnutls_session_t ixp_init_session(gnutls_certificate_credentials_t cred, unsigned int flags); static char *get_crt_name(gnutls_openpgp_crt_t crt, int idx); static int generate_dh_params(); int ixp_init_dh(void); static int cert_verify_callback(gnutls_session_t session); /* When the system mutexes are (not) to be used * gnutls_global_set_mutex() must be called explicitly: *** gnutls_global_set_mutex(mutex_init, mutex_deinit, *** mutex_lock, mutex_unlock); */ ssize_t mbtls_read(IxpConn *c, void *buf, size_t nbyte) { if(c->session) { return gnutls_record_recv(c->session, buf, nbyte); } return read(c->fd, buf, nbyte); } ssize_t mbtls_write(IxpConn *c, const void *buf, size_t nbyte) { if(c->session) { return gnutls_record_send(c->session, buf, nbyte); } return write(c->fd, buf, nbyte); } /* These are global */ struct tlsinfo_s libixp_tlsinfo = {NULL, NULL, NULL, NULL, 0, 0}; int ixp_set_keyring(char *ringfile) { int ret; if( (ret = gnutls_certificate_set_openpgp_keyring_file(libixp_tlsinfo.cred, ringfile, GNUTLS_OPENPGP_FMT_RAW))) { fprintf(stderr, "Error setting keyring from file '%s': %s\n", ringfile, gnutls_strerror(ret)); return 1; } libixp_tlsinfo.keyring = 1; return 0; } static int generate_dh_params() { unsigned int bits = gnutls_sec_param_to_pk_bits(GNUTLS_PK_DH, GNUTLS_SEC_PARAM_NORMAL); /* Generate Diffie-Hellman parameters - for use with DHE * kx algorithms. These should be discarded and regenerated * once a day, once a week or once a month. Depending on the * security requirements. */ if(gnutls_dh_params_init(&libixp_tlsinfo.dh_params) < 0) { perror("Error in dh parameter initialization"); return 1; } if(gnutls_dh_params_generate2(libixp_tlsinfo.dh_params, bits) < 0) { perror("Error in prime generation"); return 1; } return 0; } int ixp_init_dh() { if(generate_dh_params()) return 1; gnutls_certificate_set_dh_params(libixp_tlsinfo.cred, libixp_tlsinfo.dh_params); return 0; } /* Set the certificate and keyfile required for ixp credentials. */ int ixp_set_credentials(char *certfile, char *keyfile) { int ret; gnutls_certificate_credentials_t cred; if(!libixp_tlsinfo.global) { gnutls_global_init(); libixp_tlsinfo.global = 1; } if(gnutls_certificate_allocate_credentials(&cred)) { return 1; } if( (ret = gnutls_certificate_set_openpgp_key_file(cred, certfile, keyfile, GNUTLS_OPENPGP_FMT_BASE64)) < 0) { const char *err = gnutls_strerror(ret); fprintf(stderr, "Error decoding privkey: %s\n", err); gnutls_certificate_free_credentials(cred); return 1; } gnutls_certificate_set_verify_function(cred, cert_verify_callback); if(libixp_tlsinfo.cred) { // TODO: check that current cred is not in use / refcount gnutls_certificate_free_credentials(libixp_tlsinfo.cred); } libixp_tlsinfo.cred = cred; return 0; } /* Flags should be set to either GNUTLS_CLIENT or GNUTLS_SERVER. */ gnutls_session_t ixp_init_session(gnutls_certificate_credentials_t cred, unsigned int flags) { gnutls_session_t session; int ret; const static char priorities[] = "NORMAL:+CTYPE-OPENPGP"; const char *err; gnutls_init(&session, flags); if(gnutls_priority_set_direct(session, priorities, &err) < 0) { fprintf(stderr, "Syntax error at: %s\n", err); exit(1); } if( (ret = gnutls_credentials_set(session, GNUTLS_CRD_CERTIFICATE, cred))) { fprintf(stderr, "gnutls_credentials_set: %s\n", gnutls_strerror(ret)); return NULL; } gnutls_certificate_server_set_request(session, GNUTLS_CERT_REQUIRE); /*if (HAVE_OPT(HEARTBEAT)) gnutls_heartbeat_enable(session, GNUTLS_HB_PEER_ALLOWED_TO_SEND); */ return session; } static char *get_crt_name(gnutls_openpgp_crt_t crt, int idx) { char *name = NULL, *tmp; int ret; size_t sz = 64; if( (name = malloc(sz)) == NULL) { return NULL; } if( (ret = gnutls_openpgp_crt_get_name(crt, idx, name, &sz)) == GNUTLS_E_REQUESTED_DATA_NOT_AVAILABLE) { free(name); return NULL; } if(!ret) return name; if( (tmp = realloc(name, sz+1)) == NULL) { free(name); return NULL; } name = tmp; sz = sz+1 > 64 ? sz+1 : 64; if(gnutls_openpgp_crt_get_name(crt, idx, name, &sz) ) { free(name); return NULL; } return name; } char *get_peer_name(gnutls_session_t session) { int ret; unsigned int list_size; const gnutls_datum_t *cert_list; gnutls_openpgp_crt_t crt; char *name; // get the peer's certificate cert_list = gnutls_certificate_get_peers(session, &list_size); if (cert_list == NULL || list_size < 1) { fprintf(stderr, "Cannot obtain peer's certificate!\n"); return NULL; } gnutls_openpgp_crt_init(&crt); if( (ret = gnutls_openpgp_crt_import(crt, &cert_list[0], GNUTLS_OPENPGP_FMT_RAW) < 0)) { fprintf(stderr, "Decoding error: %s\n", gnutls_strerror(ret)); gnutls_openpgp_crt_deinit(crt); return NULL; } name = get_crt_name(crt, 0); gnutls_openpgp_crt_deinit(crt); return name; } /* This function will verify the peer's certificate, and check * if the hostname matches, as well as the activation, expiration dates. */ static int cert_verify_callback(gnutls_session_t session) { unsigned int status; int ret, type; unsigned int list_size; const gnutls_datum_t *cert_list; gnutls_openpgp_crt_t crt; gnutls_datum_t out; // verify session type type = gnutls_certificate_type_get(session); if(type != GNUTLS_CRT_OPENPGP) { fprintf(stderr, "Warning: Session is not using PGP " "- no verification done!\n"); return 0; } // get the peer's certificate cert_list = gnutls_certificate_get_peers(session, &list_size); if (cert_list == NULL || list_size < 1) { fprintf(stderr, "Cannot obtain peer's certificate!\n"); return GNUTLS_E_CERTIFICATE_ERROR; } gnutls_openpgp_crt_init(&crt); if( (ret = gnutls_openpgp_crt_import(crt, &cert_list[0], GNUTLS_OPENPGP_FMT_RAW) < 0)) { fprintf(stderr, "Decoding error: %s\n", gnutls_strerror(ret)); gnutls_openpgp_crt_deinit(crt); return GNUTLS_E_CERTIFICATE_ERROR; } if(libixp_tlsinfo.keyring) { if( (ret = gnutls_certificate_verify_peers3(session, NULL, &status)) < 0) { fprintf(stderr, "Error validating peer crt: %s\n", gnutls_strerror(ret)); goto err; } } else if( (ret = gnutls_openpgp_crt_verify_self(crt, 0, &status))) { fprintf(stderr, "Error validating peer self-sign: %s\n", gnutls_strerror(ret)); goto err; } if (status != 0) { /* Certificate is not trusted */ if( (ret = gnutls_certificate_verification_status_print(status, type, &out, 0)) < 0) { fprintf(stderr, "Error printing verification status: %s\n", gnutls_strerror(ret)); } else { printf("%s\n", out.data); gnutls_free(out.data); } goto err; } gnutls_openpgp_crt_deinit(crt); return 0; err: gnutls_openpgp_crt_deinit(crt); return GNUTLS_E_CERTIFICATE_ERROR; } void tls_hangup(IxpConn *c) { if(c->session) gnutls_bye(c->session, GNUTLS_SHUT_RDWR); else shutdown(c->fd, SHUT_RDWR); } </source> On startup, the client and server should both make calls to ixp_set_credentials(char *certfile, char *keyfile) which takes the file paths for the ascii-encoded secret key and the binary-encoded keyring. Just after accepting a socket connection, both client and server call ixp_init_session(gnutls_certificate_credentials_t cred, unsigned int flags) to create a session object. Note that the server has to have previously called '''ixp_init_dh()''' and set flags to '''GNUTLS_SERVER'''. The client just has to set flags to '''GNUTLS_CLIENT'''. Peer validation happens during '''ixp_init_session'''. The validation is performed by '''cert_verify_callback''', which our code tells gnutls about way back when '''ixp_set_credentials''' was called. We have '''cert_verify_callback''' setup to test whether the peer (client of the server or server of the client) is in the keyring. If no keyring was loaded, we just check that the peer knows how to sign their own name. Note that this is just a membership test. In this function, we only have the peer's public key. The actual cryptographic validation happened before '''cert_verify_callback''' got involved, by checking that the peer possesses the corresponding private key. There's also a nicety function char *get_peer_name(gnutls_session_t) that either client/server can call to get the name listed on the peer's (server/client) certificate. Once the gnutls session is setup, it acts like the file descriptor, so I had to replace the fd with a struct holding the session object in ixp. You can see that the read and write calls are now '''mbtls_read''' and '''mbtls_write'''. The connection is closed cleanly with '''tls_hangup'''. There it is, the client and server code in one neat step. Hopefully this makes adding transport layer security to your protocol that much easier. Please let me know if it does! 83bfecb82143813800b08196d827b9e143fb94f1 151 150 2014-06-04T19:55:41Z David M. Rogers 2 /* Server Code */ wikitext text/x-wiki Online services are the foundation of distributed computing, but security is often overlooked at the beginnings of these projects. Here, I'll explain a really simple way to lock down access to your precious protocols at the transport layer. There are essentially no changes required to the communication protocol. In addition, the method dovetails with the [http://www.gnupg.org/index.html GnuPG] suite for message signature and encryption. == Get Started with GnuPG == Why? GnuPG uses a chain of public-key '''certificates,''' similar to the x.509 '''certificates''' that we're all familiar with our web-browsers constantly complaining about. Each certificate has some private information (that the owner keeps) and some identifying public information that is distributed like a user-id, name and birthdate, or the like. The difference with those other numbers is that revealing the public key doesn't compromise your security, like a password social security number would. Instead, the public key is used to check that a communication could only have come from the person knowing the private key. Things get complicated when more than two people get involved. How do I know a person's public key is '''trusted''' to do something? PGP does this by having one key sign another key. If I want my webserver to recognize a set of users, I can create a server private key and use it to sign the public keys of trusted users. Then I have a chain of signatures that '''validate''' the user's public key. When the user connects, I use that public key to make sure the user knows the corresponding private key. Secure internet servers use x.509 certificates in a similar way to prove that you can trust them. Your browser has a list of '''trusted root''' certificates from places like Verisign and Thawte. When you connect to a random server using HTTPS, the server gives you a public key. Your browser then checks whether that public key has been signed by one of the '''trusted root''' certificates it knows about. Although similar to x.509 server certificates, PGP doesn't have a centrally based set of '''trusted root''' certificate authorities. In fact, anyone can sign for anyone else in the PGP scheme. This makes it much more user-centric. I can, for example, sign source code packages I produce and people who have my public key can verify that they haven't been tampered with. I could produce a hierarchy of keys to sign things like code, purchase orders, or server access. I could use these to delegate those responsibilities. At the same time, I could get those keys signed ''by'' other people (like the manager of a coding project, an accountant, or a server admin). === Install === Use a package-manager to look for a '''gnupg''' or equivalent. <source lang="bash"> apt-get install gnupg # Trisquel / Debian / Mint / Ubuntu fink install gnupg # OSX + Fink yum install gnupg # RHEL / Centos / Scientific Linux / Fedora </source> === Create a Keyring === GnuPG does almost everything through options to the '''gpg''' command. Following along with,[http://www.dewinter.com/gnupg_howto/english/GPGMiniHowto-3.html] <source lang="bash"> gpg --gen-key </source> <pre class="mw-collapsible mw-collapsed"> gpg (GnuPG) 1.4.13; Copyright (C) 2012 Free Software Foundation, Inc. This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Please select what kind of key you want: (1) RSA and RSA (default) (2) DSA and Elgamal (3) DSA (sign only) (4) RSA (sign only) Your selection? 1 RSA keys may be between 1024 and 4096 bits long. What keysize do you want? (2048) Requested keysize is 2048 bits Please specify how long the key should be valid. 0 = key does not expire <n> = key expires in n days <n>w = key expires in n weeks <n>m = key expires in n months <n>y = key expires in n years Key is valid for? (0) Key does not expire at all Is this correct? (y/N) y You need a user ID to identify your key; the software constructs the user ID from the Real Name, Comment and Email Address in this form: "Heinrich Heine (Der Dichter) <heinrichhduesseldorf.de>" Real name: David M. Rogers Email address: predictivestatmechgmail.com Comment: You selected this USER-ID: "David M. Rogers <predictivestatmechgmail.com>" Change (N)ame, (C)omment, (E)mail or (O)kay/(Q)uit? o You need a Passphrase to protect your secret key. We need to generate a lot of random bytes. It is a good idea to perform some other action (type on the keyboard, move the mouse, utilize the disks) during the prime generation; this gives the random number generator a better chance to gain enough entropy. . We need to generate a lot of random bytes. It is a good idea to perform some other action (type on the keyboard, move the mouse, utilize the disks) during the prime generation; this gives the random number generator a better chance to gain enough entropy. . gpg: ~/.gnupg/trustdb.gpg: trustdb created gpg: key 262B259C marked as ultimately trusted public and secret key created and signed. gpg: checking the trustdb gpg: 3 marginal(s) needed, 1 complete(s) needed, PGP trust model gpg: depth: 0 valid: 1 signed: 0 trust: 0-, 0q, 0n, 0m, 0f, 1u pub 2048R/262B259C 2013-12-20 Key fingerprint = D1CE 9C6A 5099 6753 8FC4 81F5 5B64 9362 262B 259C uid David M. Rogers <predictivestatmechgmail.com> sub 2048R/E494F149 2013-12-20 </pre> Next, you'll want to double-check that it worked and make sure gnupg's directory has no read or write permissions for anyone other than yourself. <source lang="bash"> gpg --list-keys ls -ld ~/.gnupg </source> For the client/server example, we'll also want to write the public key to a separate file. <source lang="bash"> gpg --export 262B259C --ascii >~/.gnupg/predictivestatmech.asc </source> Next, we'll generate a certificate belonging to my laptop. I'll choose to use this one for allowing users to connect to a new protocol I'm developing. It can't have a password according the GNUTLS manual. <source lang="bash"> gpg --gen-key </source> <pre> gpg (GnuPG) 1.4.13; Copyright (C) 2012 Free Software Foundation, Inc. This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Please select what kind of key you want: (1) RSA and RSA (default) (2) DSA and Elgamal (3) DSA (sign only) (4) RSA (sign only) Your selection? 4 RSA keys may be between 1024 and 4096 bits long. What keysize do you want? (2048) Requested keysize is 2048 bits Please specify how long the key should be valid. 0 = key does not expire <n> = key expires in n days <n>w = key expires in n weeks <n>m = key expires in n months <n>y = key expires in n years Key is valid for? (0) 3y Key expires at Mon Dec 19 15:04:37 2016 EST Is this correct? (y/N) y You need a user ID to identify your key; the software constructs the user ID from the Real Name, Comment and Email Address in this form: "Heinrich Heine (Der Dichter) <heinrichhduesseldorf.de>" Real name: kubotan Email address: davidrogersusf.edu Comment: MBPR Laptop You selected this USER-ID: "kubotan (MBPR Laptop) <davidrogersusf.edu>" Change (N)ame, (C)omment, (E)mail or (O)kay/(Q)uit? o You need a Passphrase to protect your secret key. You don't want a passphrase - this is probably a *bad* idea! I will do it anyway. You can change your passphrase at any time, using this program with the option "--edit-key". We need to generate a lot of random bytes. It is a good idea to perform some other action (type on the keyboard, move the mouse, utilize the disks) during the prime generation; this gives the random number generator a better chance to gain enough entropy. . gpg: key 03357392 marked as ultimately trusted public and secret key created and signed. gpg: checking the trustdb gpg: 3 marginal(s) needed, 1 complete(s) needed, PGP trust model gpg: depth: 0 valid: 2 signed: 0 trust: 0-, 0q, 0n, 0m, 0f, 2u gpg: next trustdb check due at 2016-12-19 pub 2048R/03357392 2013-12-20 [expires: 2016-12-19] Key fingerprint = C417 3765 AB3A 139B 72C3 F093 D35C FD07 0335 7392 uid kubotan (MBPR Laptop) <davidrogersusf.edu> Note that this key cannot be used for encryption. You may want to use the command "--edit-key" to generate a subkey for this purpose. </pre> Following the suggestion, I'll sign this one with my user key. <source lang="bash"> gpg --edit-key kubotan </source> <pre> gpg (GnuPG) 1.4.13; Copyright (C) 2012 Free Software Foundation, Inc. This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Secret key is available. pub 2048R/03357392 created: 2013-12-20 expires: 2016-12-19 usage: SC trust: ultimate validity: ultimate [ultimate] (1). kubotan (MBPR Laptop) <davidrogersusf.edu> gpg> sign pub 2048R/03357392 created: 2013-12-20 expires: 2016-12-19 usage: SC trust: ultimate validity: ultimate Primary key fingerprint: C417 3765 AB3A 139B 72C3 F093 D35C FD07 0335 7392 kubotan (MBPR Laptop) <davidrogersusf.edu> This key is due to expire on 2016-12-19. Are you sure that you want to sign this key with your key "David M. Rogers <predictivestatmechgmail.com>" (262B259C) Really sign? (y/N) y You need a passphrase to unlock the secret key for user: "David M. Rogers <predictivestatmechgmail.com>" 2048-bit RSA key, ID 262B259C, created 2013-12-20 gpg> quit Save changes? (y/N) y </pre> My signature belongs to kubotan's key now, so GPG saves it there. <source lang="bash"> gpg --list-sigs </source> <pre> gpg: checking the trustdb gpg: 3 marginal(s) needed, 1 complete(s) needed, PGP trust model gpg: depth: 0 valid: 2 signed: 0 trust: 0-, 0q, 0n, 0m, 0f, 2u gpg: next trustdb check due at 2016-12-19 /Users/rogers/.gnupg/pubring.gpg -------------------------------- pub 2048R/262B259C 2013-12-20 uid David M. Rogers <predictivestatmechgmail.com> sig 3 262B259C 2013-12-20 David M. Rogers <predictivestatmechgmail.com> sub 2048R/E494F149 2013-12-20 sig 262B259C 2013-12-20 David M. Rogers <predictivestatmechgmail.com> pub 2048R/03357392 2013-12-20 [expires: 2016-12-19] uid kubotan (MBPR Laptop) <davidrogersusf.edu> sig 3 03357392 2013-12-20 kubotan (MBPR Laptop) <davidrogersusf.edu> sig 262B259C 2013-12-20 David M. Rogers <predictivestatmechgmail.com> </pre> I need both its public and private sections to use in the server code, so I'll extract them, and mark them self-read-only. <source lang="bash"> gpg --armor --export "kubotan" >~/.gnupg/kubotan.asc gpg --armor --export-secret-key "kubotan" >~/.gnupg/kubotan-secret.asc chmod 400 ~/.gnupg/*.asc </source> These keys are all you need to sign or encrypt messages as well. To see the usage for those, check the chapters in the [http://www.dewinter.com/gnupg_howto/english/GPGMiniHowto.html GPG Mini-Howto]. == Server == Next, let's get started with some client/server code. TLS stands for transport-layer-security. Normal communications (e.g. http/telnet/ftp) merrily go about sending messages (commands, files, output, etc.) over TCP. TLS-enabled communications (e.g. HTTPS/SSH/SFTP) start a connection by figuring out how to encrypt the session. They can also check signatures to '''authenticate''' the user ''and the server''. After that, all communications are encrypted to prevent data leaking to the local packet sniffing red-team. Although incorporating a 'STARTTLS' message into your protocol has been recommended if you need to talk before authenticating, the lazy way is to just authenticate and start TLS at connection. The GNU TLS library makes this especially easy by handling certificates, doing the initial TLS handshake, and encrypting/decrypting messages passed through gnutls_record_send / gnutls_record_recv. === Installation === The GNUTLS library is under heavy development, and I found that the examples in the manual[http://www.gnutls.org/manual/gnutls.html] would not run with the package manager's version 2.2. So, I installed [http://www.lysator.liu.se/~nisse/archive/nettle-2.7.1.tar.gz nettle 2.7.1] (''--enable-shared'') and gnutls 3.2.7[ftp://ftp.gnutls.org/gcrypt/gnutls/v3.2/gnutls-3.2.7.tar.xz] from source. Apparently someone's been using strerror in gnutls, and someone else has been replacing strerror with repl_strerror to teach them a lesson - so we have to deal with the collateral damage. <source lang="bash"> sed -i.bak -e 's|strerror([^)]*)|""|g' lib/nettle/egd.c sed -i.bak -e 's|strerror([^)]*)|""|g' lib/nettle/rnd.c </source> === Usage === The [http://www.gnutls.org/manual/gnutls.html#Echo-server-with-OpenPGP-authentication server code] for OpenPGP authentication and [http://www.gnutls.org/manual/gnutls.html#Simple-client-example-with-X_002e509-certificate-support client code] for the very similar x.509 authentication are available. But the best starting place for hacking together a client/server pair authenticating using OpenPGP are the generic implementations in '''gnutls-3.2.7/src/serv.c''' and '''gnutls-3.2.7/src/cli.c'''. Those commands are bundled with gnutls and are easy to test out with <source lang="bash"> gnutls-serv \ -p 5556 \ --priority NORMAL:+CTYPE-OPENPGP \ --pgpkeyring=$HOME/.gnupg/pubring.gpg \ --pgpcertfile $HOME/.gnupg/kubotan.asc \ --pgpkeyfile $HOME/.gnupg/kubotan-secret.asc & gnutls-cli \ -p 5556 \ --priority NORMAL:+CTYPE-OPENPGP \ --pgpkeyring=$HOME/.gnupg/pubring.gpg \ --no-ca-verification \ localhost </source> You will get a segfault if you read an ascii key (.asc) in binary mode or vice-versa. === Server Code === I've added the following code to interface with libixp. It contains all the necessary bits to put the libraries together, including keyring initialization, session creation, and certificate validation. <source lang="C"> /* Extra goodies required for using GNUTLS * Copyright (C) David M. Rogers * This file is released under the GNU LGPLv3 */ #include <stdio.h> #include <stdlib.h> #include <unistd.h> #include <sys/socket.h> #include "ixp_local.h" char *get_peer_name(gnutls_session_t); gnutls_session_t ixp_init_session(gnutls_certificate_credentials_t cred, unsigned int flags); static char *get_crt_name(gnutls_openpgp_crt_t crt, int idx); static int generate_dh_params(); int ixp_init_dh(void); static int cert_verify_callback(gnutls_session_t session); /* When the system mutexes are (not) to be used * gnutls_global_set_mutex() must be called explicitly: *** gnutls_global_set_mutex(mutex_init, mutex_deinit, *** mutex_lock, mutex_unlock); */ ssize_t mbtls_read(IxpConn *c, void *buf, size_t nbyte) { if(c->session) { return gnutls_record_recv(c->session, buf, nbyte); } return read(c->fd, buf, nbyte); } ssize_t mbtls_write(IxpConn *c, const void *buf, size_t nbyte) { if(c->session) { return gnutls_record_send(c->session, buf, nbyte); } return write(c->fd, buf, nbyte); } /* These are global */ struct tlsinfo_s libixp_tlsinfo = {NULL, NULL, NULL, NULL, 0, 0}; int ixp_set_keyring(char *ringfile) { int ret; if( (ret = gnutls_certificate_set_openpgp_keyring_file(libixp_tlsinfo.cred, ringfile, GNUTLS_OPENPGP_FMT_RAW))) { fprintf(stderr, "Error setting keyring from file '%s': %s\n", ringfile, gnutls_strerror(ret)); return 1; } libixp_tlsinfo.keyring = 1; return 0; } static int generate_dh_params() { unsigned int bits = gnutls_sec_param_to_pk_bits(GNUTLS_PK_DH, GNUTLS_SEC_PARAM_NORMAL); /* Generate Diffie-Hellman parameters - for use with DHE * kx algorithms. These should be discarded and regenerated * once a day, once a week or once a month. Depending on the * security requirements. */ if(gnutls_dh_params_init(&libixp_tlsinfo.dh_params) < 0) { perror("Error in dh parameter initialization"); return 1; } if(gnutls_dh_params_generate2(libixp_tlsinfo.dh_params, bits) < 0) { perror("Error in prime generation"); return 1; } return 0; } int ixp_init_dh() { if(generate_dh_params()) return 1; gnutls_certificate_set_dh_params(libixp_tlsinfo.cred, libixp_tlsinfo.dh_params); return 0; } /* Set the certificate and keyfile required for ixp credentials. */ int ixp_set_credentials(char *certfile, char *keyfile) { int ret; gnutls_certificate_credentials_t cred; if(!libixp_tlsinfo.global) { gnutls_global_init(); libixp_tlsinfo.global = 1; } if(gnutls_certificate_allocate_credentials(&cred)) { return 1; } if( (ret = gnutls_certificate_set_openpgp_key_file(cred, certfile, keyfile, GNUTLS_OPENPGP_FMT_BASE64)) < 0) { const char *err = gnutls_strerror(ret); fprintf(stderr, "Error decoding privkey: %s\n", err); gnutls_certificate_free_credentials(cred); return 1; } gnutls_certificate_set_verify_function(cred, cert_verify_callback); if(libixp_tlsinfo.cred) { // TODO: check that current cred is not in use / refcount gnutls_certificate_free_credentials(libixp_tlsinfo.cred); } libixp_tlsinfo.cred = cred; return 0; } /* Flags should be set to either GNUTLS_CLIENT or GNUTLS_SERVER. */ gnutls_session_t ixp_init_session(gnutls_certificate_credentials_t cred, unsigned int flags) { gnutls_session_t session; int ret; const static char priorities[] = "NORMAL:+CTYPE-OPENPGP"; const char *err; gnutls_init(&session, flags); if(gnutls_priority_set_direct(session, priorities, &err) < 0) { fprintf(stderr, "Syntax error at: %s\n", err); exit(1); } if( (ret = gnutls_credentials_set(session, GNUTLS_CRD_CERTIFICATE, cred))) { fprintf(stderr, "gnutls_credentials_set: %s\n", gnutls_strerror(ret)); return NULL; } gnutls_certificate_server_set_request(session, GNUTLS_CERT_REQUIRE); /*if (HAVE_OPT(HEARTBEAT)) gnutls_heartbeat_enable(session, GNUTLS_HB_PEER_ALLOWED_TO_SEND); */ return session; } static char *get_crt_name(gnutls_openpgp_crt_t crt, int idx) { char *name = NULL, *tmp; int ret; size_t sz = 64; if( (name = malloc(sz)) == NULL) { return NULL; } if( (ret = gnutls_openpgp_crt_get_name(crt, idx, name, &sz)) == GNUTLS_E_REQUESTED_DATA_NOT_AVAILABLE) { free(name); return NULL; } if(!ret) return name; if( (tmp = realloc(name, sz+1)) == NULL) { free(name); return NULL; } name = tmp; sz = sz+1 > 64 ? sz+1 : 64; if(gnutls_openpgp_crt_get_name(crt, idx, name, &sz) ) { free(name); return NULL; } return name; } char *get_peer_name(gnutls_session_t session) { int ret; unsigned int list_size; const gnutls_datum_t *cert_list; gnutls_openpgp_crt_t crt; char *name; // get the peer's certificate cert_list = gnutls_certificate_get_peers(session, &list_size); if (cert_list == NULL || list_size < 1) { fprintf(stderr, "Cannot obtain peer's certificate!\n"); return NULL; } gnutls_openpgp_crt_init(&crt); if( (ret = gnutls_openpgp_crt_import(crt, &cert_list[0], GNUTLS_OPENPGP_FMT_RAW) < 0)) { fprintf(stderr, "Decoding error: %s\n", gnutls_strerror(ret)); gnutls_openpgp_crt_deinit(crt); return NULL; } name = get_crt_name(crt, 0); gnutls_openpgp_crt_deinit(crt); return name; } /* This function will verify the peer's certificate, and check * if the hostname matches, as well as the activation, expiration dates. */ static int cert_verify_callback(gnutls_session_t session) { unsigned int status; int ret, type; unsigned int list_size; const gnutls_datum_t *cert_list; gnutls_openpgp_crt_t crt; gnutls_datum_t out; // verify session type type = gnutls_certificate_type_get(session); if(type != GNUTLS_CRT_OPENPGP) { fprintf(stderr, "Warning: Session is not using PGP " "- no verification done!\n"); return 0; } // get the peer's certificate cert_list = gnutls_certificate_get_peers(session, &list_size); if (cert_list == NULL || list_size < 1) { fprintf(stderr, "Cannot obtain peer's certificate!\n"); return GNUTLS_E_CERTIFICATE_ERROR; } gnutls_openpgp_crt_init(&crt); if( (ret = gnutls_openpgp_crt_import(crt, &cert_list[0], GNUTLS_OPENPGP_FMT_RAW) < 0)) { fprintf(stderr, "Decoding error: %s\n", gnutls_strerror(ret)); gnutls_openpgp_crt_deinit(crt); return GNUTLS_E_CERTIFICATE_ERROR; } if(libixp_tlsinfo.keyring) { if( (ret = gnutls_certificate_verify_peers3(session, NULL, &status)) < 0) { fprintf(stderr, "Error validating peer crt: %s\n", gnutls_strerror(ret)); goto err; } } else if( (ret = gnutls_openpgp_crt_verify_self(crt, 0, &status))) { fprintf(stderr, "Error validating peer self-sign: %s\n", gnutls_strerror(ret)); goto err; } if (status != 0) { /* Certificate is not trusted */ if( (ret = gnutls_certificate_verification_status_print(status, type, &out, 0)) < 0) { fprintf(stderr, "Error printing verification status: %s\n", gnutls_strerror(ret)); } else { printf("%s\n", out.data); gnutls_free(out.data); } goto err; } gnutls_openpgp_crt_deinit(crt); return 0; err: gnutls_openpgp_crt_deinit(crt); return GNUTLS_E_CERTIFICATE_ERROR; } void tls_hangup(IxpConn *c) { if(c->session) gnutls_bye(c->session, GNUTLS_SHUT_RDWR); else shutdown(c->fd, SHUT_RDWR); } </source> On startup, the client and server should both make calls to ixp_set_credentials(char *certfile, char *keyfile) which takes the file paths for the ascii-encoded secret key and the binary-encoded keyring. Just after accepting a socket connection, both client and server call ixp_init_session(gnutls_certificate_credentials_t cred, unsigned int flags) to create a session object. Note that the server has to have previously called '''ixp_init_dh()''' and set flags to '''GNUTLS_SERVER'''. The client just has to set flags to '''GNUTLS_CLIENT'''. Peer validation happens during '''ixp_init_session'''. The validation is performed by '''cert_verify_callback''', which our code tells gnutls about way back when '''ixp_set_credentials''' was called. We have '''cert_verify_callback''' setup to test whether the peer (client of the server or server of the client) is in the keyring. If no keyring was loaded, we just check that the peer knows how to sign their own name. Note that this is just a membership test. In this function, we only have the peer's public key. The actual cryptographic validation happened before '''cert_verify_callback''' got involved, by checking that the peer possesses the corresponding private key. There's also a nicety function char *get_peer_name(gnutls_session_t) that either client/server can call to get the name listed on the peer's (server/client) certificate. Once the gnutls session is setup, it acts like the file descriptor, so I had to replace the fd with a struct holding the session object in ixp. You can see that the read and write calls are now '''mbtls_read''' and '''mbtls_write'''. The connection is closed cleanly with '''tls_hangup'''. There it is, the client and server code in one neat step. Hopefully this makes adding transport layer security to your protocol that much easier. Please let me know if it does! 6ae97ca72b9561822f8c0eee76b6f4590157a357 Code 0 18 121 90 2014-01-02T21:17:22Z David M. Rogers 2 wikitext text/x-wiki == C Libraries == With the exception of the standard libraries and the [http://www.gnu.org/software/gsl/ GNU Scientific Library], there are surprisingly few of these about. Here are some generics that we've implemented and are sharing under the GPL. Robust map and red/black tree code has recently been published to [https://github.com/frobnitzem?tab=repositories github]. == Python Libraries == === Geometric Algebra === The [http://www.predictivestatmech.org/code/galg.py Multivector] class implements geometric algebra using Python's operator overloading. It works with minimal space for any number of spatial dimensions, since it's not based on the matrix / spinor representation of Clifford algebra. Instead, it takes the basis blade approach recommended by Dorst, Fondijne, and Mann [http://www.geometricalgebra.net]. It's really just as easy as ordering all the basis vectors, and keeping track of the commutator (+/- <math>\hat 1</math>). == Templates == The real world have forms, computation has templates. Pick one up, fill in the blanks, and send it down the chute. * [[NWChem|NWChem Jobs]] * [[Code:SGE|SGE (USF Circe)]] == Code Humor == Put this into your makefile: <source lang=bash> Clint\ Eastwood: myday echo "I feel great!" </source> 3f245b19aac5176227524a30a8f1a86791ac5160 132 121 2014-02-07T17:17:17Z David M. Rogers 2 wikitext text/x-wiki == Tutorials == When learning a new language, once you've memorized the words, you need to start conversing. Unfortunately, source code is not spoken. It's a stillborn language. One of the best ways to code well is to study and modify other, good code. For code, this means reading and tweaking tutorials first, then design patterns, then large-scale projects next. * [http://matt.might.net/articles/bash-by-example Bash By Example] * [http://docs.python.org/3/tutorial/datastructures.html Data Structures in Python] * [http://www.u.arizona.edu/~erdmann/mse350/topics/basic_linear_algebra.html Linear Algebra in Numpy] Remember that it's not enough to just read them. It's actually a positive waste of time. Rather, you have to do some run-tweak-run-debug development cycles with them. == C Libraries == With the exception of the standard libraries and the [http://www.gnu.org/software/gsl/ GNU Scientific Library], there are surprisingly few of these about. Here are some generics that we've implemented and are sharing under the GPL. Robust map and red/black tree code has recently been published to [https://github.com/frobnitzem?tab=repositories github]. == Python Libraries == === Geometric Algebra === The [http://www.predictivestatmech.org/code/galg.py Multivector] class implements geometric algebra using Python's operator overloading. It works with minimal space for any number of spatial dimensions, since it's not based on the matrix / spinor representation of Clifford algebra. Instead, it takes the basis blade approach recommended by Dorst, Fondijne, and Mann [http://www.geometricalgebra.net]. It's really just as easy as ordering all the basis vectors, and keeping track of the commutator (+/- <math>\hat 1</math>). == Templates == The real world have forms, computation has templates. Pick one up, fill in the blanks, and send it down the chute. * [[NWChem|NWChem Jobs]] * [[Code:SGE|SGE (USF Circe)]] == Code Humor == Put this into your makefile: <source lang=bash> Clint\ Eastwood: myday echo "I feel great!" </source> 0cb2fff9d75f467eb2a441a3367049a1f236d0ab 144 132 2014-04-11T18:02:40Z David M. Rogers 2 /* Templates */ wikitext text/x-wiki == Tutorials == When learning a new language, once you've memorized the words, you need to start conversing. Unfortunately, source code is not spoken. It's a stillborn language. One of the best ways to code well is to study and modify other, good code. For code, this means reading and tweaking tutorials first, then design patterns, then large-scale projects next. * [http://matt.might.net/articles/bash-by-example Bash By Example] * [http://docs.python.org/3/tutorial/datastructures.html Data Structures in Python] * [http://www.u.arizona.edu/~erdmann/mse350/topics/basic_linear_algebra.html Linear Algebra in Numpy] Remember that it's not enough to just read them. It's actually a positive waste of time. Rather, you have to do some run-tweak-run-debug development cycles with them. == C Libraries == With the exception of the standard libraries and the [http://www.gnu.org/software/gsl/ GNU Scientific Library], there are surprisingly few of these about. Here are some generics that we've implemented and are sharing under the GPL. Robust map and red/black tree code has recently been published to [https://github.com/frobnitzem?tab=repositories github]. == Python Libraries == === Geometric Algebra === The [http://www.predictivestatmech.org/code/galg.py Multivector] class implements geometric algebra using Python's operator overloading. It works with minimal space for any number of spatial dimensions, since it's not based on the matrix / spinor representation of Clifford algebra. Instead, it takes the basis blade approach recommended by Dorst, Fondijne, and Mann [http://www.geometricalgebra.net]. It's really just as easy as ordering all the basis vectors, and keeping track of the commutator (+/- <math>\hat 1</math>). == Templates == The real world has forms, computation has templates. Pick one up, fill in the blanks, and send it down the chute. * [[NWChem|NWChem Jobs]] * [[Code:SGE|SGE (USF Circe)]] == Code Humor == Put this into your makefile: <source lang=bash> Clint\ Eastwood: myday echo "I feel great!" </source> f12b457df7aa34b5142453837c8db48bcdc07c6d 145 144 2014-04-11T18:05:12Z David M. Rogers 2 wikitext text/x-wiki == Tutorials == When learning a new language, once you've memorized the words, you need to start conversing. Unfortunately, source code is not spoken. It's a stillborn language. One of the best ways to code well is to study and modify other, good code. For code, this means reading and tweaking tutorials first, then design patterns, then large-scale projects next. * [http://matt.might.net/articles/bash-by-example Bash By Example] * [http://docs.python.org/3/tutorial/datastructures.html Data Structures in Python] * [http://www.u.arizona.edu/~erdmann/mse350/topics/basic_linear_algebra.html Linear Algebra in Numpy] Remember that it's not enough to just read them. It's actually a positive waste of time. Rather, you have to do some run-tweak-run-debug development cycles with them. == C Libraries == With the exception of the standard libraries and the [http://www.gnu.org/software/gsl/ GNU Scientific Library], there are surprisingly few of these about. Here are some generics that we've implemented and are sharing under the GPL. Robust map and red/black tree code has recently been published to [https://github.com/frobnitzem?tab=repositories github]. == Python Libraries == === Geometric Algebra === The [http://www.predictivestatmech.org/code/galg.py Multivector] class implements geometric algebra using Python's operator overloading. It works with minimal space for any number of spatial dimensions, since it's not based on the matrix / spinor representation of Clifford algebra. Instead, it takes the basis blade approach recommended by Dorst, Fondijne, and Mann [http://www.geometricalgebra.net]. It's really just as easy as ordering all the basis vectors, and keeping track of the commutator (+/- <math>\hat 1</math>). == Templates == The real world has forms, computation has templates. Pick one up, fill in the blanks, and send it down the chute. * [[NWChem|NWChem Jobs]] * [[Code:SGE|SGE (USF Circe)]] == Efficiencies == To chop a tree quickly, spend twice the time sharpening your axe. * [[Vimrc|vimrc files]] == Code Humor == Put this into your makefile: <source lang=bash> Clint\ Eastwood: myday echo "I feel great!" </source> eb4dac1522669f1848b3d2480e0119c9c20d7fd0 GradQuantumSpring2014 0 36 122 106 2014-01-02T21:45:21Z David M. Rogers 2 wikitext text/x-wiki Advanced Reference Material: [http://usf.eblib.com.ezproxy.lib.usf.edu/patron/FullRecord.aspx?p=1214609 D.R. Yarkony, ed., Modern Electronic Structure Theory, (World Scientific, Singapore, 1995).] === Planned Topics === * Scripting for Managing El. Structure Calcs * Foundations of Density Functional Theory * Shortcomings of DFT (reproducing electron number discontinuities) * Excited States, Rayleigh-Schrodinger Perturbation (compare to MP2) * Polarizablility and other Dispersion Forces * Coupled-Cluster Expansions * Perturbation Theory Decomposition of Intermolecular Energies * Quantum and Classical Fluctuation-Dissipation Theorems * Path Integral Formulations b4fe86d2c5439aa49b55fffd47196431c589c900 123 122 2014-01-02T21:48:51Z David M. Rogers 2 /* Planned Topics */ wikitext text/x-wiki Advanced Reference Material: [http://usf.eblib.com.ezproxy.lib.usf.edu/patron/FullRecord.aspx?p=1214609 D.R. Yarkony, ed., Modern Electronic Structure Theory, (World Scientific, Singapore, 1995).] === Planned Topics === * Scripting for Managing El. Structure Calcs ** Working with atomistic data * Foundations of Density Functional Theory * Shortcomings of DFT (reproducing electron number discontinuities) * Excited States, Rayleigh-Schrodinger Perturbation (compare to MP2) * Polarizablility and other Dispersion Forces * Coupled-Cluster Expansions * Perturbation Theory Decomposition of Intermolecular Energies * Solvent Effects and Approximations * Quantum and Classical Fluctuation-Dissipation Theorems * Path Integral Formulations f8e74f7b85505e7d3776526f2d634445ec48a216 124 123 2014-01-02T22:17:16Z David M. Rogers 2 wikitext text/x-wiki <BIG>Quantum Mechanics II</BIG> == Meeting Time == * Course Number: CHM 6938-009 * Meeting Times: Tuesdays and Thursdays, 12:30 - 01:45PM ** No meetings on Mar. 11 or 13 due to USF Spring Break (Mar. 10-15) * Credit Hours: 3 * CRN: 11305 == Advanced Reference Material == * Primary Literature to be Discussed in Class * Everything from [[GradQuantumFall2013]] * [http://usf.eblib.com.ezproxy.lib.usf.edu/patron/FullRecord.aspx?p=1214609 D.R. Yarkony, ed., Modern Electronic Structure Theory, (World Scientific, Singapore, 1995).] The instructor may be reached anytime by phone 4-4298 or email (username: davidrogers on usf.edu). == Course Overview & Objectives == Having mastered the foundations of Quantum Mechanics, this course explores advanced and emerging topics through critical reading of the primary literature. By the end of the course, you will be able to evaluate, propose and carry out critical tests of ideas and methods directly from the literature. == Grading & Due Dates == Your work will be graded based on homework assignments (20%), participation in class discussion (20%), and two exams (30% each). * TBD == Planned Topics == * Scripting for Managing El. Structure Calcs ** Working with atomistic data ** Running large parallel electronic structure calculations ** The role of basis functions and convergence * Thermochemistry, chemical reactions and kinetics * Basic statistics of Boson and Fermion energy distributions - (stat) statistics on top of (QM) statistics. * Foundations of Density Functional Theory ** Statistics of an electron gas. The Kohn-Sham decomposition and the resulting alphabet soup of density functionals. * Shortcomings of DFT (reproducing electron number discontinuities) * Excited States, Rayleigh-Schrodinger Perturbation (compare to MP2) * Polarizablility and other Dispersion Forces * Coupled-Cluster Expansions * Perturbation Theory Decomposition of Intermolecular Energies * Solvent Effects and Approximations ** QM/MM methods applicable to the condensed phase * Quantum and Classical Fluctuation-Dissipation Theorems * Path Integral Formulations ** Derivation of classical mechanics, Heisenberg and Schrodinger. ** Elementary path integrals * Optional material: Quaternion representation of rotations and the Dirac equation. 64bc491d739f48d0cf3dd06edd6a7ec89a8a843e 125 124 2014-01-02T22:17:37Z David M. Rogers 2 wikitext text/x-wiki <BIG>Quantum Mechanics II</BIG> == Course Info == * Course Number: CHM 6938-009 * Meeting Times: Tuesdays and Thursdays, 12:30 - 01:45PM ** No meetings on Mar. 11 or 13 due to USF Spring Break (Mar. 10-15) * Credit Hours: 3 * CRN: 11305 == Advanced Reference Material == * Primary Literature to be Discussed in Class * Everything from [[GradQuantumFall2013]] * [http://usf.eblib.com.ezproxy.lib.usf.edu/patron/FullRecord.aspx?p=1214609 D.R. Yarkony, ed., Modern Electronic Structure Theory, (World Scientific, Singapore, 1995).] The instructor may be reached anytime by phone 4-4298 or email (username: davidrogers on usf.edu). == Course Overview & Objectives == Having mastered the foundations of Quantum Mechanics, this course explores advanced and emerging topics through critical reading of the primary literature. By the end of the course, you will be able to evaluate, propose and carry out critical tests of ideas and methods directly from the literature. == Grading & Due Dates == Your work will be graded based on homework assignments (20%), participation in class discussion (20%), and two exams (30% each). * TBD == Planned Topics == * Scripting for Managing El. Structure Calcs ** Working with atomistic data ** Running large parallel electronic structure calculations ** The role of basis functions and convergence * Thermochemistry, chemical reactions and kinetics * Basic statistics of Boson and Fermion energy distributions - (stat) statistics on top of (QM) statistics. * Foundations of Density Functional Theory ** Statistics of an electron gas. The Kohn-Sham decomposition and the resulting alphabet soup of density functionals. * Shortcomings of DFT (reproducing electron number discontinuities) * Excited States, Rayleigh-Schrodinger Perturbation (compare to MP2) * Polarizablility and other Dispersion Forces * Coupled-Cluster Expansions * Perturbation Theory Decomposition of Intermolecular Energies * Solvent Effects and Approximations ** QM/MM methods applicable to the condensed phase * Quantum and Classical Fluctuation-Dissipation Theorems * Path Integral Formulations ** Derivation of classical mechanics, Heisenberg and Schrodinger. ** Elementary path integrals * Optional material: Quaternion representation of rotations and the Dirac equation. 8bc49e6e5b9c3bb8ffe87e2245ecb7e8ea23d9fa 126 125 2014-01-06T20:05:45Z David M. Rogers 2 wikitext text/x-wiki <BIG>Quantum Mechanics II</BIG> == Course Info == * Course Number: CHM 6938-009 * Meeting Times: Tuesdays and Thursdays, 12:30 - 01:45PM ** No meetings on Mar. 11 or 13 due to USF Spring Break (Mar. 10-15) * Credit Hours: 3 * CRN: 11305 == Advanced Reference Material == * Primary Literature to be Discussed in Class * Everything from [[GradQuantumFall2013]] * [http://usf.eblib.com.ezproxy.lib.usf.edu/patron/FullRecord.aspx?p=1214609 D.R. Yarkony, ed., Modern Electronic Structure Theory, (World Scientific, Singapore, 1995).] The instructor may be reached anytime by phone 4-4298 or email (username: davidrogers on usf.edu). == Course Overview & Objectives == Having mastered the foundations of Quantum Mechanics, this course explores advanced and emerging topics through critical reading of the primary literature. By the end of the course, you will be able to evaluate, propose and carry out critical tests of ideas and methods directly from the literature. == Grading & Due Dates == Your work will be graded based on homework assignments (20%), participation in class discussion (20%), and two exams (30% each). * TBD == Planned Topics == === Phase I === Topics: * Thermochemistry, chemical reactions and kinetics * Scripting for Managing El. Structure Calcs ** Working with atomistic data ** Running large parallel electronic structure calculations ** The role of basis functions and convergence * Basic statistics of Boson and Fermion energy distributions - (stat) statistics on top of (QM) statistics. References: * [http://www.lct.jussieu.fr/manuels/Gaussian03/g_whitepap/thermo/thermo.pdf Thermochemistry in Gaussian] * [https://materialsproject.org Materials Project] ** [http://prb.aps.org/abstract/PRB/v82/i7/e075122 ] * [http://icole.mut-es.ac.ir/downloads/Sci_Sec/W1/Einstein%201917.pdf On the quantum theory of radiation] === Phase II === Topics: * Excited States, Rayleigh-Schrodinger Perturbation (compare to MP2) * Polarizablility and other Dispersion Forces * Coupled-Cluster Expansions * Perturbation Theory Decomposition of Intermolecular Energies References: === Phase III === Topics: * Foundations of Density Functional Theory ** Statistics of an electron gas. The Kohn-Sham decomposition and the resulting alphabet soup of density functionals. * Shortcomings of DFT (reproducing electron number discontinuities) * Solvent Effects and Approximations ** QM/MM methods applicable to the condensed phase References: * [http://www.nobelprize.org/nobel_prizes/chemistry/laureates/1998/kohn-lecture.pdf 1998 Nobel Prize Lecture] * [http://prola.aps.org/abstract/PR/v136/i3B/pB864_1 Inhomogeneous Electron Gas] * [http://pubs.acs.org/doi/abs/10.1021/ct100738h MSCALE: A General Utility for Multiscale Modeling] === Phase IV === Topics: * Path Integral Formulations ** Derivation of classical mechanics, Heisenberg and Schrodinger. ** Elementary path integrals * Quantum and Classical Fluctuation-Dissipation Theorems * Optional material: Quaternion representation of rotations and the Dirac equation. References: c0cc3aaa9dc850129e7133f48402808008a25bd9 127 126 2014-01-06T23:41:44Z David M. Rogers 2 /* Planned Topics */ wikitext text/x-wiki <BIG>Quantum Mechanics II</BIG> == Course Info == * Course Number: CHM 6938-009 * Meeting Times: Tuesdays and Thursdays, 12:30 - 01:45PM ** No meetings on Mar. 11 or 13 due to USF Spring Break (Mar. 10-15) * Credit Hours: 3 * CRN: 11305 == Advanced Reference Material == * Primary Literature to be Discussed in Class * Everything from [[GradQuantumFall2013]] * [http://usf.eblib.com.ezproxy.lib.usf.edu/patron/FullRecord.aspx?p=1214609 D.R. Yarkony, ed., Modern Electronic Structure Theory, (World Scientific, Singapore, 1995).] The instructor may be reached anytime by phone 4-4298 or email (username: davidrogers on usf.edu). == Course Overview & Objectives == Having mastered the foundations of Quantum Mechanics, this course explores advanced and emerging topics through critical reading of the primary literature. By the end of the course, you will be able to evaluate, propose and carry out critical tests of ideas and methods directly from the literature. == Grading & Due Dates == Your work will be graded based on homework assignments (20%), participation in class discussion (20%), and two exams (30% each). * TBD == Planned Topics == === Phase I === Topics: * Thermochemistry, chemical reactions and kinetics * Scripting for Managing El. Structure Calcs ** Working with atomistic data ** Running large parallel electronic structure calculations ** The role of basis functions and convergence * Basic statistics of Boson and Fermion energy distributions - (stat) statistics on top of (QM) statistics. References: * [http://www.lct.jussieu.fr/manuels/Gaussian03/g_whitepap/thermo/thermo.pdf Thermochemistry in Gaussian] * [https://materialsproject.org Materials Project] ** [http://prb.aps.org/abstract/PRB/v82/i7/e075122 Hybrid density functional calculations of redox potentials and formation energies of transition metal compounds] * [http://icole.mut-es.ac.ir/downloads/Sci_Sec/W1/Einstein%201917.pdf On the quantum theory of radiation] ** [http://www.robeson.k12.nc.us/cms/lib6/NC01000307/Centricity/Domain/1160/_Files/AP%20Physics/Article%208/Rereading%20Einstein%20on%20Radiation.pdf Rereading Einstein on Radiation] === Phase II === Topics: * Excited States, Rayleigh-Schrodinger Perturbation (compare to MP2) * Polarizablility and other Dispersion Forces * Coupled-Cluster Expansions * Perturbation Theory Decomposition of Intermolecular Energies References: * Bes, Chapter 8.1-8.3 * A. Stone * [http://onlinelibrary.wiley.com/doi/10.1002/qua.560290520/abstract Intermolecular Forces in Van der Waals Dimers] === Phase III === Topics: * Foundations of Density Functional Theory ** Statistics of an electron gas. The Kohn-Sham decomposition and the resulting alphabet soup of density functionals. * Shortcomings of DFT (reproducing electron number discontinuities) * Solvent Effects and Approximations ** QM/MM methods applicable to the condensed phase References: * [http://www.nobelprize.org/nobel_prizes/chemistry/laureates/1998/kohn-lecture.pdf 1998 Nobel Prize Lecture] * [http://prola.aps.org/abstract/PR/v136/i3B/pB864_1 Inhomogeneous Electron Gas] * [http://pubs.acs.org/doi/abs/10.1021/ct100738h MSCALE: A General Utility for Multiscale Modeling] === Phase IV === Topics: * Path Integral Formulations ** Derivation of classical mechanics, Heisenberg and Schrodinger. ** Elementary path integrals * Quantum and Classical Fluctuation-Dissipation Theorems * Optional material: Quaternion representation of rotations and the Dirac equation. References: * [http://scitation.aip.org/content/aapt/journal/ajp/71/2/10.1119/1.1522700 Reforming the Mathematical Language of Physics] ** [http://scitation.aip.org/content/aip/journal/jmp/16/3/10.1063/1.522555 Consistency in the formulation of the Dirac, Pauli, and Schrödinger theories] d5de767a7d03432303e9f34a3e279a12dd6c1223 128 127 2014-01-06T23:43:49Z David M. Rogers 2 /* Phase IV */ wikitext text/x-wiki <BIG>Quantum Mechanics II</BIG> == Course Info == * Course Number: CHM 6938-009 * Meeting Times: Tuesdays and Thursdays, 12:30 - 01:45PM ** No meetings on Mar. 11 or 13 due to USF Spring Break (Mar. 10-15) * Credit Hours: 3 * CRN: 11305 == Advanced Reference Material == * Primary Literature to be Discussed in Class * Everything from [[GradQuantumFall2013]] * [http://usf.eblib.com.ezproxy.lib.usf.edu/patron/FullRecord.aspx?p=1214609 D.R. Yarkony, ed., Modern Electronic Structure Theory, (World Scientific, Singapore, 1995).] The instructor may be reached anytime by phone 4-4298 or email (username: davidrogers on usf.edu). == Course Overview & Objectives == Having mastered the foundations of Quantum Mechanics, this course explores advanced and emerging topics through critical reading of the primary literature. By the end of the course, you will be able to evaluate, propose and carry out critical tests of ideas and methods directly from the literature. == Grading & Due Dates == Your work will be graded based on homework assignments (20%), participation in class discussion (20%), and two exams (30% each). * TBD == Planned Topics == === Phase I === Topics: * Thermochemistry, chemical reactions and kinetics * Scripting for Managing El. Structure Calcs ** Working with atomistic data ** Running large parallel electronic structure calculations ** The role of basis functions and convergence * Basic statistics of Boson and Fermion energy distributions - (stat) statistics on top of (QM) statistics. References: * [http://www.lct.jussieu.fr/manuels/Gaussian03/g_whitepap/thermo/thermo.pdf Thermochemistry in Gaussian] * [https://materialsproject.org Materials Project] ** [http://prb.aps.org/abstract/PRB/v82/i7/e075122 Hybrid density functional calculations of redox potentials and formation energies of transition metal compounds] * [http://icole.mut-es.ac.ir/downloads/Sci_Sec/W1/Einstein%201917.pdf On the quantum theory of radiation] ** [http://www.robeson.k12.nc.us/cms/lib6/NC01000307/Centricity/Domain/1160/_Files/AP%20Physics/Article%208/Rereading%20Einstein%20on%20Radiation.pdf Rereading Einstein on Radiation] === Phase II === Topics: * Excited States, Rayleigh-Schrodinger Perturbation (compare to MP2) * Polarizablility and other Dispersion Forces * Coupled-Cluster Expansions * Perturbation Theory Decomposition of Intermolecular Energies References: * Bes, Chapter 8.1-8.3 * A. Stone * [http://onlinelibrary.wiley.com/doi/10.1002/qua.560290520/abstract Intermolecular Forces in Van der Waals Dimers] === Phase III === Topics: * Foundations of Density Functional Theory ** Statistics of an electron gas. The Kohn-Sham decomposition and the resulting alphabet soup of density functionals. * Shortcomings of DFT (reproducing electron number discontinuities) * Solvent Effects and Approximations ** QM/MM methods applicable to the condensed phase References: * [http://www.nobelprize.org/nobel_prizes/chemistry/laureates/1998/kohn-lecture.pdf 1998 Nobel Prize Lecture] * [http://prola.aps.org/abstract/PR/v136/i3B/pB864_1 Inhomogeneous Electron Gas] * [http://pubs.acs.org/doi/abs/10.1021/ct100738h MSCALE: A General Utility for Multiscale Modeling] === Phase IV === Topics: * Path Integral Formulations ** Derivation of classical mechanics, Heisenberg and Schrodinger. ** Elementary path integrals * Quantum and Classical Fluctuation-Dissipation Theorems * Optional material: Quaternion representation of rotations and the Dirac equation. References: * [http://scitation.aip.org/content/aapt/journal/ajp/71/2/10.1119/1.1522700 Reforming the Mathematical Language of Physics] ** [http://scitation.aip.org/content/aip/journal/jmp/16/3/10.1063/1.522555 Consistency in the formulation of the Dirac, Pauli, and Schrödinger theories] *[http://dx.doi.org/10.1063/1.477102 Spectroscopic and Dielectric Properties of Liquid Water: A Molecular Dynamics Simulation Study] a1f35105f91e9c352364f93d239270c0a9e25b91 129 128 2014-01-07T16:50:33Z David M. Rogers 2 /* Course Info */ wikitext text/x-wiki <BIG>Quantum Mechanics II</BIG> == Course Info == * Course Number: CHM 6938-009 * Meeting Times: Tuesdays and Thursdays, 12:30 - 01:45PM ** No meetings on Mar. 11 or 13 due to USF Spring Break (Mar. 10-15) ** Midterm: Thursday, February 20, 12:30-13:45 (regular class time) ** Final: Thursday, May 1, 10:00-12:00 (following USF finals schedule) * Credit Hours: 3 * CRN: 11305 == Advanced Reference Material == * Primary Literature to be Discussed in Class * Everything from [[GradQuantumFall2013]] * [http://usf.eblib.com.ezproxy.lib.usf.edu/patron/FullRecord.aspx?p=1214609 D.R. Yarkony, ed., Modern Electronic Structure Theory, (World Scientific, Singapore, 1995).] The instructor may be reached anytime by phone 4-4298 or email (username: davidrogers on usf.edu). == Course Overview & Objectives == Having mastered the foundations of Quantum Mechanics, this course explores advanced and emerging topics through critical reading of the primary literature. By the end of the course, you will be able to evaluate, propose and carry out critical tests of ideas and methods directly from the literature. == Grading & Due Dates == Your work will be graded based on homework assignments (20%), participation in class discussion (20%), and two exams (30% each). * TBD == Planned Topics == === Phase I === Topics: * Thermochemistry, chemical reactions and kinetics * Scripting for Managing El. Structure Calcs ** Working with atomistic data ** Running large parallel electronic structure calculations ** The role of basis functions and convergence * Basic statistics of Boson and Fermion energy distributions - (stat) statistics on top of (QM) statistics. References: * [http://www.lct.jussieu.fr/manuels/Gaussian03/g_whitepap/thermo/thermo.pdf Thermochemistry in Gaussian] * [https://materialsproject.org Materials Project] ** [http://prb.aps.org/abstract/PRB/v82/i7/e075122 Hybrid density functional calculations of redox potentials and formation energies of transition metal compounds] * [http://icole.mut-es.ac.ir/downloads/Sci_Sec/W1/Einstein%201917.pdf On the quantum theory of radiation] ** [http://www.robeson.k12.nc.us/cms/lib6/NC01000307/Centricity/Domain/1160/_Files/AP%20Physics/Article%208/Rereading%20Einstein%20on%20Radiation.pdf Rereading Einstein on Radiation] === Phase II === Topics: * Excited States, Rayleigh-Schrodinger Perturbation (compare to MP2) * Polarizablility and other Dispersion Forces * Coupled-Cluster Expansions * Perturbation Theory Decomposition of Intermolecular Energies References: * Bes, Chapter 8.1-8.3 * A. Stone * [http://onlinelibrary.wiley.com/doi/10.1002/qua.560290520/abstract Intermolecular Forces in Van der Waals Dimers] === Phase III === Topics: * Foundations of Density Functional Theory ** Statistics of an electron gas. The Kohn-Sham decomposition and the resulting alphabet soup of density functionals. * Shortcomings of DFT (reproducing electron number discontinuities) * Solvent Effects and Approximations ** QM/MM methods applicable to the condensed phase References: * [http://www.nobelprize.org/nobel_prizes/chemistry/laureates/1998/kohn-lecture.pdf 1998 Nobel Prize Lecture] * [http://prola.aps.org/abstract/PR/v136/i3B/pB864_1 Inhomogeneous Electron Gas] * [http://pubs.acs.org/doi/abs/10.1021/ct100738h MSCALE: A General Utility for Multiscale Modeling] === Phase IV === Topics: * Path Integral Formulations ** Derivation of classical mechanics, Heisenberg and Schrodinger. ** Elementary path integrals * Quantum and Classical Fluctuation-Dissipation Theorems * Optional material: Quaternion representation of rotations and the Dirac equation. References: * [http://scitation.aip.org/content/aapt/journal/ajp/71/2/10.1119/1.1522700 Reforming the Mathematical Language of Physics] ** [http://scitation.aip.org/content/aip/journal/jmp/16/3/10.1063/1.522555 Consistency in the formulation of the Dirac, Pauli, and Schrödinger theories] *[http://dx.doi.org/10.1063/1.477102 Spectroscopic and Dielectric Properties of Liquid Water: A Molecular Dynamics Simulation Study] dd57a4faa231568d4c1fe19916c1566ccf59dc2e 133 129 2014-02-11T17:30:55Z David M. Rogers 2 /* Phase II */ wikitext text/x-wiki <BIG>Quantum Mechanics II</BIG> == Course Info == * Course Number: CHM 6938-009 * Meeting Times: Tuesdays and Thursdays, 12:30 - 01:45PM ** No meetings on Mar. 11 or 13 due to USF Spring Break (Mar. 10-15) ** Midterm: Thursday, February 20, 12:30-13:45 (regular class time) ** Final: Thursday, May 1, 10:00-12:00 (following USF finals schedule) * Credit Hours: 3 * CRN: 11305 == Advanced Reference Material == * Primary Literature to be Discussed in Class * Everything from [[GradQuantumFall2013]] * [http://usf.eblib.com.ezproxy.lib.usf.edu/patron/FullRecord.aspx?p=1214609 D.R. Yarkony, ed., Modern Electronic Structure Theory, (World Scientific, Singapore, 1995).] The instructor may be reached anytime by phone 4-4298 or email (username: davidrogers on usf.edu). == Course Overview & Objectives == Having mastered the foundations of Quantum Mechanics, this course explores advanced and emerging topics through critical reading of the primary literature. By the end of the course, you will be able to evaluate, propose and carry out critical tests of ideas and methods directly from the literature. == Grading & Due Dates == Your work will be graded based on homework assignments (20%), participation in class discussion (20%), and two exams (30% each). * TBD == Planned Topics == === Phase I === Topics: * Thermochemistry, chemical reactions and kinetics * Scripting for Managing El. Structure Calcs ** Working with atomistic data ** Running large parallel electronic structure calculations ** The role of basis functions and convergence * Basic statistics of Boson and Fermion energy distributions - (stat) statistics on top of (QM) statistics. References: * [http://www.lct.jussieu.fr/manuels/Gaussian03/g_whitepap/thermo/thermo.pdf Thermochemistry in Gaussian] * [https://materialsproject.org Materials Project] ** [http://prb.aps.org/abstract/PRB/v82/i7/e075122 Hybrid density functional calculations of redox potentials and formation energies of transition metal compounds] * [http://icole.mut-es.ac.ir/downloads/Sci_Sec/W1/Einstein%201917.pdf On the quantum theory of radiation] ** [http://www.robeson.k12.nc.us/cms/lib6/NC01000307/Centricity/Domain/1160/_Files/AP%20Physics/Article%208/Rereading%20Einstein%20on%20Radiation.pdf Rereading Einstein on Radiation] === Phase II === Topics: * Excited States, Rayleigh-Schrodinger Perturbation (compare to MP2) * Polarizablility and other Dispersion Forces * Coupled-Cluster Expansions * Perturbation Theory Decomposition of Intermolecular Energies References: * Bes, Chapter 8.1-8.3 * [[File:multipoles.pdf Multipole Electrostatic Interactions]] * [http://pubs.acs.org/doi/abs/10.1021/jp0484332 Temperature and Pressure Dependence of the AMOEBA Water Model] * [http://onlinelibrary.wiley.com/doi/10.1002/qua.560290520/abstract Intermolecular Forces in Van der Waals Dimers] * [http://dx.doi.org/10.1016/j.cplett.2005.12.080 Polarization damping in halide–water dimers] * [http://pubs.acs.org/doi/abs/10.1021/cr00031a008 Perturbation Theory Approach to Intermolecular Potential Energy Surfaces of van der Waals Complexes] (sections 1-3 and 7) === Phase III === Topics: * Foundations of Density Functional Theory ** Statistics of an electron gas. The Kohn-Sham decomposition and the resulting alphabet soup of density functionals. * Shortcomings of DFT (reproducing electron number discontinuities) * Solvent Effects and Approximations ** QM/MM methods applicable to the condensed phase References: * [http://www.nobelprize.org/nobel_prizes/chemistry/laureates/1998/kohn-lecture.pdf 1998 Nobel Prize Lecture] * [http://prola.aps.org/abstract/PR/v136/i3B/pB864_1 Inhomogeneous Electron Gas] * [http://pubs.acs.org/doi/abs/10.1021/ct100738h MSCALE: A General Utility for Multiscale Modeling] === Phase IV === Topics: * Path Integral Formulations ** Derivation of classical mechanics, Heisenberg and Schrodinger. ** Elementary path integrals * Quantum and Classical Fluctuation-Dissipation Theorems * Optional material: Quaternion representation of rotations and the Dirac equation. References: * [http://scitation.aip.org/content/aapt/journal/ajp/71/2/10.1119/1.1522700 Reforming the Mathematical Language of Physics] ** [http://scitation.aip.org/content/aip/journal/jmp/16/3/10.1063/1.522555 Consistency in the formulation of the Dirac, Pauli, and Schrödinger theories] *[http://dx.doi.org/10.1063/1.477102 Spectroscopic and Dielectric Properties of Liquid Water: A Molecular Dynamics Simulation Study] 377ac13c4031bdcee2105ee8cba18cd080db9d41 134 133 2014-02-11T17:31:42Z David M. Rogers 2 /* Phase II */ wikitext text/x-wiki <BIG>Quantum Mechanics II</BIG> == Course Info == * Course Number: CHM 6938-009 * Meeting Times: Tuesdays and Thursdays, 12:30 - 01:45PM ** No meetings on Mar. 11 or 13 due to USF Spring Break (Mar. 10-15) ** Midterm: Thursday, February 20, 12:30-13:45 (regular class time) ** Final: Thursday, May 1, 10:00-12:00 (following USF finals schedule) * Credit Hours: 3 * CRN: 11305 == Advanced Reference Material == * Primary Literature to be Discussed in Class * Everything from [[GradQuantumFall2013]] * [http://usf.eblib.com.ezproxy.lib.usf.edu/patron/FullRecord.aspx?p=1214609 D.R. Yarkony, ed., Modern Electronic Structure Theory, (World Scientific, Singapore, 1995).] The instructor may be reached anytime by phone 4-4298 or email (username: davidrogers on usf.edu). == Course Overview & Objectives == Having mastered the foundations of Quantum Mechanics, this course explores advanced and emerging topics through critical reading of the primary literature. By the end of the course, you will be able to evaluate, propose and carry out critical tests of ideas and methods directly from the literature. == Grading & Due Dates == Your work will be graded based on homework assignments (20%), participation in class discussion (20%), and two exams (30% each). * TBD == Planned Topics == === Phase I === Topics: * Thermochemistry, chemical reactions and kinetics * Scripting for Managing El. Structure Calcs ** Working with atomistic data ** Running large parallel electronic structure calculations ** The role of basis functions and convergence * Basic statistics of Boson and Fermion energy distributions - (stat) statistics on top of (QM) statistics. References: * [http://www.lct.jussieu.fr/manuels/Gaussian03/g_whitepap/thermo/thermo.pdf Thermochemistry in Gaussian] * [https://materialsproject.org Materials Project] ** [http://prb.aps.org/abstract/PRB/v82/i7/e075122 Hybrid density functional calculations of redox potentials and formation energies of transition metal compounds] * [http://icole.mut-es.ac.ir/downloads/Sci_Sec/W1/Einstein%201917.pdf On the quantum theory of radiation] ** [http://www.robeson.k12.nc.us/cms/lib6/NC01000307/Centricity/Domain/1160/_Files/AP%20Physics/Article%208/Rereading%20Einstein%20on%20Radiation.pdf Rereading Einstein on Radiation] === Phase II === Topics: * Excited States, Rayleigh-Schrodinger Perturbation (compare to MP2) * Polarizablility and other Dispersion Forces * Coupled-Cluster Expansions * Perturbation Theory Decomposition of Intermolecular Energies References: * Bes, Chapter 8.1-8.3 * [[File:multipoles.pdf Multipole Electrostatic Interactions]] * [http://pubs.acs.org/doi/abs/10.1021/jp0484332 Temperature and Pressure Dependence of the AMOEBA Water Model] * [http://onlinelibrary.wiley.com/doi/10.1002/qua.560290520/abstract Intermolecular Forces in Van der Waals Dimers] * [http://dx.doi.org/10.1016/j.cplett.2005.12.080 Polarization damping in halide–water dimers] * [http://pubs.acs.org/doi/abs/10.1021/cr00031a008 Perturbation Theory Approach to Intermolecular Potential Energy Surfaces of van der Waals Complexes] (sections 1-3 and 7) === Phase III === Topics: * Foundations of Density Functional Theory ** Statistics of an electron gas. The Kohn-Sham decomposition and the resulting alphabet soup of density functionals. * Shortcomings of DFT (reproducing electron number discontinuities) * Solvent Effects and Approximations ** QM/MM methods applicable to the condensed phase References: * [http://www.nobelprize.org/nobel_prizes/chemistry/laureates/1998/kohn-lecture.pdf 1998 Nobel Prize Lecture] * [http://prola.aps.org/abstract/PR/v136/i3B/pB864_1 Inhomogeneous Electron Gas] * [http://pubs.acs.org/doi/abs/10.1021/ct100738h MSCALE: A General Utility for Multiscale Modeling] === Phase IV === Topics: * Path Integral Formulations ** Derivation of classical mechanics, Heisenberg and Schrodinger. ** Elementary path integrals * Quantum and Classical Fluctuation-Dissipation Theorems * Optional material: Quaternion representation of rotations and the Dirac equation. References: * [http://scitation.aip.org/content/aapt/journal/ajp/71/2/10.1119/1.1522700 Reforming the Mathematical Language of Physics] ** [http://scitation.aip.org/content/aip/journal/jmp/16/3/10.1063/1.522555 Consistency in the formulation of the Dirac, Pauli, and Schrödinger theories] *[http://dx.doi.org/10.1063/1.477102 Spectroscopic and Dielectric Properties of Liquid Water: A Molecular Dynamics Simulation Study] 22be1b2cb1656783ac73cfa46342054190d5118a 135 134 2014-03-25T14:52:29Z David M. Rogers 2 /* Phase III */ wikitext text/x-wiki <BIG>Quantum Mechanics II</BIG> == Course Info == * Course Number: CHM 6938-009 * Meeting Times: Tuesdays and Thursdays, 12:30 - 01:45PM ** No meetings on Mar. 11 or 13 due to USF Spring Break (Mar. 10-15) ** Midterm: Thursday, February 20, 12:30-13:45 (regular class time) ** Final: Thursday, May 1, 10:00-12:00 (following USF finals schedule) * Credit Hours: 3 * CRN: 11305 == Advanced Reference Material == * Primary Literature to be Discussed in Class * Everything from [[GradQuantumFall2013]] * [http://usf.eblib.com.ezproxy.lib.usf.edu/patron/FullRecord.aspx?p=1214609 D.R. Yarkony, ed., Modern Electronic Structure Theory, (World Scientific, Singapore, 1995).] The instructor may be reached anytime by phone 4-4298 or email (username: davidrogers on usf.edu). == Course Overview & Objectives == Having mastered the foundations of Quantum Mechanics, this course explores advanced and emerging topics through critical reading of the primary literature. By the end of the course, you will be able to evaluate, propose and carry out critical tests of ideas and methods directly from the literature. == Grading & Due Dates == Your work will be graded based on homework assignments (20%), participation in class discussion (20%), and two exams (30% each). * TBD == Planned Topics == === Phase I === Topics: * Thermochemistry, chemical reactions and kinetics * Scripting for Managing El. Structure Calcs ** Working with atomistic data ** Running large parallel electronic structure calculations ** The role of basis functions and convergence * Basic statistics of Boson and Fermion energy distributions - (stat) statistics on top of (QM) statistics. References: * [http://www.lct.jussieu.fr/manuels/Gaussian03/g_whitepap/thermo/thermo.pdf Thermochemistry in Gaussian] * [https://materialsproject.org Materials Project] ** [http://prb.aps.org/abstract/PRB/v82/i7/e075122 Hybrid density functional calculations of redox potentials and formation energies of transition metal compounds] * [http://icole.mut-es.ac.ir/downloads/Sci_Sec/W1/Einstein%201917.pdf On the quantum theory of radiation] ** [http://www.robeson.k12.nc.us/cms/lib6/NC01000307/Centricity/Domain/1160/_Files/AP%20Physics/Article%208/Rereading%20Einstein%20on%20Radiation.pdf Rereading Einstein on Radiation] === Phase II === Topics: * Excited States, Rayleigh-Schrodinger Perturbation (compare to MP2) * Polarizablility and other Dispersion Forces * Coupled-Cluster Expansions * Perturbation Theory Decomposition of Intermolecular Energies References: * Bes, Chapter 8.1-8.3 * [[File:multipoles.pdf Multipole Electrostatic Interactions]] * [http://pubs.acs.org/doi/abs/10.1021/jp0484332 Temperature and Pressure Dependence of the AMOEBA Water Model] * [http://onlinelibrary.wiley.com/doi/10.1002/qua.560290520/abstract Intermolecular Forces in Van der Waals Dimers] * [http://dx.doi.org/10.1016/j.cplett.2005.12.080 Polarization damping in halide–water dimers] * [http://pubs.acs.org/doi/abs/10.1021/cr00031a008 Perturbation Theory Approach to Intermolecular Potential Energy Surfaces of van der Waals Complexes] (sections 1-3 and 7) === Phase III === Topics: * Foundations of Density Functional Theory ** Statistics of an electron gas. The Kohn-Sham decomposition and the resulting alphabet soup of density functionals. * Shortcomings of DFT (reproducing electron number discontinuities) * Solvent Effects and Approximations ** QM/MM methods applicable to the condensed phase References: * [http://www.nobelprize.org/nobel_prizes/chemistry/laureates/1998/kohn-lecture.pdf 1998 Nobel Prize Lecture] * [http://prola.aps.org/abstract/PR/v136/i3B/pB864_1 Inhomogeneous Electron Gas] * [http://dx.doi.org/10.1016/j.cpc.2012.06.016 Issues and challenges in orbital-free density functional calculations] * [http://pubs.acs.org/doi/abs/10.1021/ct100738h MSCALE: A General Utility for Multiscale Modeling] * [http://pubs.acs.org/doi/full/10.1021/ct300493y Improving Generalized Born Models by Exploiting Connections to Polarizable Continuum Models. II. Corrections for Salt Effects] === Phase IV === Topics: * Path Integral Formulations ** Derivation of classical mechanics, Heisenberg and Schrodinger. ** Elementary path integrals * Quantum and Classical Fluctuation-Dissipation Theorems * Optional material: Quaternion representation of rotations and the Dirac equation. References: * [http://scitation.aip.org/content/aapt/journal/ajp/71/2/10.1119/1.1522700 Reforming the Mathematical Language of Physics] ** [http://scitation.aip.org/content/aip/journal/jmp/16/3/10.1063/1.522555 Consistency in the formulation of the Dirac, Pauli, and Schrödinger theories] *[http://dx.doi.org/10.1063/1.477102 Spectroscopic and Dielectric Properties of Liquid Water: A Molecular Dynamics Simulation Study] 3c2bf7b112810179bd411f658e38452006f4fafe 140 135 2014-04-01T19:25:37Z David M. Rogers 2 /* Grading & Due Dates */ wikitext text/x-wiki <BIG>Quantum Mechanics II</BIG> == Course Info == * Course Number: CHM 6938-009 * Meeting Times: Tuesdays and Thursdays, 12:30 - 01:45PM ** No meetings on Mar. 11 or 13 due to USF Spring Break (Mar. 10-15) ** Midterm: Thursday, February 20, 12:30-13:45 (regular class time) ** Final: Thursday, May 1, 10:00-12:00 (following USF finals schedule) * Credit Hours: 3 * CRN: 11305 == Advanced Reference Material == * Primary Literature to be Discussed in Class * Everything from [[GradQuantumFall2013]] * [http://usf.eblib.com.ezproxy.lib.usf.edu/patron/FullRecord.aspx?p=1214609 D.R. Yarkony, ed., Modern Electronic Structure Theory, (World Scientific, Singapore, 1995).] The instructor may be reached anytime by phone 4-4298 or email (username: davidrogers on usf.edu). == Course Overview & Objectives == Having mastered the foundations of Quantum Mechanics, this course explores advanced and emerging topics through critical reading of the primary literature. By the end of the course, you will be able to evaluate, propose and carry out critical tests of ideas and methods directly from the literature. == Grading & Due Dates == Your work will be graded based on homework assignments (20%), participation in class discussion (20%), and two exams (30% each). * [[DFTpy|Homework 3 - DFT]] Due Thurs., Apr. 10 == Planned Topics == === Phase I === Topics: * Thermochemistry, chemical reactions and kinetics * Scripting for Managing El. Structure Calcs ** Working with atomistic data ** Running large parallel electronic structure calculations ** The role of basis functions and convergence * Basic statistics of Boson and Fermion energy distributions - (stat) statistics on top of (QM) statistics. References: * [http://www.lct.jussieu.fr/manuels/Gaussian03/g_whitepap/thermo/thermo.pdf Thermochemistry in Gaussian] * [https://materialsproject.org Materials Project] ** [http://prb.aps.org/abstract/PRB/v82/i7/e075122 Hybrid density functional calculations of redox potentials and formation energies of transition metal compounds] * [http://icole.mut-es.ac.ir/downloads/Sci_Sec/W1/Einstein%201917.pdf On the quantum theory of radiation] ** [http://www.robeson.k12.nc.us/cms/lib6/NC01000307/Centricity/Domain/1160/_Files/AP%20Physics/Article%208/Rereading%20Einstein%20on%20Radiation.pdf Rereading Einstein on Radiation] === Phase II === Topics: * Excited States, Rayleigh-Schrodinger Perturbation (compare to MP2) * Polarizablility and other Dispersion Forces * Coupled-Cluster Expansions * Perturbation Theory Decomposition of Intermolecular Energies References: * Bes, Chapter 8.1-8.3 * [[File:multipoles.pdf Multipole Electrostatic Interactions]] * [http://pubs.acs.org/doi/abs/10.1021/jp0484332 Temperature and Pressure Dependence of the AMOEBA Water Model] * [http://onlinelibrary.wiley.com/doi/10.1002/qua.560290520/abstract Intermolecular Forces in Van der Waals Dimers] * [http://dx.doi.org/10.1016/j.cplett.2005.12.080 Polarization damping in halide–water dimers] * [http://pubs.acs.org/doi/abs/10.1021/cr00031a008 Perturbation Theory Approach to Intermolecular Potential Energy Surfaces of van der Waals Complexes] (sections 1-3 and 7) === Phase III === Topics: * Foundations of Density Functional Theory ** Statistics of an electron gas. The Kohn-Sham decomposition and the resulting alphabet soup of density functionals. * Shortcomings of DFT (reproducing electron number discontinuities) * Solvent Effects and Approximations ** QM/MM methods applicable to the condensed phase References: * [http://www.nobelprize.org/nobel_prizes/chemistry/laureates/1998/kohn-lecture.pdf 1998 Nobel Prize Lecture] * [http://prola.aps.org/abstract/PR/v136/i3B/pB864_1 Inhomogeneous Electron Gas] * [http://dx.doi.org/10.1016/j.cpc.2012.06.016 Issues and challenges in orbital-free density functional calculations] * [http://pubs.acs.org/doi/abs/10.1021/ct100738h MSCALE: A General Utility for Multiscale Modeling] * [http://pubs.acs.org/doi/full/10.1021/ct300493y Improving Generalized Born Models by Exploiting Connections to Polarizable Continuum Models. II. Corrections for Salt Effects] === Phase IV === Topics: * Path Integral Formulations ** Derivation of classical mechanics, Heisenberg and Schrodinger. ** Elementary path integrals * Quantum and Classical Fluctuation-Dissipation Theorems * Optional material: Quaternion representation of rotations and the Dirac equation. References: * [http://scitation.aip.org/content/aapt/journal/ajp/71/2/10.1119/1.1522700 Reforming the Mathematical Language of Physics] ** [http://scitation.aip.org/content/aip/journal/jmp/16/3/10.1063/1.522555 Consistency in the formulation of the Dirac, Pauli, and Schrödinger theories] *[http://dx.doi.org/10.1063/1.477102 Spectroscopic and Dielectric Properties of Liquid Water: A Molecular Dynamics Simulation Study] e70b3df0d029c36430d8bf8a77ebe52177754d66 143 140 2014-04-11T17:23:52Z David M. Rogers 2 /* Phase III */ wikitext text/x-wiki <BIG>Quantum Mechanics II</BIG> == Course Info == * Course Number: CHM 6938-009 * Meeting Times: Tuesdays and Thursdays, 12:30 - 01:45PM ** No meetings on Mar. 11 or 13 due to USF Spring Break (Mar. 10-15) ** Midterm: Thursday, February 20, 12:30-13:45 (regular class time) ** Final: Thursday, May 1, 10:00-12:00 (following USF finals schedule) * Credit Hours: 3 * CRN: 11305 == Advanced Reference Material == * Primary Literature to be Discussed in Class * Everything from [[GradQuantumFall2013]] * [http://usf.eblib.com.ezproxy.lib.usf.edu/patron/FullRecord.aspx?p=1214609 D.R. Yarkony, ed., Modern Electronic Structure Theory, (World Scientific, Singapore, 1995).] The instructor may be reached anytime by phone 4-4298 or email (username: davidrogers on usf.edu). == Course Overview & Objectives == Having mastered the foundations of Quantum Mechanics, this course explores advanced and emerging topics through critical reading of the primary literature. By the end of the course, you will be able to evaluate, propose and carry out critical tests of ideas and methods directly from the literature. == Grading & Due Dates == Your work will be graded based on homework assignments (20%), participation in class discussion (20%), and two exams (30% each). * [[DFTpy|Homework 3 - DFT]] Due Thurs., Apr. 10 == Planned Topics == === Phase I === Topics: * Thermochemistry, chemical reactions and kinetics * Scripting for Managing El. Structure Calcs ** Working with atomistic data ** Running large parallel electronic structure calculations ** The role of basis functions and convergence * Basic statistics of Boson and Fermion energy distributions - (stat) statistics on top of (QM) statistics. References: * [http://www.lct.jussieu.fr/manuels/Gaussian03/g_whitepap/thermo/thermo.pdf Thermochemistry in Gaussian] * [https://materialsproject.org Materials Project] ** [http://prb.aps.org/abstract/PRB/v82/i7/e075122 Hybrid density functional calculations of redox potentials and formation energies of transition metal compounds] * [http://icole.mut-es.ac.ir/downloads/Sci_Sec/W1/Einstein%201917.pdf On the quantum theory of radiation] ** [http://www.robeson.k12.nc.us/cms/lib6/NC01000307/Centricity/Domain/1160/_Files/AP%20Physics/Article%208/Rereading%20Einstein%20on%20Radiation.pdf Rereading Einstein on Radiation] === Phase II === Topics: * Excited States, Rayleigh-Schrodinger Perturbation (compare to MP2) * Polarizablility and other Dispersion Forces * Coupled-Cluster Expansions * Perturbation Theory Decomposition of Intermolecular Energies References: * Bes, Chapter 8.1-8.3 * [[File:multipoles.pdf Multipole Electrostatic Interactions]] * [http://pubs.acs.org/doi/abs/10.1021/jp0484332 Temperature and Pressure Dependence of the AMOEBA Water Model] * [http://onlinelibrary.wiley.com/doi/10.1002/qua.560290520/abstract Intermolecular Forces in Van der Waals Dimers] * [http://dx.doi.org/10.1016/j.cplett.2005.12.080 Polarization damping in halide–water dimers] * [http://pubs.acs.org/doi/abs/10.1021/cr00031a008 Perturbation Theory Approach to Intermolecular Potential Energy Surfaces of van der Waals Complexes] (sections 1-3 and 7) === Phase III === Topics: * Foundations of Density Functional Theory ** Statistics of an electron gas. The Kohn-Sham decomposition and the resulting alphabet soup of density functionals. * Shortcomings of DFT (reproducing electron number discontinuities) * Solvent Effects and Approximations ** QM/MM methods applicable to the condensed phase References: * [http://www.nobelprize.org/nobel_prizes/chemistry/laureates/1998/kohn-lecture.pdf 1998 Nobel Prize Lecture] * [http://prola.aps.org/abstract/PR/v136/i3B/pB864_1 Inhomogeneous Electron Gas] * [http://dx.doi.org/10.1016/j.cpc.2012.06.016 Issues and challenges in orbital-free density functional calculations] * [http://pubs.acs.org/doi/abs/10.1021/ct100738h MSCALE: A General Utility for Multiscale Modeling] * [http://pubs.acs.org/doi/full/10.1021/ct300493y Improving Generalized Born Models by Exploiting Connections to Polarizable Continuum Models. II. Corrections for Salt Effects] === Phase IV === Topics: * Path Integral Formulations ** Derivation of classical mechanics, Heisenberg and Schrodinger. ** Elementary path integrals * Quantum and Classical Fluctuation-Dissipation Theorems * Optional material: Quaternion representation of rotations and the Dirac equation. References: * [http://scitation.aip.org/content/aapt/journal/ajp/71/2/10.1119/1.1522700 Reforming the Mathematical Language of Physics] ** [http://scitation.aip.org/content/aip/journal/jmp/16/3/10.1063/1.522555 Consistency in the formulation of the Dirac, Pauli, and Schrödinger theories] *[http://dx.doi.org/10.1063/1.477102 Spectroscopic and Dielectric Properties of Liquid Water: A Molecular Dynamics Simulation Study] f31cae9cfa7f439758ef9ebadabcbdfd779b9884 Courses 0 16 130 107 2014-01-14T15:28:14Z David M. Rogers 2 /* Courses */ wikitext text/x-wiki Here's a list of courses with useful online materials: == Courses == * [[GradQuantumFall2013| USF Graduate Quantum Mechanics I]] * [[GradQuantumSpring2014| USF Graduate Quantum Mechanics II]] * [http://lambda-the-ultimate.org/classic/Courses.html Functional Programming] == Lecture Series == * [http://www.esqc.org/lectures European Summer School in Quantum Chemistry] == Tutorials == * [http://www.mathematica-journal.com/2012/02/evaluation-of-gaussian-molecular-integrals Evaluating Matrix Elements] * [http://www.haskell.org/tutorial/ Haskell] * [http://monads.haskell.cz/html/index.html Monads] * [http://www.yosefk.com/blog/my-history-with-forth-stack-machines.html The Forth Language] == Reference Material == * [http://dft.sandia.gov/Quest/DFT_codes.html List of DFT Codes] * [http://docs.python.org/3/tutorial/ Python Tutorial] * [http://www.nwchem-sw.org/index.php/Release62:NWChem_Documentation NWChem Documentation] * [http://www.ebi.ac.uk/pdbe-srv/pdbechem/ PDB Ligand Structures] ca188099603530ec7800b25fe5f864197e40857e 154 130 2014-06-19T19:36:40Z David M. Rogers 2 /* Courses */ wikitext text/x-wiki Here's a list of courses with useful online materials: == Courses == * [[GradQuantumFall2013| USF Graduate Quantum Mechanics I]] * [[GradQuantumSpring2014| USF Graduate Quantum Mechanics II]] * [[CompSciFall2014|Introduction to Scientific Computing]] (Dual Level) * [http://lambda-the-ultimate.org/classic/Courses.html Functional Programming] == Lecture Series == * [http://www.esqc.org/lectures European Summer School in Quantum Chemistry] == Tutorials == * [http://www.mathematica-journal.com/2012/02/evaluation-of-gaussian-molecular-integrals Evaluating Matrix Elements] * [http://www.haskell.org/tutorial/ Haskell] * [http://monads.haskell.cz/html/index.html Monads] * [http://www.yosefk.com/blog/my-history-with-forth-stack-machines.html The Forth Language] == Reference Material == * [http://dft.sandia.gov/Quest/DFT_codes.html List of DFT Codes] * [http://docs.python.org/3/tutorial/ Python Tutorial] * [http://www.nwchem-sw.org/index.php/Release62:NWChem_Documentation NWChem Documentation] * [http://www.ebi.ac.uk/pdbe-srv/pdbechem/ PDB Ligand Structures] 8aa324451f23ec0f221120f30ef9afbb9a839e17 Publications 0 8 131 58 2014-01-15T21:52:49Z David M. Rogers 2 wikitext text/x-wiki {| cellpadding="4" style="border: 1px solid darkgray;" |- style="border: 1px solid darkgray;" || David M. Rogers, Dian Jiao, Lawrence Pratt, and Susan B. Rempe. "Structural Models and Molecular Thermodynamics of Hydration of Ions and Small Molecules" [http://dx.doi.org/10.1016/B978-0-444-59440-2.00004-1 Annu. Rep. Comp. Chem. 8:71–127, 2012.] |- style="border: 1px solid darkgray;" || David M. Rogers and Susan B. Rempe. "Irreversible Thermodynamics." [http://dx.doi.org/10.1088/1742-6596/402/1/012014 J. Phys.: Conf. Ser. 402:012014, 2012]. |- style="border: 1px solid darkgray;" || David M. Rogers, Thomas L. Beck, and Susan B. Rempe. [[Media:Dmroge_InfoNonequ2011.pdf|"An Information Theory Approach to Nonlinear, Nonequilibrium Thermodynamics."]] [http://dx.doi.org/10.1007/s10955-011-0358-9 J. Stat. Phys. 145(2):385-409, 2011] We show how the interpretation of thermodynamic states as representing system information leads naturally to thermodynamic cycles and the first and second laws of thermodynamics as well as similar formulations for nontrivial nonequilibrium problems. The logical development of the theory also leads naturally to correct indistinguishability factors in the partition function. |- style="border: 1px solid darkgray;" || Sameer Varma, David M. Rogers, Lawrence R. Pratt, and Susan B. Rempe. "Perspectives on Ion Selectivity: Design Principles for K+ Selectivity in Membrane Transport." [http://jgp.rupress.org/content/137/6/479.full J. Gen. Physiol., 137(6):479-488, 2011.] We review the development of models for understanding the physical basis of selectivity for K+ ions over Na+, its sibling only one row behind, in membrane channels and transporters. Although the problem is subtle because of the morass of competing effects, we emphasize work analyzing the systematic influence of the environment on tipping local binding site structure toward selective configurations. |- style="border: 1px solid darkgray;" || David M. Rogers and Susan B. Rempe. [http://www.ncbi.nlm.nih.gov/pmc/articles/PMC3443978/ “Probing the Thermodynamics of Competitive Ion Binding Using Minimum Energy Structures.”] [http://dx.doi.org/10.1021/jp2012864 J. Phys. Chem. B, 115(29):9116-29, 2011]. We presented an extension of the Quasi-Chemical theory for quantifying the impact of local structure on ion complexation thermodynamics. The theory can be simply represented using a set of thermodynamic cycles involving binding site structural and compositional states as reaction intermediates. |- style="border: 1px solid darkgray;" || Susan B. Rempe and David M. Rogers; et. al. “Computational and experimental platform for understanding and optimizing water flux and salt rejection in nanoporous membranes.” [http://prod.sandia.gov/techlib/access-control.cgi/2010/106735.pdf Sandia Technical Report, SAND2010-6735, 2010.] We summarize work on designing polymer coatings for salt exclusion in water transporting nanopores. In this work, I collected available molecular dynamics results for these systems and performed a novel energy efficiency analysis able to relate atomistic and experimental scales as well as identify important design goals and chemical principles for material performance. |- style="border: 1px solid darkgray;" || David M. Rogers, [http://rave.ohiolink.edu/etdc/view?acc_num=ucin1251832030 ''''Using Bayes' Theorem for Free Energy Calculations''''], 2009. We investigated the central quantity of free energies in a Bayesian context and provide estimators for solvation free energies as well as optimal potential of mean force approximations to model polymer coarse-grained dynamics from atomistic simulations. |- style="border: 1px solid darkgray;" || Zhen Zhao, David M. Rogers and Thomas L. Beck. "Polarization and Charge Transfer in the Hydration of Chloride Ions." [http://link.aip.org/link/?JCP/132/014502/1 J. Chem. Phys., 132:014502, 2010.] Dr. Zhao's ab-initio analysis of the charge distribution in water-ion clusters highlighted the importance of many-body water-water interactions and charge transfer effects in determining cluster structural and energetic properties. These are still challenging to represent in modern polarizable forcefields and have implications for anion properties at interfaces. |- style="border: 1px solid darkgray;" || David M. Rogers and Thomas L. Beck. "Quasi-Chemical and Structural Analysis of Polarizable Anion Hydration." [http://link.aip.org/link/?JCP/132/014505/1 J. Chem. Phys., 132:014505, 2010.] The role of polarizability in forcefield-based models of ions and water was examined. Utilizing some of our recent developments on quasi-chemical theory, we have been able to quantify the tightened, asymmetric nature of the ion's local solvation waters induced by increased polarizability as well as the exact effects of polarization on the solvation free energy. The results suggest some potential problems and diagnostics for such models. |- style="border: 1px solid darkgray;" || David M. Rogers and Thomas L. Beck. [http://forcesolve.sourceforge.net/ Force Solve] (Sourceforge, Chicago IL, 2008). This force matching software implements and tests coarse-graining for general molecular systems in a mere 4000 lines of code. It is able to parametrize coarse Hamiltonians from atomic trajectory data given arbitrary definitions of coarse united-atom type models as well as carry out short Langevin Dynamics simulations on the coarse scale. The program's main drawbacks are its slow speed and high memory usage due to its simplistic design, attributable to the interpreted nature of python. |- style="border: 1px solid darkgray;" || David M. Rogers and Thomas L. Beck. "Resolution and Scale Independent Nonparametric Function Matching Using a String Energy Penalized Spline Prior." 2008. [http://arxiv.org/abs/1003.4741 arXiv:1003.4741v1] (stat.ML). Fresh insight is provided into long-standing mathematical issues surrounding computational modeling of continuous functions from a few sampled data points. The present research lays the groundwork for predicting the behavior of complicated many-body systems using advanced regression techniques. |} d4d45d83a1e6e1011614fa8e7eda74df5c691391 152 131 2014-06-19T19:26:43Z David M. Rogers 2 wikitext text/x-wiki {| cellpadding="4" style="border: 1px solid darkgray;" |- style="border: 1px solid darkgray;" || Mathias B. Andersen, David M. Rogers, Junyu Mai, Benjamin Schudel, Anson V. Hatch, Susan B. Rempe and Ali Mani. "Spatiotemporal pH dynamics in concentration polarization near ion-selective membranes." [http://dx.doi.org/10.1021/la5014297 Langmuir, in press 2014] |- style="border: 1px solid darkgray;" || W. K. Chan, P. L. Lorenzi, A. Anishkin, P. Purwaha, D. M. Rogers, S. Sukharev, S.B. Rempe, and J. N. Weinstein. "The glutaminase activity of l-asparaginase is not required for anticancer activity against ASNS-negative cells." [http://dx.doi.org/10.1182/blood-2013-10-535112 Blood. 123(23):3596-606, 2014]. |- style="border: 1px solid darkgray;" || David M. Rogers, Dian Jiao, Lawrence Pratt, and Susan B. Rempe. "Structural Models and Molecular Thermodynamics of Hydration of Ions and Small Molecules" [http://dx.doi.org/10.1016/B978-0-444-59440-2.00004-1 Annu. Rep. Comp. Chem. 8:71–127, 2012.] |- style="border: 1px solid darkgray;" || David M. Rogers and Susan B. Rempe. "Irreversible Thermodynamics." [http://dx.doi.org/10.1088/1742-6596/402/1/012014 J. Phys.: Conf. Ser. 402:012014, 2012]. |- style="border: 1px solid darkgray;" || David M. Rogers, Thomas L. Beck, and Susan B. Rempe. [[Media:Dmroge_InfoNonequ2011.pdf|"An Information Theory Approach to Nonlinear, Nonequilibrium Thermodynamics."]] [http://dx.doi.org/10.1007/s10955-011-0358-9 J. Stat. Phys. 145(2):385-409, 2011] We show how the interpretation of thermodynamic states as representing system information leads naturally to thermodynamic cycles and the first and second laws of thermodynamics as well as similar formulations for nontrivial nonequilibrium problems. The logical development of the theory also leads naturally to correct indistinguishability factors in the partition function. |- style="border: 1px solid darkgray;" || Sameer Varma, David M. Rogers, Lawrence R. Pratt, and Susan B. Rempe. "Perspectives on Ion Selectivity: Design Principles for K+ Selectivity in Membrane Transport." [http://jgp.rupress.org/content/137/6/479.full J. Gen. Physiol., 137(6):479-488, 2011.] We review the development of models for understanding the physical basis of selectivity for K+ ions over Na+, its sibling only one row behind, in membrane channels and transporters. Although the problem is subtle because of the morass of competing effects, we emphasize work analyzing the systematic influence of the environment on tipping local binding site structure toward selective configurations. |- style="border: 1px solid darkgray;" || David M. Rogers and Susan B. Rempe. [http://www.ncbi.nlm.nih.gov/pmc/articles/PMC3443978/ “Probing the Thermodynamics of Competitive Ion Binding Using Minimum Energy Structures.”] [http://dx.doi.org/10.1021/jp2012864 J. Phys. Chem. B, 115(29):9116-29, 2011]. We presented an extension of the Quasi-Chemical theory for quantifying the impact of local structure on ion complexation thermodynamics. The theory can be simply represented using a set of thermodynamic cycles involving binding site structural and compositional states as reaction intermediates. |- style="border: 1px solid darkgray;" || Susan B. Rempe and David M. Rogers; et. al. “Computational and experimental platform for understanding and optimizing water flux and salt rejection in nanoporous membranes.” [http://prod.sandia.gov/techlib/access-control.cgi/2010/106735.pdf Sandia Technical Report, SAND2010-6735, 2010.] We summarize work on designing polymer coatings for salt exclusion in water transporting nanopores. In this work, I collected available molecular dynamics results for these systems and performed a novel energy efficiency analysis able to relate atomistic and experimental scales as well as identify important design goals and chemical principles for material performance. |- style="border: 1px solid darkgray;" || David M. Rogers, [http://rave.ohiolink.edu/etdc/view?acc_num=ucin1251832030 ''''Using Bayes' Theorem for Free Energy Calculations''''], 2009. We investigated the central quantity of free energies in a Bayesian context and provide estimators for solvation free energies as well as optimal potential of mean force approximations to model polymer coarse-grained dynamics from atomistic simulations. |- style="border: 1px solid darkgray;" || Zhen Zhao, David M. Rogers and Thomas L. Beck. "Polarization and Charge Transfer in the Hydration of Chloride Ions." [http://link.aip.org/link/?JCP/132/014502/1 J. Chem. Phys., 132:014502, 2010.] Dr. Zhao's ab-initio analysis of the charge distribution in water-ion clusters highlighted the importance of many-body water-water interactions and charge transfer effects in determining cluster structural and energetic properties. These are still challenging to represent in modern polarizable forcefields and have implications for anion properties at interfaces. |- style="border: 1px solid darkgray;" || David M. Rogers and Thomas L. Beck. "Quasi-Chemical and Structural Analysis of Polarizable Anion Hydration." [http://link.aip.org/link/?JCP/132/014505/1 J. Chem. Phys., 132:014505, 2010.] The role of polarizability in forcefield-based models of ions and water was examined. Utilizing some of our recent developments on quasi-chemical theory, we have been able to quantify the tightened, asymmetric nature of the ion's local solvation waters induced by increased polarizability as well as the exact effects of polarization on the solvation free energy. The results suggest some potential problems and diagnostics for such models. |- style="border: 1px solid darkgray;" || David M. Rogers and Thomas L. Beck. [http://forcesolve.sourceforge.net/ Force Solve] (Sourceforge, Chicago IL, 2008). This force matching software implements and tests coarse-graining for general molecular systems in a mere 4000 lines of code. It is able to parametrize coarse Hamiltonians from atomic trajectory data given arbitrary definitions of coarse united-atom type models as well as carry out short Langevin Dynamics simulations on the coarse scale. The program's main drawbacks are its slow speed and high memory usage due to its simplistic design, attributable to the interpreted nature of python. |- style="border: 1px solid darkgray;" || David M. Rogers and Thomas L. Beck. "Resolution and Scale Independent Nonparametric Function Matching Using a String Energy Penalized Spline Prior." 2008. [http://arxiv.org/abs/1003.4741 arXiv:1003.4741v1] (stat.ML). Fresh insight is provided into long-standing mathematical issues surrounding computational modeling of continuous functions from a few sampled data points. The present research lays the groundwork for predicting the behavior of complicated many-body systems using advanced regression techniques. |} 0fe0708d905b77679debc038c1c7cd27a9ddda93 155 152 2014-07-14T15:12:29Z David M. Rogers 2 wikitext text/x-wiki {| cellpadding="4" style="border: 1px solid darkgray;" |- style="border: 1px solid darkgray;" || David M. Rogers. "Silmaril, A Functional Language for Distributed Parallel Evaluation." [http://predictivestatmech.org/sil/papers/sil.pdf Submitted version] |- style="border: 1px solid darkgray;" || Mathias B. Andersen, David M. Rogers, Junyu Mai, Benjamin Schudel, Anson V. Hatch, Susan B. Rempe and Ali Mani. "Spatiotemporal pH dynamics in concentration polarization near ion-selective membranes." [http://dx.doi.org/10.1021/la5014297 Langmuir, in press 2014] |- style="border: 1px solid darkgray;" || W. K. Chan, P. L. Lorenzi, A. Anishkin, P. Purwaha, D. M. Rogers, S. Sukharev, S.B. Rempe, and J. N. Weinstein. "The glutaminase activity of l-asparaginase is not required for anticancer activity against ASNS-negative cells." [http://dx.doi.org/10.1182/blood-2013-10-535112 Blood. 123(23):3596-606, 2014]. |- style="border: 1px solid darkgray;" || David M. Rogers, Dian Jiao, Lawrence Pratt, and Susan B. Rempe. "Structural Models and Molecular Thermodynamics of Hydration of Ions and Small Molecules" [http://dx.doi.org/10.1016/B978-0-444-59440-2.00004-1 Annu. Rep. Comp. Chem. 8:71–127, 2012.] |- style="border: 1px solid darkgray;" || David M. Rogers and Susan B. Rempe. "Irreversible Thermodynamics." [http://dx.doi.org/10.1088/1742-6596/402/1/012014 J. Phys.: Conf. Ser. 402:012014, 2012]. |- style="border: 1px solid darkgray;" || David M. Rogers, Thomas L. Beck, and Susan B. Rempe. [[Media:Dmroge_InfoNonequ2011.pdf|"An Information Theory Approach to Nonlinear, Nonequilibrium Thermodynamics."]] [http://dx.doi.org/10.1007/s10955-011-0358-9 J. Stat. Phys. 145(2):385-409, 2011] We show how the interpretation of thermodynamic states as representing system information leads naturally to thermodynamic cycles and the first and second laws of thermodynamics as well as similar formulations for nontrivial nonequilibrium problems. The logical development of the theory also leads naturally to correct indistinguishability factors in the partition function. |- style="border: 1px solid darkgray;" || Sameer Varma, David M. Rogers, Lawrence R. Pratt, and Susan B. Rempe. "Perspectives on Ion Selectivity: Design Principles for K+ Selectivity in Membrane Transport." [http://jgp.rupress.org/content/137/6/479.full J. Gen. Physiol., 137(6):479-488, 2011.] We review the development of models for understanding the physical basis of selectivity for K+ ions over Na+, its sibling only one row behind, in membrane channels and transporters. Although the problem is subtle because of the morass of competing effects, we emphasize work analyzing the systematic influence of the environment on tipping local binding site structure toward selective configurations. |- style="border: 1px solid darkgray;" || David M. Rogers and Susan B. Rempe. [http://www.ncbi.nlm.nih.gov/pmc/articles/PMC3443978/ “Probing the Thermodynamics of Competitive Ion Binding Using Minimum Energy Structures.”] [http://dx.doi.org/10.1021/jp2012864 J. Phys. Chem. B, 115(29):9116-29, 2011]. We presented an extension of the Quasi-Chemical theory for quantifying the impact of local structure on ion complexation thermodynamics. The theory can be simply represented using a set of thermodynamic cycles involving binding site structural and compositional states as reaction intermediates. |- style="border: 1px solid darkgray;" || Susan B. Rempe and David M. Rogers; et. al. “Computational and experimental platform for understanding and optimizing water flux and salt rejection in nanoporous membranes.” [http://prod.sandia.gov/techlib/access-control.cgi/2010/106735.pdf Sandia Technical Report, SAND2010-6735, 2010.] We summarize work on designing polymer coatings for salt exclusion in water transporting nanopores. In this work, I collected available molecular dynamics results for these systems and performed a novel energy efficiency analysis able to relate atomistic and experimental scales as well as identify important design goals and chemical principles for material performance. |- style="border: 1px solid darkgray;" || David M. Rogers, [http://rave.ohiolink.edu/etdc/view?acc_num=ucin1251832030 ''''Using Bayes' Theorem for Free Energy Calculations''''], 2009. We investigated the central quantity of free energies in a Bayesian context and provide estimators for solvation free energies as well as optimal potential of mean force approximations to model polymer coarse-grained dynamics from atomistic simulations. |- style="border: 1px solid darkgray;" || Zhen Zhao, David M. Rogers and Thomas L. Beck. "Polarization and Charge Transfer in the Hydration of Chloride Ions." [http://link.aip.org/link/?JCP/132/014502/1 J. Chem. Phys., 132:014502, 2010.] Dr. Zhao's ab-initio analysis of the charge distribution in water-ion clusters highlighted the importance of many-body water-water interactions and charge transfer effects in determining cluster structural and energetic properties. These are still challenging to represent in modern polarizable forcefields and have implications for anion properties at interfaces. |- style="border: 1px solid darkgray;" || David M. Rogers and Thomas L. Beck. "Quasi-Chemical and Structural Analysis of Polarizable Anion Hydration." [http://link.aip.org/link/?JCP/132/014505/1 J. Chem. Phys., 132:014505, 2010.] The role of polarizability in forcefield-based models of ions and water was examined. Utilizing some of our recent developments on quasi-chemical theory, we have been able to quantify the tightened, asymmetric nature of the ion's local solvation waters induced by increased polarizability as well as the exact effects of polarization on the solvation free energy. The results suggest some potential problems and diagnostics for such models. |- style="border: 1px solid darkgray;" || David M. Rogers and Thomas L. Beck. [http://forcesolve.sourceforge.net/ Force Solve] (Sourceforge, Chicago IL, 2008). This force matching software implements and tests coarse-graining for general molecular systems in a mere 4000 lines of code. It is able to parametrize coarse Hamiltonians from atomic trajectory data given arbitrary definitions of coarse united-atom type models as well as carry out short Langevin Dynamics simulations on the coarse scale. The program's main drawbacks are its slow speed and high memory usage due to its simplistic design, attributable to the interpreted nature of python. |- style="border: 1px solid darkgray;" || David M. Rogers and Thomas L. Beck. "Resolution and Scale Independent Nonparametric Function Matching Using a String Energy Penalized Spline Prior." 2008. [http://arxiv.org/abs/1003.4741 arXiv:1003.4741v1] (stat.ML). Fresh insight is provided into long-standing mathematical issues surrounding computational modeling of continuous functions from a few sampled data points. The present research lays the groundwork for predicting the behavior of complicated many-body systems using advanced regression techniques. |} 9e74efe37c099c598c24300513a27e7650252375 CompSciFall2014 0 38 136 2014-03-28T21:06:24Z David M. Rogers 2 Created page with "== Textbooks == * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-0072-7 Beginning Python, Lie, 2005] (eBook avail. from USF Library) * [http://link.spri…" wikitext text/x-wiki == Textbooks == * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-0072-7 Beginning Python, Lie, 2005] (eBook avail. from USF Library) * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-3238-4 Python Algorithms, Lie, 2010] (eBook avail. from USF Library) Other (possibly useful) materials: * Chapters 7&8 of Modelling and Simulation, Birta and Arbez, Springer 2007 (eBook avail. from USF Library). * Chapters 4-6 of Models and Algorithms for Intelligent Data Analysis, Runkler, Springer 2012 (eBook avail. from USF Library). * Guide to Scientific Computing in C++, Francis and Whiteley, Springer, 2012. (eBook avail. from USF Library) * Extra info. On the basics: ** Chapters 3 and 7 of Mathematics in Computing, Regan, Springer 2013. (eBook avail. from USF Library) f04be4bde415466710fbf8fdf038a5b0ad1c2514 137 136 2014-03-28T21:14:51Z David M. Rogers 2 wikitext text/x-wiki '''<BIG>Introduction to Scientific Computing</BIG>''' == Overview == Mathematical models in the natural sciences take many shapes and forms. The moment they become more complicated than tracking a few variables over time, we have to put away our Excel spreadsheets and make use of a solid foundation in computational science. The course establishes this foundation by introducing data structures and algorithms used in everyday scientific computing using examples in the python scripting language. By the end of the Semester, students will be able to navigate the Linux command-line to go from a mathematical model to a numerical solution. Best practices for working with computer code and visualizing data will also be covered. == Textbooks == * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-0072-7 Beginning Python, Hetland, 2005] (eBook avail. from USF Library) * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-3238-4 Python Algorithms, Hetland, 2010] (eBook avail. from USF Library) Other (possibly useful) materials: * Chapters 7&8 of Modelling and Simulation, Birta and Arbez, Springer 2007 (eBook avail. from USF Library). * Chapters 4-6 of Models and Algorithms for Intelligent Data Analysis, Runkler, Springer 2012 (eBook avail. from USF Library). * Guide to Scientific Computing in C++, Francis and Whiteley, Springer, 2012. (eBook avail. from USF Library) * Extra info. On the basics: ** Chapters 3 and 7 of Mathematics in Computing, Regan, Springer 2013. (eBook avail. from USF Library) == Topics == # Languages #* bash (shell) #* python (scripting) #* stack & register-based machine languages: overview of C and Fortran syntax & compiling with gcc, ‘thread safety’ #* Shared libraries & language inter-operability (FFI) # Algorithms #* Horner’s algorithm for polynomials #* Newton’s root finding algo. #* Overview of general optimization algo-s (example: linear & nonlin. least-squares) #* Numerical integration (scripted, plus gnu ODE) #* Communication (how HTTP get/put works) # Data Structures #* Linked Lists #* Trees (file system hierarchies) #* Graphs #* Arrays (dense & sparse) example: vectors & rotations / transpositions, densities and difference operators # Presentation & visualization #* Flat CSV files (and excel) #* Working with binary data #* Python matplotlib (2D images) #* Binning histograms & weighted averages # Best Practices #* High-level code design (modularity, interface specifications, unit testing, etc.) #* Code audit: open-source libraries, ex. Gnu Scientific Library, qsort in libc, Boost #* Source code versioning (example: git or mercurial) #* gdb & execution profiling #* documentation #* Makefiles 9d54237523ef22397ec8e9d3b8ed69de4c56715c 138 137 2014-03-28T21:21:41Z David M. Rogers 2 wikitext text/x-wiki '''<BIG>Introduction to Scientific Computing</BIG>''' == Overview == Mathematical models in the natural sciences take many shapes and forms. The moment they become more complicated than tracking a few variables over time, we have to put away our Excel spreadsheets and make use of a solid foundation in computational science. The course establishes this foundation by introducing data structures and algorithms used in everyday scientific computing using examples in the python scripting language. By the end of the Semester, students will be able to navigate the Linux command-line to go from a mathematical model to a numerical solution. Best practices for working with computer code and visualizing data will also be covered. == Textbooks == * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-0072-7 Beginning Python, Hetland, 2005] (eBook avail. from USF Library) * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-3238-4 Python Algorithms, Hetland, 2010] (eBook avail. from USF Library) * [http://aosabook.org/en/index.html The Architecture of Open Source Applications] Other (possibly useful) materials: * Chapters 7&8 of Modelling and Simulation, Birta and Arbez, Springer 2007 (eBook avail. from USF Library). * Chapters 4-6 of Models and Algorithms for Intelligent Data Analysis, Runkler, Springer 2012 (eBook avail. from USF Library). * Guide to Scientific Computing in C++, Francis and Whiteley, Springer, 2012. (eBook avail. from USF Library) * Extra info. On the basics: ** Chapters 3 and 7 of Mathematics in Computing, Regan, Springer 2013. (eBook avail. from USF Library) == Topics == # Languages #* bash (shell) #* python (scripting) #* stack & register-based machine languages: overview of C and Fortran syntax & compiling with gcc, ‘thread safety’ #* Shared libraries & language inter-operability (FFI) # Algorithms #* Horner’s algorithm for polynomials #* Newton’s root finding algo. #* Overview of general optimization algo-s (example: linear & nonlin. least-squares) #* Numerical integration (scripted, plus gnu ODE) #* Communication (how HTTP get/put works) # Data Structures #* Linked Lists #* Trees (file system hierarchies) #* Graphs #* Arrays (dense & sparse) example: vectors & rotations / transpositions, densities and difference operators # Presentation & visualization #* Flat CSV files (and excel) #* Working with binary data #* Python matplotlib (2D images) #* Binning histograms & weighted averages # Best Practices #* High-level code design (modularity, interface specifications, unit testing, etc.) #* Code audit: open-source libraries, ex. Gnu Scientific Library, qsort in libc, Boost #* Source code versioning (example: git or mercurial) #* gdb & execution profiling #* documentation #* Makefiles dc50df5f9d03cd651b901ccfe1f86ff03865a443 139 138 2014-03-28T22:41:11Z David M. Rogers 2 /* Textbooks */ wikitext text/x-wiki '''<BIG>Introduction to Scientific Computing</BIG>''' == Overview == Mathematical models in the natural sciences take many shapes and forms. The moment they become more complicated than tracking a few variables over time, we have to put away our Excel spreadsheets and make use of a solid foundation in computational science. The course establishes this foundation by introducing data structures and algorithms used in everyday scientific computing using examples in the python scripting language. By the end of the Semester, students will be able to navigate the Linux command-line to go from a mathematical model to a numerical solution. Best practices for working with computer code and visualizing data will also be covered. == Textbooks == * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-0072-7 Beginning Python, Hetland, 2005] (eBook avail. from USF Library) * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-3238-4 Python Algorithms, Hetland, 2010] (eBook avail. from USF Library) * [http://aosabook.org/en/index.html The Architecture of Open Source Applications] Other (possibly useful) materials: * Chapters 7&8 of Modelling and Simulation, Birta and Arbez, Springer 2007 (eBook avail. from USF Library). * Chapters 4-6 of Models and Algorithms for Intelligent Data Analysis, Runkler, Springer 2012 (eBook avail. from USF Library). * Guide to Scientific Computing in C++, Francis and Whiteley, Springer, 2012. (eBook avail. from USF Library) * Extra info. On the basics: ** Chapters 3 and 7 of Mathematics in Computing, Regan, Springer 2013. (eBook avail. from USF Library) ** Instant feedback graphical programming with [https://www.khanacademy.org/cs/programming/ Khan Academy] == Topics == # Languages #* bash (shell) #* python (scripting) #* stack & register-based machine languages: overview of C and Fortran syntax & compiling with gcc, ‘thread safety’ #* Shared libraries & language inter-operability (FFI) # Algorithms #* Horner’s algorithm for polynomials #* Newton’s root finding algo. #* Overview of general optimization algo-s (example: linear & nonlin. least-squares) #* Numerical integration (scripted, plus gnu ODE) #* Communication (how HTTP get/put works) # Data Structures #* Linked Lists #* Trees (file system hierarchies) #* Graphs #* Arrays (dense & sparse) example: vectors & rotations / transpositions, densities and difference operators # Presentation & visualization #* Flat CSV files (and excel) #* Working with binary data #* Python matplotlib (2D images) #* Binning histograms & weighted averages # Best Practices #* High-level code design (modularity, interface specifications, unit testing, etc.) #* Code audit: open-source libraries, ex. Gnu Scientific Library, qsort in libc, Boost #* Source code versioning (example: git or mercurial) #* gdb & execution profiling #* documentation #* Makefiles 9ae4e43f304135129705514e8ee217e0d461b8c2 147 139 2014-06-03T22:03:11Z David M. Rogers 2 wikitext text/x-wiki '''<BIG>Introduction to Scientific Computing</BIG>''' Course Info * Course Numbers CHM 4932/6938, CRN: 94314 * Credit Hours: 3 * Meeting Dates: Aug. 25 - Dec. 3, 2014 ** No Class Sept. 1 and Nov. 28 * Meeting Times: Mon. and Wed., 12:30-13:45 in SCA 222 ** Lab Session & Office Hours: Fri. 12:30-13:45 in SCA 222 == Overview == Mathematical models in the natural sciences take many shapes and forms. The moment they become more complicated than tracking a few variables over time, we have to put away our Excel spreadsheets and make use of a solid foundation in computational science. The course establishes this foundation by introducing data structures and algorithms used in everyday scientific computing using examples in the python scripting language. By the end of the Semester, students will be able to navigate the Linux command-line to go from a mathematical model to a numerical solution. Best practices for working with computer code and visualizing data will also be covered. == Textbooks == * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-0072-7 Beginning Python, Hetland, 2005] (eBook avail. from USF Library) * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-3238-4 Python Algorithms, Hetland, 2010] (eBook avail. from USF Library) * [http://aosabook.org/en/index.html The Architecture of Open Source Applications] Other (possibly useful) materials: * Chapters 7&8 of Modelling and Simulation, Birta and Arbez, Springer 2007 (eBook avail. from USF Library). * Chapters 4-6 of Models and Algorithms for Intelligent Data Analysis, Runkler, Springer 2012 (eBook avail. from USF Library). * Guide to Scientific Computing in C++, Francis and Whiteley, Springer, 2012. (eBook avail. from USF Library) * Extra info. On the basics: ** Chapters 3 and 7 of Mathematics in Computing, Regan, Springer 2013. (eBook avail. from USF Library) ** Instant feedback graphical programming with [https://www.khanacademy.org/cs/programming/ Khan Academy] == Topics == # Languages #* bash (shell) #* python (scripting) #* stack & register-based machine languages: overview of C and Fortran syntax & compiling with gcc, ‘thread safety’ #* Shared libraries & language inter-operability (FFI) # Algorithms #* Horner’s algorithm for polynomials #* Newton’s root finding algo. #* Overview of general optimization algo-s (example: linear & nonlin. least-squares) #* Numerical integration (scripted, plus gnu ODE) #* Communication (how HTTP get/put works) # Data Structures #* Linked Lists #* Trees (file system hierarchies) #* Graphs #* Arrays (dense & sparse) example: vectors & rotations / transpositions, densities and difference operators # Presentation & visualization #* Flat CSV files (and excel) #* Working with binary data #* Python matplotlib (2D images) #* Binning histograms & weighted averages # Best Practices #* High-level code design (modularity, interface specifications, unit testing, etc.) #* Code audit: open-source libraries, ex. Gnu Scientific Library, qsort in libc, Boost #* Source code versioning (example: git or mercurial) #* gdb & execution profiling #* documentation #* Makefiles 87f075d7e149e2266c148b3ef40ca766e2217814 158 147 2014-08-21T14:26:11Z David M. Rogers 2 wikitext text/x-wiki '''<BIG>Introduction to Scientific Computing</BIG>''' Course Info * Course Numbers CHM 4932/6938, CRN: 94314 * Credit Hours: 3 * Meeting Dates: Aug. 25 - Dec. 3, 2014 ** No Class Sept. 1 and Nov. 28 * Meeting Times: Mon. and Wed., 12:30-13:45 in SCA 222 ** Lab Session & Office Hours: Fri. 12:30-13:45 in SCA 222 == Overview == Mathematical models in the natural sciences take many shapes and forms. The moment they become more complicated than tracking a few variables over time, we have to put away our Excel spreadsheets and make use of a solid foundation in computational science. The course establishes this foundation by introducing data structures and algorithms used in everyday scientific computing using examples in the python scripting language. By the end of the Semester, students will be able to navigate the Linux command-line to go from a mathematical model to a numerical solution. Best practices for working with computer code and visualizing data will also be covered. == Textbooks == * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-0072-7 Beginning Python, Hetland, 2005] (eBook avail. from USF Library) * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-3238-4 Python Algorithms, Hetland, 2010] (eBook avail. from USF Library) * [http://aosabook.org/en/index.html The Architecture of Open Source Applications] Other (possibly useful) materials: * Chapters 7&8 of Modelling and Simulation, Birta and Arbez, Springer 2007 (eBook avail. from USF Library). * Chapters 4-6 of Models and Algorithms for Intelligent Data Analysis, Runkler, Springer 2012 (eBook avail. from USF Library). * Guide to Scientific Computing in C++, Francis and Whiteley, Springer, 2012. (eBook avail. from USF Library) * Extra info. On the basics: ** Chapters 3 and 7 of Mathematics in Computing, Regan, Springer 2013. (eBook avail. from USF Library) ** Instant feedback graphical programming with [https://www.khanacademy.org/cs/programming/ Khan Academy] == Topics == # Languages #* bash (shell) #* python (scripting) #* stack & register-based machine languages: overview of C and Fortran syntax & compiling with gcc, ‘thread safety’ #* Shared libraries & language inter-operability (FFI) # Algorithms #* Horner’s algorithm for polynomials #* Newton’s root finding algo. #* Overview of general optimization algo-s (example: linear & nonlin. least-squares) #* Numerical integration (scripted, plus gnu ODE) #* Communication (how HTTP get/put works) # Data Structures #* Linked Lists #* Trees (file system hierarchies) #* Graphs #* Arrays (dense & sparse) example: vectors & rotations / transpositions, densities and difference operators # Presentation & visualization #* Flat CSV files (and excel) #* Working with binary data #* Python matplotlib (2D images) #* Binning histograms & weighted averages # Best Practices #* High-level code design (modularity, interface specifications, unit testing, etc.) #* Code audit: open-source libraries, ex. Gnu Scientific Library, qsort in libc, Boost #* Source code versioning (example: git or mercurial) #* gdb & execution profiling #* documentation #* Makefiles === Notes & Homework === * [[CompSciWeek1]] 402111e9f5408a1b46ddb3a8bf8d82b60a19bab6 DFTpy 0 39 141 2014-04-01T19:27:53Z David M. Rogers 2 Created page with "This problem set gives a (broken) solver for the 1D Hohnberg-Kohn equations using the Thomas-Fermi approximation. The numerical methods are all there - fix the science and turn …" wikitext text/x-wiki This problem set gives a (broken) solver for the 1D Hohnberg-Kohn equations using the Thomas-Fermi approximation. The numerical methods are all there - fix the science and turn it in. <source lang="python"> #!/usr/bin/env python # # QMII, USF Spring 2014 # Homework 3 - due Thurs., Apr 10, 2014: # # Solve the 1D Hohnberg-Kohn equations using the Thomas-Fermi approximation # to the energy functional, E = int v_ext n dx + T[n] + U[n] # # Find solutions over L = 1nm in an external potential # given by a uniform electric field (in the +x direction) of 0.1 V / nm. # # - Look at all 4 solutions (lm = -0.05, -0.1, -0.15, and -0.2 eV/nm^2) # - Your final result should use M=100 points. # # 1. Fix the units in the code to make the length and energy scales # consistently in nanometers and eV / nm^2. # # 2. Find the energy and multiplier, lm for the conditions above # (hint: loop over a range of lm from -1 to -10) # How are the two mathematically related? # # 3. Describe the electron density that results. # # 4. What does the solution suggest about modeling bonding with TF theory? # # 5. What energy term is problematic when there is only 1 electron (and why)? from ucgrad.units import * from numpy import * from scipy.optimize import fmin, fsolve M = 100 eps0 = 8.854e-12 # <- check units! # length scale dx = 1.0/M # nm x = arange(M)*dx G = -abs(x[:,newaxis] - x[newaxis,:]) / eps0 Me = 0.91e-30 tf = 3*Planck**2/(10*Me)\ *(3/(8*pi))**(2/3.0) \ * 1.0 # TODO: more units... v_ext = arange(M)*0.01 # <- check units! #v_ext = G[:,M/2] def T(n): return sum(tf*n**(2/3.0) * n)*dx def U(n): return dot(n, dot(G, n))*0.5*dx**2 def E(n): n = abs(n) return T(n) + U(n) + dx*sum(v_ext*n) - dx*lm*sum(n) # check units on these as well. Are the dx-es right? def dT(n): return tf*(5/3.0)*n**(2/3.0) def dU(n): return dot(G, n)*dx def dE(n): n = abs(n) return dT(n) + dU(n) + v_ext - lm def dE_2(m): n = cumsum(m) n += 10.0/M - sum(n) return dT(n) + dU(n) + v_ext for lm in -0.05*arange(4): n0 = zeros(M)+1.0 n = fsolve(dE, n0) #n = fmin(E, n0) n = abs(n) print n print sum(n) print E(n) #print G #print v_ext </source> bcc2c2f28dff547f263e222aa5b4100376822013 142 141 2014-04-01T19:28:18Z David M. Rogers 2 wikitext text/x-wiki This problem set gives a (broken) solver for the 1D Hohnberg-Kohn equations using the Thomas-Fermi approximation. The numerical methods are all there - fix the science and turn it in. <source lang="python"> #!/usr/bin/env python # # QMII, USF Spring 2014 # Homework 3 - due Thurs., Apr 10, 2014: # # Solve the 1D Hohnberg-Kohn equations using the Thomas-Fermi approximation # to the energy functional, E = int v_ext n dx + T[n] + U[n] # # Find solutions over L = 1nm in an external potential # given by a uniform electric field (in the +x direction) of 0.1 V / nm. # # - Look at all 4 solutions (lm = -0.05, -0.1, -0.15, and -0.2 eV/nm^2) # - Your final result should use M=100 points. # # 1. Fix the units in the code to make the length and energy scales # consistently in nanometers and eV / nm^2. # # 2. Find the energy and multiplier, lm for the conditions above # (hint: loop over a range of lm from -1 to -10) # How are the two mathematically related? # # 3. Describe the electron density that results. # # 4. What does the solution suggest about modeling bonding with TF theory? # # 5. What energy term is problematic when there is only 1 electron (and why)? from numpy import * from scipy.optimize import fmin, fsolve M = 100 eps0 = 8.854e-12 # <- check units! # length scale dx = 1.0/M # nm x = arange(M)*dx G = -abs(x[:,newaxis] - x[newaxis,:]) / eps0 Me = 0.91e-30 tf = 3*Planck**2/(10*Me)\ *(3/(8*pi))**(2/3.0) \ * 1.0 # TODO: more units... v_ext = arange(M)*0.01 # <- check units! #v_ext = G[:,M/2] def T(n): return sum(tf*n**(2/3.0) * n)*dx def U(n): return dot(n, dot(G, n))*0.5*dx**2 def E(n): n = abs(n) return T(n) + U(n) + dx*sum(v_ext*n) - dx*lm*sum(n) # check units on these as well. Are the dx-es right? def dT(n): return tf*(5/3.0)*n**(2/3.0) def dU(n): return dot(G, n)*dx def dE(n): n = abs(n) return dT(n) + dU(n) + v_ext - lm def dE_2(m): n = cumsum(m) n += 10.0/M - sum(n) return dT(n) + dU(n) + v_ext for lm in -0.05*arange(4): n0 = zeros(M)+1.0 n = fsolve(dE, n0) #n = fmin(E, n0) n = abs(n) print n print sum(n) print E(n) #print G #print v_ext </source> 026289763241af25d502ebd8d4f81b2e9ec17ffa Vimrc 0 40 146 2014-04-11T18:08:47Z David M. Rogers 2 Created page with "Defines macros for tex-ifying a text reference. '''.vim/ftplugin/bib.vim''' <source lang="vim"> noremap <silent> <Leader>a iauthor = {<ESC>ww noremap <silent> <Leader>t ititle =…" wikitext text/x-wiki Defines macros for tex-ifying a text reference. '''.vim/ftplugin/bib.vim''' <source lang="vim"> noremap <silent> <Leader>a iauthor = {<ESC>ww noremap <silent> <Leader>t ititle = {<ESC>) noremap <silent> <Leader>j ijournal = {<ESC>) noremap <silent> <Leader>p ipages = {<ESC>:.s/-[^-]/--/<CR>/[., ]/<CR>:nohl<CR> noremap <silent> <Leader>y iyear = <ESC>/[^0-9]/<CR>:nohl<CR> noremap <silent> <Leader>v ivolume = <ESC>/[^0-9]/<CR>:nohl<CR> noremap <silent> <Leader>n inumber = <ESC>/[^0-9]/<CR>:nohl<CR> noremap <silent> <Leader>A r aand<ESC>ww noremap <silent> <Leader>; r}a,<CR><ESC> noremap <silent> <Leader>, a,<CR><ESC> </source> 0cd2ef02acb03f5b80a573c0029cec256cf8654c Predictive Chemistry:Current events 4 10 153 32 2014-06-19T19:35:42Z David M. Rogers 2 wikitext text/x-wiki * Monday, August 25: USF Autumn Semester First Day of Classes - don't forget to sign up for [[CompSciFall2014|Introduction to Scientific Computing]]! * Friday, May 9 2014: David M. Rogers presented "Jumping from atomistic to continuum simulation of electrochemical driving at interfaces," at the 2014 Florida FAME Conference.[http://www.fame.chem.ufl.edu/computational.html] * January 29th, 2014: David M. Rogers presented "Simulating at the molecular / continuum interface," at the USF Research Computing User's Group Forum [http://www.usf.edu/it/research-computing/featured-researchers/rogersgroup.aspx]. * Monday, August 26 2013: USF Autumn Semester First Day of Classes * Friday, July 12, 2013: Argonne Center for Nanoscale Materials [http://nano.anl.gov/users/call_for_proposals.html Proposal Deadline] * Thursday, July 4, 2013: Independence Day - celebrate by supporting [https://www.eff.org/ EFF] * Thursday, April 11 2013: David M. Rogers presented "Solute Partitioning and Transport through Natural and Biomimetic Membranes," at the 2013 ACS National Meeting. == Calendars == * [http://www.registrar.usf.edu/enroll/regist/calendt.php USF Calendar] bba344bfeec5cae8b3c4da7abda2bf1e4ab41e7c 156 153 2014-07-14T15:15:55Z David M. Rogers 2 wikitext text/x-wiki * Monday, August 25 2014: USF Autumn Semester First Day of Classes - don't forget to sign up for [[CompSciFall2014|Introduction to Scientific Computing]]! * Tuesday, July 8 2014: David M. Rogers presented "What’s Holding Up Multiscale modeling?" at the Telluride, CO workshop for [http://www.telluridescience.org/meetings/workshop-details?wid=404 Ions in Aqueous Solutions and Molecular Biology]. * Friday, May 9 2014: David M. Rogers presented "Jumping from atomistic to continuum simulation of electrochemical driving at interfaces," at the 2014 Florida FAME Conference.[http://www.fame.chem.ufl.edu/computational.html] * January 29th, 2014: David M. Rogers presented "Simulating at the molecular / continuum interface," at the USF Research Computing User's Group Forum [http://www.usf.edu/it/research-computing/featured-researchers/rogersgroup.aspx]. * Monday, August 26 2013: USF Autumn Semester First Day of Classes * Friday, July 12, 2013: Argonne Center for Nanoscale Materials [http://nano.anl.gov/users/call_for_proposals.html Proposal Deadline] * Thursday, July 4, 2013: Independence Day - celebrate by supporting [https://www.eff.org/ EFF] * Thursday, April 11 2013: David M. Rogers presented "Solute Partitioning and Transport through Natural and Biomimetic Membranes," at the 2013 ACS National Meeting. == Calendars == * [http://www.registrar.usf.edu/enroll/regist/calendt.php USF Calendar] 2c5f50ec8020becd60cc8e698b1ae666d35406c7 157 156 2014-08-21T14:24:34Z David M. Rogers 2 wikitext text/x-wiki * Friday, August 29 2014: Felipe Zapata joins the group! * Monday, August 25 2014: USF Autumn Semester First Day of Classes - don't forget to sign up for [[CompSciFall2014|Introduction to Scientific Computing]]! * Monday, Aug. 18 2014: David M. Rogers presented an invited talk "pH Dynamics During Concentration Polarization," to the [http://www.pnnl.gov/computing/cm4/ CM4 Mathematics for Mesoscopic Materials Modeling Group]. * Tuesday, July 8 2014: David M. Rogers presented "What’s Holding Up Multiscale modeling?" at the Telluride, CO workshop for [http://www.telluridescience.org/meetings/workshop-details?wid=404 Ions in Aqueous Solutions and Molecular Biology]. * Friday, May 9 2014: David M. Rogers presented "Jumping from atomistic to continuum simulation of electrochemical driving at interfaces," at the 2014 Florida FAME Conference.[http://www.fame.chem.ufl.edu/computational.html] * January 29th, 2014: David M. Rogers presented "Simulating at the molecular / continuum interface," at the USF Research Computing User's Group Forum [http://www.usf.edu/it/research-computing/featured-researchers/rogersgroup.aspx]. * Monday, August 26 2013: USF Autumn Semester First Day of Classes * Friday, July 12, 2013: Argonne Center for Nanoscale Materials [http://nano.anl.gov/users/call_for_proposals.html Proposal Deadline] * Thursday, July 4, 2013: Independence Day - celebrate by supporting [https://www.eff.org/ EFF] * Thursday, April 11 2013: David M. Rogers presented "Solute Partitioning and Transport through Natural and Biomimetic Membranes," at the 2013 ACS National Meeting. == Calendars == * [http://www.registrar.usf.edu/enroll/regist/calendt.php USF Calendar] d28d9ab538446dc4a8b08d41b0b3c59046250728 CompSciWeek1 0 41 159 2014-08-21T14:49:57Z David M. Rogers 2 Created page with "== Class 1 == # Pretest # Basic Shell Usage #* pwd, ls, directory structure # Access to Resources #* Logging into the lab computers #** Explanation of dual boot, OS evolution #…" wikitext text/x-wiki == Class 1 == # Pretest # Basic Shell Usage #* pwd, ls, directory structure # Access to Resources #* Logging into the lab computers #** Explanation of dual boot, OS evolution #* opening terminals, and terminals through terminals #* Logging into circe.rc.usf.edu #* Moving files #* Running python on your own machine #** Windows: Python Idle + easy_install () #** alt: Cygwin #** OSX / Linux: Package managers (OSX: fink, Debian (deb): apt-get, RH (RPM): yum) # First-order data types: #* int(1.1), float(-3), string(4) [essentially all languages] #* (and 2nd order) tuple([5]), list((6,)), dict([(6,7)]) [python-specific] == Class 2 == # What is a Turing machine? # The infinite loop and other control structures. # First algorithms (Horner, Euclid, Babylonian) # Code walk-through for a poorly designed Euclid''s algo. # The KISS, DRY, and incremental principles # Higher-order constructs: #* functions #* functional code == Homework I == # Create a program that reads in strings with raw_input() until a string containing a single '.' is sent. After that, the program should print out the strings it has read in reverse order (hint: use list.pop()). # Implement the Babylonian/Hero''s method to approximate the square root of 2 using 10 iterations. Plot the error in the approximation against iteration number. Is there a good way to automatically guess when to stop iterating? # Imagine Bassetts Ice Cream has a data set of daily ice cream sales for 3 different flavors stretching back to 1893. Write pseudocode for an algorithm that finds the largest and smallest sales over daily, weekly, monthly, and yearly time-scales. Use steps like `add together 7 days sales` and `get the smallest number in the list`. If each test or addition step for each number takes 0.1 microseconds (10^-7 seconds), estimate how many microfortnights (1 microfortnight = 1.2096 s) the code will take to run? # Obfuscation challenge: Write (in the most complicated unreadable way you can stand) a code that prints out the first 20 or so prime numbers. The code is limited to 100 lines, cannot use external packages, and must always finish running in less than 1 minute. 1176e24f1d0e0f069c50bf3f6956913d562f1903 160 159 2014-08-21T14:50:32Z David M. Rogers 2 /* Homework I */ wikitext text/x-wiki == Class 1 == # Pretest # Basic Shell Usage #* pwd, ls, directory structure # Access to Resources #* Logging into the lab computers #** Explanation of dual boot, OS evolution #* opening terminals, and terminals through terminals #* Logging into circe.rc.usf.edu #* Moving files #* Running python on your own machine #** Windows: Python Idle + easy_install () #** alt: Cygwin #** OSX / Linux: Package managers (OSX: fink, Debian (deb): apt-get, RH (RPM): yum) # First-order data types: #* int(1.1), float(-3), string(4) [essentially all languages] #* (and 2nd order) tuple([5]), list((6,)), dict([(6,7)]) [python-specific] == Class 2 == # What is a Turing machine? # The infinite loop and other control structures. # First algorithms (Horner, Euclid, Babylonian) # Code walk-through for a poorly designed Euclid''s algo. # The KISS, DRY, and incremental principles # Higher-order constructs: #* functions #* functional code == Homework I == # Create a program that reads in strings with raw_input() until a string containing a single '.' is sent. After that, the program should print out the strings it has read in reverse order (hint: use list.pop()). # Implement the Babylonian/Hero''s method to approximate the square root of 2 using 10 iterations. Plot the error in the approximation against iteration number. Is there a good way to automatically guess when to stop iterating? # Imagine Bassetts Ice Cream has a data set of daily ice cream sales for 3 different flavors stretching back to 1893. Write pseudocode for an algorithm that finds the largest and smallest sales over daily, weekly, monthly, and yearly time-scales. Use steps like `add together 7 days sales` and `get the smallest number in the list`. If each test or addition step for each number takes 0.1 microseconds (10^-7 seconds), estimate how many microfortnights (1 microfortnight = 1.2096 s) the code will take to run? # Obfuscation challenge: Write (in the most complicated unreadable way you can stand) a code that prints out the first 20 or so prime numbers. The code is limited to 100 lines, cannot use external packages, and must always finish running in less than 1 minute. 815ef47ed2f4637baaa5373326c1df9aed85eb2f CompSciFall2014 0 38 161 158 2014-08-25T16:00:21Z David M. Rogers 2 wikitext text/x-wiki '''<BIG>Introduction to Scientific Computing</BIG>''' Course Info * Course Numbers CHM 4932/6938, CRN: 94314 * Credit Hours: 3 * Meeting Dates: Aug. 25 - Dec. 3, 2014 ** No Class Sept. 1 and Nov. 28 * Meeting Times: Mon. and Wed., 12:30-13:45 in SCA 222 ** Lab Session & Office Hours: Fri. 12:30-13:45 in SCA 222 * Assignments: ** [[#Notes & Homework|Weekly Homework]] (60%) ** Midterm Project (20%) *** Topic by Friday, Sept. 16 *** due Friday, Oct. 17, 2014 ** Final Project (20%) *** Topic by Friday, Nov. 14 *** due Friday, Dec. 5, 2014 == Overview == Mathematical models in the natural sciences take many shapes and forms. The moment they become more complicated than tracking a few variables over time, we have to put away our Excel spreadsheets and make use of a solid foundation in computational science. The course establishes this foundation by introducing data structures and algorithms used in everyday scientific computing using examples in the python scripting language. By the end of the Semester, students will be able to navigate the Linux command-line to go from a mathematical model to a numerical solution. Best practices for working with computer code and visualizing data will also be covered. == Textbooks == * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-0072-7 Beginning Python, Hetland, 2005] (eBook avail. from USF Library) * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-3238-4 Python Algorithms, Hetland, 2010] (eBook avail. from USF Library) * [http://aosabook.org/en/index.html The Architecture of Open Source Applications] Other (possibly useful) materials: * Chapters 7&8 of Modelling and Simulation, Birta and Arbez, Springer 2007 (eBook avail. from USF Library). * Chapters 4-6 of Models and Algorithms for Intelligent Data Analysis, Runkler, Springer 2012 (eBook avail. from USF Library). * Guide to Scientific Computing in C++, Francis and Whiteley, Springer, 2012. (eBook avail. from USF Library) * Extra info. On the basics: ** Chapters 3 and 7 of Mathematics in Computing, Regan, Springer 2013. (eBook avail. from USF Library) ** Instant feedback graphical programming with [https://www.khanacademy.org/cs/programming/ Khan Academy] == Topics == # Languages #* bash (shell) #* python (scripting) #* stack & register-based machine languages: overview of C and Fortran syntax & compiling with gcc, ‘thread safety’ #* Shared libraries & language inter-operability (FFI) # Algorithms #* Horner’s algorithm for polynomials #* Newton’s root finding algo. #* Overview of general optimization algo-s (example: linear & nonlin. least-squares) #* Numerical integration (scripted, plus gnu ODE) #* Communication (how HTTP get/put works) # Data Structures #* Linked Lists #* Trees (file system hierarchies) #* Graphs #* Arrays (dense & sparse) example: vectors & rotations / transpositions, densities and difference operators # Presentation & visualization #* Flat CSV files (and excel) #* Working with binary data #* Python matplotlib (2D images) #* Binning histograms & weighted averages # Best Practices #* High-level code design (modularity, interface specifications, unit testing, etc.) #* Code audit: open-source libraries, ex. Gnu Scientific Library, qsort in libc, Boost #* Source code versioning (example: git or mercurial) #* gdb & execution profiling #* documentation #* Makefiles === Notes & Homework === * [[CompSciWeek1]] cf98f2289f0512dffd2c25f90a69cbe166384b2d 169 161 2014-09-01T15:56:52Z David M. Rogers 2 /* Notes & Homework */ wikitext text/x-wiki '''<BIG>Introduction to Scientific Computing</BIG>''' Course Info * Course Numbers CHM 4932/6938, CRN: 94314 * Credit Hours: 3 * Meeting Dates: Aug. 25 - Dec. 3, 2014 ** No Class Sept. 1 and Nov. 28 * Meeting Times: Mon. and Wed., 12:30-13:45 in SCA 222 ** Lab Session & Office Hours: Fri. 12:30-13:45 in SCA 222 * Assignments: ** [[#Notes & Homework|Weekly Homework]] (60%) ** Midterm Project (20%) *** Topic by Friday, Sept. 16 *** due Friday, Oct. 17, 2014 ** Final Project (20%) *** Topic by Friday, Nov. 14 *** due Friday, Dec. 5, 2014 == Overview == Mathematical models in the natural sciences take many shapes and forms. The moment they become more complicated than tracking a few variables over time, we have to put away our Excel spreadsheets and make use of a solid foundation in computational science. The course establishes this foundation by introducing data structures and algorithms used in everyday scientific computing using examples in the python scripting language. By the end of the Semester, students will be able to navigate the Linux command-line to go from a mathematical model to a numerical solution. Best practices for working with computer code and visualizing data will also be covered. == Textbooks == * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-0072-7 Beginning Python, Hetland, 2005] (eBook avail. from USF Library) * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-3238-4 Python Algorithms, Hetland, 2010] (eBook avail. from USF Library) * [http://aosabook.org/en/index.html The Architecture of Open Source Applications] Other (possibly useful) materials: * Chapters 7&8 of Modelling and Simulation, Birta and Arbez, Springer 2007 (eBook avail. from USF Library). * Chapters 4-6 of Models and Algorithms for Intelligent Data Analysis, Runkler, Springer 2012 (eBook avail. from USF Library). * Guide to Scientific Computing in C++, Francis and Whiteley, Springer, 2012. (eBook avail. from USF Library) * Extra info. On the basics: ** Chapters 3 and 7 of Mathematics in Computing, Regan, Springer 2013. (eBook avail. from USF Library) ** Instant feedback graphical programming with [https://www.khanacademy.org/cs/programming/ Khan Academy] == Topics == # Languages #* bash (shell) #* python (scripting) #* stack & register-based machine languages: overview of C and Fortran syntax & compiling with gcc, ‘thread safety’ #* Shared libraries & language inter-operability (FFI) # Algorithms #* Horner’s algorithm for polynomials #* Newton’s root finding algo. #* Overview of general optimization algo-s (example: linear & nonlin. least-squares) #* Numerical integration (scripted, plus gnu ODE) #* Communication (how HTTP get/put works) # Data Structures #* Linked Lists #* Trees (file system hierarchies) #* Graphs #* Arrays (dense & sparse) example: vectors & rotations / transpositions, densities and difference operators # Presentation & visualization #* Flat CSV files (and excel) #* Working with binary data #* Python matplotlib (2D images) #* Binning histograms & weighted averages # Best Practices #* High-level code design (modularity, interface specifications, unit testing, etc.) #* Code audit: open-source libraries, ex. Gnu Scientific Library, qsort in libc, Boost #* Source code versioning (example: git or mercurial) #* gdb & execution profiling #* documentation #* Makefiles === Notes & Homework === * [[CompSciWeek1]] * [[CompSciWeek2]] * [[CompSciWeek3]] * [[CompSciWeek4]] 5ca77eedbb48b029f6213881ee3846cb68be4440 174 169 2014-09-02T22:00:06Z David M. Rogers 2 wikitext text/x-wiki '''<BIG>Introduction to Scientific Computing</BIG>''' Course Info * Course Numbers CHM 4932/6938, CRN: 94314 * Credit Hours: 3 * Meeting Dates: Aug. 25 - Dec. 3, 2014 ** No Class Sept. 1 and Nov. 28 * Meeting Times: Mon. and Wed., 12:30-13:45 in SCA 222 ** Lab Session & Office Hours: Fri. 12:30-13:45 in SCA 222 * Assignments: ** [[#Notes & Homework|Weekly Homework]] (60%) ** Midterm Project (20%) *** Topic by Friday, Sept. 16 *** due Friday, Oct. 17, 2014 ** Final Project (20%) *** Topic by Friday, Nov. 14 *** due Friday, Dec. 5, 2014 == Overview == Mathematical models in the natural sciences take many shapes and forms. The moment they become more complicated than tracking a few variables over time, we have to put away our Excel spreadsheets and make use of a solid foundation in computational science. The course establishes this foundation by introducing data structures and algorithms used in everyday scientific computing using examples in the python scripting language. By the end of the Semester, students will be able to navigate the Linux command-line to go from a mathematical model to a numerical solution. Best practices for working with computer code and visualizing data will also be covered. == Textbooks == * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-0072-7 Beginning Python, Hetland, 2005] (eBook avail. from USF Library) * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-3238-4 Python Algorithms, Hetland, 2010] (eBook avail. from USF Library) * [http://aosabook.org/en/index.html The Architecture of Open Source Applications] Other (possibly useful) materials: * Chapters 7&8 of Modelling and Simulation, Birta and Arbez, Springer 2007 (eBook avail. from USF Library). * Chapters 4-6 of Models and Algorithms for Intelligent Data Analysis, Runkler, Springer 2012 (eBook avail. from USF Library). * Guide to Scientific Computing in C++, Francis and Whiteley, Springer, 2012. (eBook avail. from USF Library) * Extra info. On the basics: ** Chapters 3 and 7 of Mathematics in Computing, Regan, Springer 2013. (eBook avail. from USF Library) ** Instant feedback graphical programming with [https://www.khanacademy.org/cs/programming/ Khan Academy] * [http://www.meetup.com/python-178/ Local PyBulls Meetings] == Topics == # Languages #* bash (shell) #* python (scripting) #* stack & register-based machine languages: overview of C and Fortran syntax & compiling with gcc, ‘thread safety’ #* Shared libraries & language inter-operability (FFI) # Algorithms #* Horner’s algorithm for polynomials #* Newton’s root finding algo. #* Overview of general optimization algo-s (example: linear & nonlin. least-squares) #* Numerical integration (scripted, plus gnu ODE) #* Communication (how HTTP get/put works) # Data Structures #* Linked Lists #* Trees (file system hierarchies) #* Graphs #* Arrays (dense & sparse) example: vectors & rotations / transpositions, densities and difference operators # Presentation & visualization #* Flat CSV files (and excel) #* Working with binary data #* Python matplotlib (2D images) #* Binning histograms & weighted averages # Best Practices #* High-level code design (modularity, interface specifications, unit testing, etc.) #* Code audit: open-source libraries, ex. Gnu Scientific Library, qsort in libc, Boost #* Source code versioning (example: git or mercurial) #* gdb & execution profiling #* documentation #* Makefiles === Notes & Homework === * [[CompSciWeek1]] * [[CompSciWeek2]] * [[CompSciWeek3]] * [[CompSciWeek4]] f727db2af1980c40973ff02d356986d23e26b7a5 183 174 2014-09-10T02:18:33Z David M. Rogers 2 wikitext text/x-wiki '''<BIG>Introduction to Scientific Computing</BIG>''' Course Info * Course Numbers CHM 4932/6938, CRN: 94314 * Credit Hours: 3 * Meeting Dates: Aug. 25 - Dec. 3, 2014 ** No Class Sept. 1 and Nov. 28 * Meeting Times: Mon. and Wed., 12:30-13:45 in SCA 222 ** Lab Session & Office Hours: Fri. 12:30-13:45 in SCA 222 * Assignments: ** [[#Notes & Homework|Weekly Homework]] (60%) ** Midterm Project (20%) *** Topic by Friday, Sept. 19 *** due Friday, Oct. 17, 2014 ** Final Project (20%) *** Topic by Friday, Nov. 14 *** due Friday, Dec. 5, 2014 == Overview == Mathematical models in the natural sciences take many shapes and forms. The moment they become more complicated than tracking a few variables over time, we have to put away our Excel spreadsheets and make use of a solid foundation in computational science. The course establishes this foundation by introducing data structures and algorithms used in everyday scientific computing using examples in the python scripting language. By the end of the Semester, students will be able to navigate the Linux command-line to go from a mathematical model to a numerical solution. Best practices for working with computer code and visualizing data will also be covered. == Textbooks == * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-0072-7 Beginning Python, Hetland, 2005] (eBook avail. from USF Library) * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-3238-4 Python Algorithms, Hetland, 2010] (eBook avail. from USF Library) * [http://aosabook.org/en/index.html The Architecture of Open Source Applications] Other (possibly useful) materials: * Chapters 7&8 of Modelling and Simulation, Birta and Arbez, Springer 2007 (eBook avail. from USF Library). * Chapters 4-6 of Models and Algorithms for Intelligent Data Analysis, Runkler, Springer 2012 (eBook avail. from USF Library). * Guide to Scientific Computing in C++, Francis and Whiteley, Springer, 2012. (eBook avail. from USF Library) * Extra info. On the basics: ** Chapters 3 and 7 of Mathematics in Computing, Regan, Springer 2013. (eBook avail. from USF Library) ** Instant feedback graphical programming with [https://www.khanacademy.org/cs/programming/ Khan Academy] * [http://www.meetup.com/python-178/ Local PyBulls Meetings] == Topics == # Languages #* bash (shell) #* python (scripting) #* stack & register-based machine languages: overview of C and Fortran syntax & compiling with gcc, ‘thread safety’ #* Shared libraries & language inter-operability (FFI) # Algorithms #* Horner’s algorithm for polynomials #* Newton’s root finding algo. #* Overview of general optimization algo-s (example: linear & nonlin. least-squares) #* Numerical integration (scripted, plus gnu ODE) #* Communication (how HTTP get/put works) # Data Structures #* Linked Lists #* Trees (file system hierarchies) #* Graphs #* Arrays (dense & sparse) example: vectors & rotations / transpositions, densities and difference operators # Presentation & visualization #* Flat CSV files (and excel) #* Working with binary data #* Python matplotlib (2D images) #* Binning histograms & weighted averages # Best Practices #* High-level code design (modularity, interface specifications, unit testing, etc.) #* Code audit: open-source libraries, ex. Gnu Scientific Library, qsort in libc, Boost #* Source code versioning (example: git or mercurial) #* gdb & execution profiling #* documentation #* Makefiles === Notes & Homework === * [[CompSciWeek1]] * [[CompSciWeek2]] * [[CompSciWeek3]] * [[CompSciWeek4]] 0ab760c4ec3d84872c02613714cb7bd584b89b92 195 183 2014-09-18T17:19:27Z David M. Rogers 2 /* Textbooks */ wikitext text/x-wiki '''<BIG>Introduction to Scientific Computing</BIG>''' Course Info * Course Numbers CHM 4932/6938, CRN: 94314 * Credit Hours: 3 * Meeting Dates: Aug. 25 - Dec. 3, 2014 ** No Class Sept. 1 and Nov. 28 * Meeting Times: Mon. and Wed., 12:30-13:45 in SCA 222 ** Lab Session & Office Hours: Fri. 12:30-13:45 in SCA 222 * Assignments: ** [[#Notes & Homework|Weekly Homework]] (60%) ** Midterm Project (20%) *** Topic by Friday, Sept. 19 *** due Friday, Oct. 17, 2014 ** Final Project (20%) *** Topic by Friday, Nov. 14 *** due Friday, Dec. 5, 2014 == Overview == Mathematical models in the natural sciences take many shapes and forms. The moment they become more complicated than tracking a few variables over time, we have to put away our Excel spreadsheets and make use of a solid foundation in computational science. The course establishes this foundation by introducing data structures and algorithms used in everyday scientific computing using examples in the python scripting language. By the end of the Semester, students will be able to navigate the Linux command-line to go from a mathematical model to a numerical solution. Best practices for working with computer code and visualizing data will also be covered. == Textbooks == * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-0072-7 Beginning Python, Hetland, 2005] (eBook avail. from USF Library) * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-3238-4 Python Algorithms, Hetland, 2010] (eBook avail. from USF Library) * [http://aosabook.org/en/index.html The Architecture of Open Source Applications] * [http://docs.python.org Python Documentation] * [https://developers.google.com/edu/python/ Google Introductory Python Notes] Other (possibly useful) materials: * Chapters 7&8 of Modelling and Simulation, Birta and Arbez, Springer 2007 (eBook avail. from USF Library). * Chapters 4-6 of Models and Algorithms for Intelligent Data Analysis, Runkler, Springer 2012 (eBook avail. from USF Library). * Guide to Scientific Computing in C++, Francis and Whiteley, Springer, 2012. (eBook avail. from USF Library) * Extra info. On the basics: ** Chapters 3 and 7 of Mathematics in Computing, Regan, Springer 2013. (eBook avail. from USF Library) ** Instant feedback graphical programming with [https://www.khanacademy.org/cs/programming/ Khan Academy] * [http://www.meetup.com/python-178/ Local PyBulls Meetings] == Topics == # Languages #* bash (shell) #* python (scripting) #* stack & register-based machine languages: overview of C and Fortran syntax & compiling with gcc, ‘thread safety’ #* Shared libraries & language inter-operability (FFI) # Algorithms #* Horner’s algorithm for polynomials #* Newton’s root finding algo. #* Overview of general optimization algo-s (example: linear & nonlin. least-squares) #* Numerical integration (scripted, plus gnu ODE) #* Communication (how HTTP get/put works) # Data Structures #* Linked Lists #* Trees (file system hierarchies) #* Graphs #* Arrays (dense & sparse) example: vectors & rotations / transpositions, densities and difference operators # Presentation & visualization #* Flat CSV files (and excel) #* Working with binary data #* Python matplotlib (2D images) #* Binning histograms & weighted averages # Best Practices #* High-level code design (modularity, interface specifications, unit testing, etc.) #* Code audit: open-source libraries, ex. Gnu Scientific Library, qsort in libc, Boost #* Source code versioning (example: git or mercurial) #* gdb & execution profiling #* documentation #* Makefiles === Notes & Homework === * [[CompSciWeek1]] * [[CompSciWeek2]] * [[CompSciWeek3]] * [[CompSciWeek4]] 50267e84a4b4d1fdbb7221a67a4af68e9f915a4f 196 195 2014-09-18T17:22:57Z David M. Rogers 2 /* Notes & Homework */ wikitext text/x-wiki '''<BIG>Introduction to Scientific Computing</BIG>''' Course Info * Course Numbers CHM 4932/6938, CRN: 94314 * Credit Hours: 3 * Meeting Dates: Aug. 25 - Dec. 3, 2014 ** No Class Sept. 1 and Nov. 28 * Meeting Times: Mon. and Wed., 12:30-13:45 in SCA 222 ** Lab Session & Office Hours: Fri. 12:30-13:45 in SCA 222 * Assignments: ** [[#Notes & Homework|Weekly Homework]] (60%) ** Midterm Project (20%) *** Topic by Friday, Sept. 19 *** due Friday, Oct. 17, 2014 ** Final Project (20%) *** Topic by Friday, Nov. 14 *** due Friday, Dec. 5, 2014 == Overview == Mathematical models in the natural sciences take many shapes and forms. The moment they become more complicated than tracking a few variables over time, we have to put away our Excel spreadsheets and make use of a solid foundation in computational science. The course establishes this foundation by introducing data structures and algorithms used in everyday scientific computing using examples in the python scripting language. By the end of the Semester, students will be able to navigate the Linux command-line to go from a mathematical model to a numerical solution. Best practices for working with computer code and visualizing data will also be covered. == Textbooks == * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-0072-7 Beginning Python, Hetland, 2005] (eBook avail. from USF Library) * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-3238-4 Python Algorithms, Hetland, 2010] (eBook avail. from USF Library) * [http://aosabook.org/en/index.html The Architecture of Open Source Applications] * [http://docs.python.org Python Documentation] * [https://developers.google.com/edu/python/ Google Introductory Python Notes] Other (possibly useful) materials: * Chapters 7&8 of Modelling and Simulation, Birta and Arbez, Springer 2007 (eBook avail. from USF Library). * Chapters 4-6 of Models and Algorithms for Intelligent Data Analysis, Runkler, Springer 2012 (eBook avail. from USF Library). * Guide to Scientific Computing in C++, Francis and Whiteley, Springer, 2012. (eBook avail. from USF Library) * Extra info. On the basics: ** Chapters 3 and 7 of Mathematics in Computing, Regan, Springer 2013. (eBook avail. from USF Library) ** Instant feedback graphical programming with [https://www.khanacademy.org/cs/programming/ Khan Academy] * [http://www.meetup.com/python-178/ Local PyBulls Meetings] == Topics == # Languages #* bash (shell) #* python (scripting) #* stack & register-based machine languages: overview of C and Fortran syntax & compiling with gcc, ‘thread safety’ #* Shared libraries & language inter-operability (FFI) # Algorithms #* Horner’s algorithm for polynomials #* Newton’s root finding algo. #* Overview of general optimization algo-s (example: linear & nonlin. least-squares) #* Numerical integration (scripted, plus gnu ODE) #* Communication (how HTTP get/put works) # Data Structures #* Linked Lists #* Trees (file system hierarchies) #* Graphs #* Arrays (dense & sparse) example: vectors & rotations / transpositions, densities and difference operators # Presentation & visualization #* Flat CSV files (and excel) #* Working with binary data #* Python matplotlib (2D images) #* Binning histograms & weighted averages # Best Practices #* High-level code design (modularity, interface specifications, unit testing, etc.) #* Code audit: open-source libraries, ex. Gnu Scientific Library, qsort in libc, Boost #* Source code versioning (example: git or mercurial) #* gdb & execution profiling #* documentation #* Makefiles === Notes & Homework === * [[CompSciWeek1]] * [[CompSciWeek2]] * [[CompSciWeek3]] * [[CompSciWeek4]] * [[CompSciWeek5]] * [[CompSciWeek6]] * [[CompSciWeek7]] * [[CompSciWeek8]] 7995bdc16a86c9418834f4cfebee2e39af8b3c4e CompSciWeek1 0 41 162 160 2014-08-25T16:01:23Z David M. Rogers 2 /* Homework I */ wikitext text/x-wiki == Class 1 == # Pretest # Basic Shell Usage #* pwd, ls, directory structure # Access to Resources #* Logging into the lab computers #** Explanation of dual boot, OS evolution #* opening terminals, and terminals through terminals #* Logging into circe.rc.usf.edu #* Moving files #* Running python on your own machine #** Windows: Python Idle + easy_install () #** alt: Cygwin #** OSX / Linux: Package managers (OSX: fink, Debian (deb): apt-get, RH (RPM): yum) # First-order data types: #* int(1.1), float(-3), string(4) [essentially all languages] #* (and 2nd order) tuple([5]), list((6,)), dict([(6,7)]) [python-specific] == Class 2 == # What is a Turing machine? # The infinite loop and other control structures. # First algorithms (Horner, Euclid, Babylonian) # Code walk-through for a poorly designed Euclid''s algo. # The KISS, DRY, and incremental principles # Higher-order constructs: #* functions #* functional code == Homework I == This assignment will be due in 2 weeks, on Monday, Sept. 8. # Create a program that reads in strings with raw_input() until a string containing a single '.' is sent. After that, the program should print out the strings it has read in reverse order (hint: use list.pop()). # Implement the Babylonian/Hero''s method to approximate the square root of 2 using 10 iterations. Plot the error in the approximation against iteration number. Is there a good way to automatically guess when to stop iterating? # Imagine Bassetts Ice Cream has a data set of daily ice cream sales for 3 different flavors stretching back to 1893. Write pseudocode for an algorithm that finds the largest and smallest sales over daily, weekly, monthly, and yearly time-scales. Use steps like `add together 7 days sales` and `get the smallest number in the list`. If each test or addition step for each number takes 0.1 microseconds (10^-7 seconds), estimate how many microfortnights (1 microfortnight = 1.2096 s) the code will take to run? # Obfuscation challenge: Write (in the most complicated unreadable way you can stand) a code that prints out the first 20 or so prime numbers. The code is limited to 100 lines, cannot use external packages, and must always finish running in less than 1 minute. 202a02a1e9728492fab1737d702bc6ad2208d80e 163 162 2014-08-25T20:09:36Z David M. Rogers 2 wikitext text/x-wiki Required reading for this week is '''Beginning Python''', chapters 1-4. Be sure to try out the examples in python, not just read. == Class 1 == # Pretest # Basic Shell Usage #* pwd, ls, directory structure # Access to Resources #* Logging into the lab computers #** Explanation of dual boot, OS evolution #* opening terminals, and terminals through terminals #* Logging into circe.rc.usf.edu #* Moving files #* Running python on your own machine #** Windows: Python Idle + easy_install () #** alt: Cygwin #** OSX / Linux: Package managers (OSX: fink, Debian (deb): apt-get, RH (RPM): yum) # First-order data types: #* int(1.1), float(-3), string(4) [essentially all languages] #* (and 2nd order) tuple([5]), list((6,)), dict([(6,7)]) [python-specific] == Class 2 == # What is a Turing machine? # The infinite loop and other control structures. # First algorithms (Horner, Euclid, Babylonian) # Code walk-through for a poorly designed Euclid''s algo. # The KISS, DRY, and incremental principles # Higher-order constructs: #* functions #* functional code == Homework I == This assignment will be due in 2 weeks, on Monday, Sept. 8. # Create a program that reads in strings with raw_input() until a string containing a single '.' is sent. After that, the program should print out the strings it has read in reverse order (hint: use list.pop()). # Implement the Babylonian/Hero''s method to approximate the square root of 2 using 10 iterations. Plot the error in the approximation against iteration number. Is there a good way to automatically guess when to stop iterating? # Imagine Bassetts Ice Cream has a data set of daily ice cream sales for 3 different flavors stretching back to 1893. Write pseudocode for an algorithm that finds the largest and smallest sales over daily, weekly, monthly, and yearly time-scales. Use steps like `add together 7 days sales` and `get the smallest number in the list`. If each test or addition step for each number takes 0.1 microseconds (10^-7 seconds), estimate how many microfortnights (1 microfortnight = 1.2096 s) the code will take to run? # Obfuscation challenge: Write (in the most complicated unreadable way you can stand) a code that prints out the first 20 or so prime numbers. The code is limited to 100 lines, cannot use external packages, and must always finish running in less than 1 minute. 31d68c89cce8d65fa8730d555af0962ac0df217a 180 163 2014-09-05T21:25:36Z David M. Rogers 2 /* Homework I */ wikitext text/x-wiki Required reading for this week is '''Beginning Python''', chapters 1-4. Be sure to try out the examples in python, not just read. == Class 1 == # Pretest # Basic Shell Usage #* pwd, ls, directory structure # Access to Resources #* Logging into the lab computers #** Explanation of dual boot, OS evolution #* opening terminals, and terminals through terminals #* Logging into circe.rc.usf.edu #* Moving files #* Running python on your own machine #** Windows: Python Idle + easy_install () #** alt: Cygwin #** OSX / Linux: Package managers (OSX: fink, Debian (deb): apt-get, RH (RPM): yum) # First-order data types: #* int(1.1), float(-3), string(4) [essentially all languages] #* (and 2nd order) tuple([5]), list((6,)), dict([(6,7)]) [python-specific] == Class 2 == # What is a Turing machine? # The infinite loop and other control structures. # First algorithms (Horner, Euclid, Babylonian) # Code walk-through for a poorly designed Euclid''s algo. # The KISS, DRY, and incremental principles # Higher-order constructs: #* functions #* functional code == Homework I == This assignment will be due in 2 weeks, on Monday, Sept. 8. # Create a program that reads in strings with raw_input() until a string containing a single '.' is sent. After that, the program should print out the strings it has read in reverse order (hint: use list.pop()). # Implement the Babylonian/Hero''s method to approximate the square root of 2 using 10 iterations. Plot the error in the approximation against iteration number. Is there a good way to automatically guess when to stop iterating? # Imagine Bassetts Ice Cream has a data set of daily ice cream sales for 3 different flavors stretching back to 1893. Write pseudocode for an algorithm that finds the largest and smallest sales over daily, weekly, monthly, and yearly time-scales. Use steps like `add together 7 days sales` and `get the smallest number in the list`. If each test or addition step for each number takes 0.1 microseconds (10^-7 seconds), estimate how many microfortnights (1 microfortnight = 1.2096 s) the code will take to run? #* Edit 9/5/14 One final result should be output for each timescale. For the monthly timescale, for example, the result would be the (flavor, month number) pair with the highest and lowest numbers. -- Congrats to Christine McNiff for forcing a formal specification of the result. Ambiguities like this are a common source of conflict in programming ''vs.'' specifications... # Obfuscation challenge: Write (in the most complicated unreadable way you can stand) a code that prints out the first 20 or so prime numbers. The code is limited to 100 lines, cannot use external packages, and must always finish running in less than 1 minute. 459e1d8abdcb41c1bbce123aaa2fec9e028939c8 181 180 2014-09-05T21:27:59Z David M. Rogers 2 /* Homework I */ wikitext text/x-wiki Required reading for this week is '''Beginning Python''', chapters 1-4. Be sure to try out the examples in python, not just read. == Class 1 == # Pretest # Basic Shell Usage #* pwd, ls, directory structure # Access to Resources #* Logging into the lab computers #** Explanation of dual boot, OS evolution #* opening terminals, and terminals through terminals #* Logging into circe.rc.usf.edu #* Moving files #* Running python on your own machine #** Windows: Python Idle + easy_install () #** alt: Cygwin #** OSX / Linux: Package managers (OSX: fink, Debian (deb): apt-get, RH (RPM): yum) # First-order data types: #* int(1.1), float(-3), string(4) [essentially all languages] #* (and 2nd order) tuple([5]), list((6,)), dict([(6,7)]) [python-specific] == Class 2 == # What is a Turing machine? # The infinite loop and other control structures. # First algorithms (Horner, Euclid, Babylonian) # Code walk-through for a poorly designed Euclid''s algo. # The KISS, DRY, and incremental principles # Higher-order constructs: #* functions #* functional code == Homework I == This assignment will be due in 2 weeks, on Monday, Sept. 8. # Create a program that reads in strings with raw_input() until a string containing a single '.' is sent. After that, the program should print out the strings it has read in reverse order (hint: use list.pop()). # Implement the Babylonian/Hero''s method to approximate the square root of 2 using 10 iterations. Plot the error in the approximation against iteration number. Is there a good way to automatically guess when to stop iterating? #* Edit 9/5/14 A printed list of the error at each iteration can be included in place of a plot. # Imagine Bassetts Ice Cream has a data set of daily ice cream sales for 3 different flavors stretching back to 1893. Write pseudocode for an algorithm that finds the largest and smallest sales over daily, weekly, monthly, and yearly time-scales. Use steps like `add together 7 days sales` and `get the smallest number in the list`. If each test or addition step for each number takes 0.1 microseconds (10^-7 seconds), estimate how many microfortnights (1 microfortnight = 1.2096 s) the code will take to run? #* Edit 9/5/14 One final result should be output for each timescale. For the monthly timescale, for example, the result would be the (flavor, month number) pair with the highest and lowest numbers. -- Congrats to Christine McNiff for forcing a formal specification of the result. Ambiguities like this are a common source of conflict in programming ''vs.'' specifications... # Obfuscation challenge: Write (in the most complicated unreadable way you can stand) a code that prints out the first 20 or so prime numbers. The code is limited to 100 lines, cannot use external packages, and must always finish running in less than 1 minute. b43f93eb16c7eb13f15e75a68be53b68c81b5074 CompSciWeek2 0 42 164 2014-09-01T15:45:03Z David M. Rogers 2 Created page with "(Wed. only) Algorithms, Continued ===================== * Beginning Python, Chapter 5 * Algorithms, Chapters 1-3 ** ignore python 'Class' for now * Complexity notation, O(n), et…" wikitext text/x-wiki (Wed. only) Algorithms, Continued ===================== * Beginning Python, Chapter 5 * Algorithms, Chapters 1-3 ** ignore python 'Class' for now * Complexity notation, O(n), etc. * Loop Complexity * First algorithms (Horner, Euclid, Babylonian) * Code walk-through for a poorly designed Euclid''s algo. * The KISS, DRY, and incremental principles * Loading python modules 86303f3d28ed99c09dba805f620fcfb90b999f1d 165 164 2014-09-01T15:45:35Z David M. Rogers 2 wikitext text/x-wiki (Wed. only) == Algorithms, Continued == * Beginning Python, Chapter 5 * Algorithms, Chapters 1-3 ** ignore python 'Class' for now * Complexity notation, O(n), etc. * Loop Complexity * First algorithms (Horner, Euclid, Babylonian) * Code walk-through for a poorly designed Euclid''s algo. * The KISS, DRY, and incremental principles * Loading python modules 5a88bcdbd3f4f4728e2d801e58787b4fa5b66c35 166 165 2014-09-01T15:49:16Z David M. Rogers 2 wikitext text/x-wiki (Wed. only) == Reading Assignment == * Beginning Python, Chapter 5 * Algorithms, Chapters 1-3 == Algorithms, Continued == ** ignore python 'Class' for now * Complexity notation, O(n), etc. * Loop Complexity * First algorithms (Horner, Euclid, Babylonian) * Code walk-through for a poorly designed Euclid''s algo. * The KISS, DRY, and incremental principles * Loading python modules == Poorly Designed Euclid's Algo. == <source lang="python"> a = 1547 b = 224 while(1): if a < b: c = a a = b b = c a = a % b if a < b: c = a a = b b = c if a == 0: break print "%d, %d"%(a,b) print "The GCD of %d and %d is %d"%(a,b,b) </source> 7e79fa6af674af6b04282da89285708c2602ba85 167 166 2014-09-01T15:54:52Z David M. Rogers 2 /* Algorithms, Continued */ wikitext text/x-wiki (Wed. only) == Reading Assignment == * Beginning Python, Chapter 5 * Algorithms, Chapters 1-3 == Algorithms, Continued == * Complexity notation, O(n), etc. * Loop Complexity * First algorithms (Horner, Euclid, Babylonian) * Code walk-through for a poorly designed Euclid''s algo. * The KISS, DRY, and incremental principles * Loading python modules == Poorly Designed Euclid's Algo. == <source lang="python"> a = 1547 b = 224 while(1): if a < b: c = a a = b b = c a = a % b if a < b: c = a a = b b = c if a == 0: break print "%d, %d"%(a,b) print "The GCD of %d and %d is %d"%(a,b,b) </source> 8d0f9fb674a50b8d41a1edcee09b50ff3e5df485 168 167 2014-09-01T15:56:15Z David M. Rogers 2 /* Reading Assignment */ wikitext text/x-wiki (Wed. only) == Reading Assignment == * Beginning Python, Chapter 5 * Algorithms, Chapters 1-3 * ignore python 'Class' for now == Algorithms, Continued == * Complexity notation, O(n), etc. * Loop Complexity * First algorithms (Horner, Euclid, Babylonian) * Code walk-through for a poorly designed Euclid''s algo. * The KISS, DRY, and incremental principles * Loading python modules == Poorly Designed Euclid's Algo. == <source lang="python"> a = 1547 b = 224 while(1): if a < b: c = a a = b b = c a = a % b if a < b: c = a a = b b = c if a == 0: break print "%d, %d"%(a,b) print "The GCD of %d and %d is %d"%(a,b,b) </source> 92f422a2a96d77b06ab725013a5151771cc1b233 170 168 2014-09-01T16:00:35Z David M. Rogers 2 /* Reading Assignment */ wikitext text/x-wiki (Wed. only) == Reading Assignment == * Beginning Python, Chapter 5 == Algorithms, Continued == * Complexity notation, O(n), etc. * Loop Complexity * First algorithms (Horner, Euclid, Babylonian) * Code walk-through for a poorly designed Euclid''s algo. * The KISS, DRY, and incremental principles * Loading python modules == Poorly Designed Euclid's Algo. == <source lang="python"> a = 1547 b = 224 while(1): if a < b: c = a a = b b = c a = a % b if a < b: c = a a = b b = c if a == 0: break print "%d, %d"%(a,b) print "The GCD of %d and %d is %d"%(a,b,b) </source> 0a29e9776c5942910fd66e62f121ac7f1dca5848 193 170 2014-09-18T14:56:44Z David M. Rogers 2 wikitext text/x-wiki (Wed. only) == Reading Assignment == * Beginning Python, Chapter 5 == Algorithms, Continued == * Complexity notation, O(n), etc. * Loop Complexity * First algorithms (Horner, Euclid, Babylonian) * Code walk-through for a poorly designed Euclid''s algo. * The KISS, DRY, and incremental principles * Loading python modules == Poorly Designed Euclid's Algo. == <source lang="python"> a = 1547 b = 224 while(1): if a < b: c = a a = b b = c a = a % b if a < b: c = a a = b b = c if a == 0: break print "%d, %d"%(a,b) print "The GCD of %d and %d is %d"%(a,b,b) </source> == Improved Version == <source lang="python"> doc = """ Euclid's Algo.: reduce 7/30 - 8/18 30 = 6*5 18 = 6*3 (7*3 - 8*5)/(6*5*3) gcd(a,b) gcd(30,18) = 6 = gcd(18,12) = 6 = gcd(12,6) = gcd(6, 0) = 6 [termination] show: gcd(a, b) = gcd(b, a mod b) ... gcd(a, 0) = a write: a = s*u, b = t*u u also divides r = a % b = a - b*q = (s - q*t)*u Properties: (a + b) mod c = a % c + b % c a - b mod c = a mod c - b mod c (a*b) mod c = (a mod c) * (b mod c) a*(b/a) """ # always return a <= b def order(a, b): if a < b: return a, b else: # a >= b return b, a b = 1547 a = 224 # Input integer a, b # Output: integer gcd(a,b) def gcd(a, b): b, a = order(b, a) while b != 0: #print "%d, %d"%(a,b) a = a % b # a < b a, b = b, a return a r = gcd(a, b) str = "The GCD %d of %d and is %d "%(a, b, r) print str # subtracting numbers in quotient form def qsub((a, b), (c, d)): return (a*c -b*d), (c*d) </source> 3de5372a15b7f0e99650a49cc4a7f4e4f02b122a CompSciWeek3 0 43 171 2014-09-01T16:10:02Z David M. Rogers 2 Created page with "== Reading Assignment == * Algorithms, Chapters 1-2 ** focus on tree data structures (formal complexity next week) ** ignore python 'Class' for now = Class 1: Intermediate shell…" wikitext text/x-wiki == Reading Assignment == * Algorithms, Chapters 1-2 ** focus on tree data structures (formal complexity next week) ** ignore python 'Class' for now = Class 1: Intermediate shell utilities = * commands ** cat ** grep ** sort ** head / tail ** tr, sed ** find ** w, top, last * shell variables * control flow ** pipes, &&, || ** for loops = Class 2: Python vs. shell = * Reading / Writing Files * Advanced control structures (list comprehensions) * Code profiling * Hash tables * Graphs Homework 2 - due Monday, Sept. 15 ========== * Coding problems: ** Write a loop to sum 100 random numbers (import random, random.random()) using each of the following control structures: for, while, list and `tuple` comprehension. ** Write a shell loop to save 100 numbers from $RANDOM to a file, writing one number per line. ** Write a shell loop to sum files with 1 number per line. ** Write python and shell programs to print the smallest 10 numbers from such a file. ** Write a text processing script using sed to get the times from all the lines tagged "timing: 45.122" from the [[File:ex.dat|data file]] 7f811ba51400169f462f6d14e529b1eaa5d4a1ea 172 171 2014-09-01T16:10:28Z David M. Rogers 2 /* Class 2: Python vs. shell */ wikitext text/x-wiki == Reading Assignment == * Algorithms, Chapters 1-2 ** focus on tree data structures (formal complexity next week) ** ignore python 'Class' for now = Class 1: Intermediate shell utilities = * commands ** cat ** grep ** sort ** head / tail ** tr, sed ** find ** w, top, last * shell variables * control flow ** pipes, &&, || ** for loops = Class 2: Python vs. shell = * Reading / Writing Files * Advanced control structures (list comprehensions) * Code profiling * Hash tables * Graphs = Homework 2 - due Monday, Sept. 15 = * Coding problems: ** Write a loop to sum 100 random numbers (import random, random.random()) using each of the following control structures: for, while, list and `tuple` comprehension. ** Write a shell loop to save 100 numbers from $RANDOM to a file, writing one number per line. ** Write a shell loop to sum files with 1 number per line. ** Write python and shell programs to print the smallest 10 numbers from such a file. ** Write a text processing script using sed to get the times from all the lines tagged "timing: 45.122" from the [[File:ex.dat|data file]] eb7e3478951dc136348d99fa462c5bd85b77f822 175 172 2014-09-03T14:19:56Z David M. Rogers 2 /* Homework 2 - due Monday, Sept. 15 */ wikitext text/x-wiki == Reading Assignment == * Algorithms, Chapters 1-2 ** focus on tree data structures (formal complexity next week) ** ignore python 'Class' for now = Class 1: Intermediate shell utilities = * commands ** cat ** grep ** sort ** head / tail ** tr, sed ** find ** w, top, last * shell variables * control flow ** pipes, &&, || ** for loops = Class 2: Python vs. shell = * Reading / Writing Files * Advanced control structures (list comprehensions) * Code profiling * Hash tables * Graphs = Homework 2 - due Monday, Sept. 15 = * Coding problems: ** Write a loop to sum 100 random numbers (import random, random.random()) using each of the following control structures: for, while, list and `tuple` comprehension. ** Write a shell loop to save 100 numbers from $RANDOM to a file, writing one number per line. ** Write a shell loop to sum files with 1 number per line. ** Write python and shell programs to print the smallest 10 numbers from such a file. ** Write a text processing script using sed to get the numbers for the following quantities from [[File:ex.dat]] **# '''Basin electric monopole moment:''' (1 number for ea. line) **# '''Basin electric dipole moment:''' and '''Basin electron contribution to molecular dipole moment:''' (3 numbers from ea. line tagged X=, etc) 672cbee9b9f743cf90236d29521003137e63abab 176 175 2014-09-03T14:20:57Z David M. Rogers 2 /* Homework 2 - due Monday, Sept. 15 */ wikitext text/x-wiki == Reading Assignment == * Algorithms, Chapters 1-2 ** focus on tree data structures (formal complexity next week) ** ignore python 'Class' for now = Class 1: Intermediate shell utilities = * commands ** cat ** grep ** sort ** head / tail ** tr, sed ** find ** w, top, last * shell variables * control flow ** pipes, &&, || ** for loops = Class 2: Python vs. shell = * Reading / Writing Files * Advanced control structures (list comprehensions) * Code profiling * Hash tables * Graphs = Homework 2 - due Monday, Sept. 15 = * Coding problems: ** Write a loop to sum 100 random numbers (import random, random.random()) using each of the following control structures: for, while, list and `tuple` comprehension. ** Write a shell loop to save 100 numbers from $RANDOM to a file, writing one number per line. ** Write a shell loop to sum files with 1 number per line. ** Write python and shell programs to print the smallest 10 numbers from such a file. ** Write a text processing script using sed to get the numbers for the following quantities from [[File:multiwfn.out]] **# '''Basin electric monopole moment:''' (1 number for ea. line) **# '''Basin electric dipole moment:''' and '''Basin electron contribution to molecular dipole moment:''' (3 numbers from ea. line tagged X=, etc) 1960050a347504ea1b0a9136d34cdeda21479491 178 176 2014-09-03T14:22:44Z David M. Rogers 2 /* Homework 2 - due Monday, Sept. 15 */ wikitext text/x-wiki == Reading Assignment == * Algorithms, Chapters 1-2 ** focus on tree data structures (formal complexity next week) ** ignore python 'Class' for now = Class 1: Intermediate shell utilities = * commands ** cat ** grep ** sort ** head / tail ** tr, sed ** find ** w, top, last * shell variables * control flow ** pipes, &&, || ** for loops = Class 2: Python vs. shell = * Reading / Writing Files * Advanced control structures (list comprehensions) * Code profiling * Hash tables * Graphs = Homework 2 - due Monday, Sept. 15 = * Coding problems: ** Write a loop to sum 100 random numbers (import random, random.random()) using each of the following control structures: for, while, list and `tuple` comprehension. ** Write a shell loop to save 100 numbers from $RANDOM to a file, writing one number per line. ** Write a shell loop to sum files with 1 number per line. ** Write python and shell programs to print the smallest 10 numbers from such a file. ** Write a text processing script using sed to get the numbers for the following quantities from [[File:multiwfn.txt]] **# '''Basin electric monopole moment:''' (1 number for ea. line) **# '''Basin electric dipole moment:''' and '''Basin electron contribution to molecular dipole moment:''' (3 numbers from ea. line tagged X=, etc) 37e5c8be50b6318f89f5354964667cc397fd46a5 179 178 2014-09-03T14:34:46Z David M. Rogers 2 /* Reading Assignment */ wikitext text/x-wiki == Reading Assignment == * Beginning Python, Chapter 6 * Algorithms, Chapters 1-2 ** focus on tree data structures (formal complexity next week) ** ignore python 'Class' for now = Class 1: Intermediate shell utilities = * commands ** cat ** grep ** sort ** head / tail ** tr, sed ** find ** w, top, last * shell variables * control flow ** pipes, &&, || ** for loops = Class 2: Python vs. shell = * Reading / Writing Files * Advanced control structures (list comprehensions) * Code profiling * Hash tables * Graphs = Homework 2 - due Monday, Sept. 15 = * Coding problems: ** Write a loop to sum 100 random numbers (import random, random.random()) using each of the following control structures: for, while, list and `tuple` comprehension. ** Write a shell loop to save 100 numbers from $RANDOM to a file, writing one number per line. ** Write a shell loop to sum files with 1 number per line. ** Write python and shell programs to print the smallest 10 numbers from such a file. ** Write a text processing script using sed to get the numbers for the following quantities from [[File:multiwfn.txt]] **# '''Basin electric monopole moment:''' (1 number for ea. line) **# '''Basin electric dipole moment:''' and '''Basin electron contribution to molecular dipole moment:''' (3 numbers from ea. line tagged X=, etc) 7fba0926d5892cc6f178ec76533b9359a0e7ed3b 182 179 2014-09-08T16:29:30Z David M. Rogers 2 wikitext text/x-wiki == Reading Assignment == * Beginning Python, Chapter 6 * Algorithms, Chapters 1-2 ** focus on tree data structures (formal complexity next week) ** ignore python 'Class' for now = Class 1: Intermediate shell utilities = * commands ** man/info <-> help() ** ls <-> dir() ** cat <-> print ** grep <-> string.find() ** sort <-> list.sort() ** head / tail <-> list.__slice__ (i.e. l[:10]) ** tr, sed <-> string.replace() ** find ** w, top, last * shell variables * control flow ** shell functions -- f() { commands; } ** pipes, redirection, &&, || -- a | b, a && b, a || b ** for, while loops -- for i in 1 2 3; do ... done, for((i=0; i<$n; i++)); do ... done References: * [https://docs.python.org/3/ Python Syntax] * [http://tldp.org/HOWTO/Bash-Prog-Intro-HOWTO.html Bash Syntax] * [http://sed.sourceforge.net/sed1line.txt Sed One-Liners] = Class 2: Python vs. shell = * Reading / Writing Files * Advanced control structures (list comprehensions) * Code profiling * Hash tables * Graphs = Homework 2 - due Monday, Sept. 15 = * Coding problems: ** Write a loop to sum 100 random numbers (import random, random.random()) using each of the following control structures: for, while, list and `tuple` comprehension. ** Write a shell loop to save 100 numbers from $RANDOM to a file, writing one number per line. ** Write a shell loop to sum files with 1 number per line. ** Write python and shell programs to print the smallest 10 numbers from such a file. ** Write a text processing script using sed to get the numbers for the following quantities from [[File:multiwfn.txt]] **# '''Basin electric monopole moment:''' (1 number for ea. line) **# '''Basin electric dipole moment:''' and '''Basin electron contribution to molecular dipole moment:''' (3 numbers from ea. line tagged X=, etc) 3291ab3d0a4fc97e2195f51075eb7f66c974819b 185 182 2014-09-10T22:32:37Z David M. Rogers 2 /* Homework 2 - due Monday, Sept. 15 */ wikitext text/x-wiki == Reading Assignment == * Beginning Python, Chapter 6 * Algorithms, Chapters 1-2 ** focus on tree data structures (formal complexity next week) ** ignore python 'Class' for now = Class 1: Intermediate shell utilities = * commands ** man/info <-> help() ** ls <-> dir() ** cat <-> print ** grep <-> string.find() ** sort <-> list.sort() ** head / tail <-> list.__slice__ (i.e. l[:10]) ** tr, sed <-> string.replace() ** find ** w, top, last * shell variables * control flow ** shell functions -- f() { commands; } ** pipes, redirection, &&, || -- a | b, a && b, a || b ** for, while loops -- for i in 1 2 3; do ... done, for((i=0; i<$n; i++)); do ... done References: * [https://docs.python.org/3/ Python Syntax] * [http://tldp.org/HOWTO/Bash-Prog-Intro-HOWTO.html Bash Syntax] * [http://sed.sourceforge.net/sed1line.txt Sed One-Liners] = Class 2: Python vs. shell = * Reading / Writing Files * Advanced control structures (list comprehensions) * Code profiling * Hash tables * Graphs = Homework 2 - due Monday, Sept. 15 = * Coding problems: ** Write a loop to sum 100 random numbers (import random, random.random()) using each of the following control structures: for, while, list and `tuple` comprehension. ** Write a shell loop to save 100 numbers from $RANDOM to a file, writing one number per line. ** Write a shell loop to sum files with 1 number per line. ** Write python and shell programs to print the smallest 10 numbers from such a file. ** Write a text processing script using sed to get the numbers for the following quantities from [[File:multiwfn.txt]] **# '''Basin electric monopole moment:''' (1 number for ea. line) **# '''Basin electric dipole moment:''' and '''Basin electron contribution to molecular dipole moment:''' (3 numbers from ea. line tagged X=, etc) *** (Clarification) The output (if run) would be one file with all the "monopole" numbers, 1 per line, another with all the "dipole" numbers, 3 per line. I just want the code, not the output. 318ac614ac4318c2b93fb32c85bd47ac2417cad0 186 185 2014-09-10T22:35:16Z David M. Rogers 2 /* Homework 2 - due Monday, Sept. 15 */ wikitext text/x-wiki == Reading Assignment == * Beginning Python, Chapter 6 * Algorithms, Chapters 1-2 ** focus on tree data structures (formal complexity next week) ** ignore python 'Class' for now = Class 1: Intermediate shell utilities = * commands ** man/info <-> help() ** ls <-> dir() ** cat <-> print ** grep <-> string.find() ** sort <-> list.sort() ** head / tail <-> list.__slice__ (i.e. l[:10]) ** tr, sed <-> string.replace() ** find ** w, top, last * shell variables * control flow ** shell functions -- f() { commands; } ** pipes, redirection, &&, || -- a | b, a && b, a || b ** for, while loops -- for i in 1 2 3; do ... done, for((i=0; i<$n; i++)); do ... done References: * [https://docs.python.org/3/ Python Syntax] * [http://tldp.org/HOWTO/Bash-Prog-Intro-HOWTO.html Bash Syntax] * [http://sed.sourceforge.net/sed1line.txt Sed One-Liners] = Class 2: Python vs. shell = * Reading / Writing Files * Advanced control structures (list comprehensions) * Code profiling * Hash tables * Graphs = Homework 2 - due Monday, Sept. 15 = * Coding problems: ** Write a loop to sum 100 random numbers (import random, random.random()) using each of the following control structures: for, while, list and `tuple` comprehension. ** Write a shell loop to save 100 numbers from $RANDOM to a file, writing one number per line. ** Write a shell loop to sum files with 1 number per line. ** Write python and shell programs to print the smallest 10 numbers from such a file. ** Write a text processing script using sed to get the numbers for the following quantities from [[File:multiwfn.txt]] **# '''Basin electric monopole moment:''' (1 number for ea. line) **# '''Basin electric dipole moment:''' and '''Basin electron contribution to molecular dipole moment:''' (3 numbers from ea. line) The input is tagged X=, etc, the output should have only numbers. *** (Clarification) The output (if run) would be one file with all the "monopole" numbers, 1 per line, another with all the "dipole" numbers, 3 per line. I just want the code, not the output. 2e5da67a279f527dbb672e725f22dfe54054d617 187 186 2014-09-12T17:49:19Z David M. Rogers 2 /* Homework 2 - due Monday, Sept. 15 */ wikitext text/x-wiki == Reading Assignment == * Beginning Python, Chapter 6 * Algorithms, Chapters 1-2 ** focus on tree data structures (formal complexity next week) ** ignore python 'Class' for now = Class 1: Intermediate shell utilities = * commands ** man/info <-> help() ** ls <-> dir() ** cat <-> print ** grep <-> string.find() ** sort <-> list.sort() ** head / tail <-> list.__slice__ (i.e. l[:10]) ** tr, sed <-> string.replace() ** find ** w, top, last * shell variables * control flow ** shell functions -- f() { commands; } ** pipes, redirection, &&, || -- a | b, a && b, a || b ** for, while loops -- for i in 1 2 3; do ... done, for((i=0; i<$n; i++)); do ... done References: * [https://docs.python.org/3/ Python Syntax] * [http://tldp.org/HOWTO/Bash-Prog-Intro-HOWTO.html Bash Syntax] * [http://sed.sourceforge.net/sed1line.txt Sed One-Liners] = Class 2: Python vs. shell = * Reading / Writing Files * Advanced control structures (list comprehensions) * Code profiling * Hash tables * Graphs = Homework 2 - due Monday, Sept. 15 = * Coding problems: ** Write a loop to sum 100 random numbers (import random, random.random()) using each of the following control structures: for, while, list and `tuple` comprehension. The first two can generate numbers in the loop, the last two must create iterators / generators and can use the python builtin `sum' function. ** Write a shell loop to save 100 numbers from $RANDOM to a file, writing one number per line. ** Write a shell loop to sum files with 1 number per line. -- use shell math expressions, like a=$(($a*12)) ** Write python and shell programs to print the smallest 10 numbers from such a file. ** Write a text processing script using sed to get the numbers for the following quantities from [[File:multiwfn.txt]] **# '''Basin electric monopole moment:''' (1 number for ea. line) **# '''Basin electric dipole moment:''' and '''Basin electron contribution to molecular dipole moment:''' (3 numbers from ea. line) The input is tagged X=, etc, the output should have only numbers. *** (Clarification) The output (if run) would be one file with all the "monopole" numbers, 1 per line, another with all the "dipole" numbers, 3 per line. I just want the code, not the output. c93c7bec20f18ec2bfcf6991563ca9d47d3f1819 188 187 2014-09-12T17:50:09Z David M. Rogers 2 /* Homework 2 - due Monday, Sept. 15 */ wikitext text/x-wiki == Reading Assignment == * Beginning Python, Chapter 6 * Algorithms, Chapters 1-2 ** focus on tree data structures (formal complexity next week) ** ignore python 'Class' for now = Class 1: Intermediate shell utilities = * commands ** man/info <-> help() ** ls <-> dir() ** cat <-> print ** grep <-> string.find() ** sort <-> list.sort() ** head / tail <-> list.__slice__ (i.e. l[:10]) ** tr, sed <-> string.replace() ** find ** w, top, last * shell variables * control flow ** shell functions -- f() { commands; } ** pipes, redirection, &&, || -- a | b, a && b, a || b ** for, while loops -- for i in 1 2 3; do ... done, for((i=0; i<$n; i++)); do ... done References: * [https://docs.python.org/3/ Python Syntax] * [http://tldp.org/HOWTO/Bash-Prog-Intro-HOWTO.html Bash Syntax] * [http://sed.sourceforge.net/sed1line.txt Sed One-Liners] = Class 2: Python vs. shell = * Reading / Writing Files * Advanced control structures (list comprehensions) * Code profiling * Hash tables * Graphs = Homework 2 - due Monday, Sept. 15 = * Coding problems: ** Write a loop to sum 100 random numbers (import random, random.random()) using each of the following control structures: for, while, list and `tuple` comprehension. The first two can generate numbers in the loop, the last two must create iterators / generators and can use the python builtin `sum' function. ** Write a shell loop to save 100 numbers from $RANDOM to a file, writing one number per line. (hint: use the shell append re-direction, '''>>''' instead of the usual re-direction '''>''') ** Write a shell loop to sum files with 1 number per line. -- use shell math expressions, like a=$(($a*12)) ** Write python and shell programs to print the smallest 10 numbers from such a file. ** Write a text processing script using sed to get the numbers for the following quantities from [[File:multiwfn.txt]] **# '''Basin electric monopole moment:''' (1 number for ea. line) **# '''Basin electric dipole moment:''' and '''Basin electron contribution to molecular dipole moment:''' (3 numbers from ea. line) The input is tagged X=, etc, the output should have only numbers. *** (Clarification) The output (if run) would be one file with all the "monopole" numbers, 1 per line, another with all the "dipole" numbers, 3 per line. I just want the code, not the output. e47234b02ecbfe9b5eb6e52e445dc94ef413476a 191 188 2014-09-15T13:09:49Z David M. Rogers 2 /* Homework 2 - due Monday, Sept. 15 */ wikitext text/x-wiki == Reading Assignment == * Beginning Python, Chapter 6 * Algorithms, Chapters 1-2 ** focus on tree data structures (formal complexity next week) ** ignore python 'Class' for now = Class 1: Intermediate shell utilities = * commands ** man/info <-> help() ** ls <-> dir() ** cat <-> print ** grep <-> string.find() ** sort <-> list.sort() ** head / tail <-> list.__slice__ (i.e. l[:10]) ** tr, sed <-> string.replace() ** find ** w, top, last * shell variables * control flow ** shell functions -- f() { commands; } ** pipes, redirection, &&, || -- a | b, a && b, a || b ** for, while loops -- for i in 1 2 3; do ... done, for((i=0; i<$n; i++)); do ... done References: * [https://docs.python.org/3/ Python Syntax] * [http://tldp.org/HOWTO/Bash-Prog-Intro-HOWTO.html Bash Syntax] * [http://sed.sourceforge.net/sed1line.txt Sed One-Liners] = Class 2: Python vs. shell = * Reading / Writing Files * Advanced control structures (list comprehensions) * Code profiling * Hash tables * Graphs = Homework 2 - due Tuesday, Sept. 16 = Since the due date was pushed back, re-submitted homework will be accepted in place of the original. As a reminder, all homework must be done on your own. Send the homework as a single txt file attachment with the subject line "Sci Comp HW2". If you send a pdf, format it using the script [[Code:text2pdf]]. * Coding problems: ** Write a loop to sum 100 random numbers (import random, random.random()) using each of the following control structures: for, while, list and `tuple` comprehension. The first two can generate numbers in the loop, the last two must create iterators / generators and can use the python builtin `sum' function. ** Write a shell loop to save 100 numbers from $RANDOM to a file, writing one number per line. (hint: use the shell append re-direction, '''>>''' instead of the usual re-direction '''>''') ** Write a shell loop to sum files with 1 number per line. -- use shell math expressions, like a=$(($a*12)) ** Write python and shell programs to print the smallest 10 numbers from such a file. ** Write a text processing script using sed to get the numbers for the following quantities from [[File:multiwfn.txt]] **# '''Basin electric monopole moment:''' (1 number for ea. line) **# '''Basin electric dipole moment:''' and '''Basin electron contribution to molecular dipole moment:''' (3 numbers from ea. line) The input is tagged X=, etc, the output should have only numbers. *** (Clarification) The output (if run) would be one file with all the "monopole" numbers, 1 per line, another with all the "dipole" numbers, 3 per line. I just want the code, not the output. c391ba575e17ff03213a315e8686bc1902b1e52f CompSciWeek4 0 44 173 2014-09-01T16:11:57Z David M. Rogers 2 Created page with "= Reading Assignment = * Algorithms, Chapter 2-3 = Class 1: Formal Proofs = * Complexity Notation * Rules - state assumptions, use logical operations on assumptions * Modus Pone…" wikitext text/x-wiki = Reading Assignment = * Algorithms, Chapter 2-3 = Class 1: Formal Proofs = * Complexity Notation * Rules - state assumptions, use logical operations on assumptions * Modus Ponens - (a, a =>b) => b * Modus Tollens - [(a ^ b), ~a] => b * Contradiction - (a, ~a) => Yikes! ex. from 1+1 = 1, prove that I am the Pope. A: The Pope and I make 2, but 1+1 = 1, so I and the Pope are one and the same. ** Anything that proves a false statement is false. ** If a then False => ~a * Induction = Class 2: Using HPC Resources = * accessing binaries and libraries, using modules * using scratch space * submitting a job script * managing queued jobs * advanced scripting tips and tricks = Homework 3 - due Monday, Sept. 22 = * Check back later for problems 9f07fd3c327b0cced62041c8ff46383a1200ecc9 184 173 2014-09-10T10:28:45Z David M. Rogers 2 /* Homework 3 - due Monday, Sept. 22 */ wikitext text/x-wiki = Reading Assignment = * Algorithms, Chapter 2-3 = Class 1: Formal Proofs = * Complexity Notation * Rules - state assumptions, use logical operations on assumptions * Modus Ponens - (a, a =>b) => b * Modus Tollens - [(a ^ b), ~a] => b * Contradiction - (a, ~a) => Yikes! ex. from 1+1 = 1, prove that I am the Pope. A: The Pope and I make 2, but 1+1 = 1, so I and the Pope are one and the same. ** Anything that proves a false statement is false. ** If a then False => ~a * Induction = Class 2: Using HPC Resources = * accessing binaries and libraries, using modules * using scratch space * submitting a job script * managing queued jobs * advanced scripting tips and tricks = Homework 3 - due Monday, Sept. 22 = * Coding Problems ** Write a code to build a graph representation of what's inside the /usr/share/X11 directory on circe. Use (os.walk and/or os.listdir, os.path.join). **# How many directories are there total? **# What is the maximum depth, counting files and dirs so the depth of a dir with no files/subdirs = 0, and with any files/subdirs = 1? **# How many references are there to each directory -- node in-degree? (ignore symlinks) **# What is the maximum number of references from a directory (i.e. maximum out- degree)? * Problems from Algorithms in Python: ** 2-4 ** 2-7 (write and turn in a test code for each case mentioned) ** 2-10 ** 2-12 0de70d69a0395311882c30bf3437eaf287d7dc2f 192 184 2014-09-15T15:47:46Z David M. Rogers 2 /* Class 1: Formal Proofs */ wikitext text/x-wiki = Reading Assignment = * Algorithms, Chapter 2-3 = Class 1: Formal Proofs = * Complexity Notation * Rules - state assumptions, use logical operations on assumptions * Modus Ponens - (a, a =>b) => b * Modus Tollens - (a => b, ~b) => ~a * Disjunctive Syllogism - ((a v b), ~a) => b * Contradiction - (a, ~a) => Yikes! ex. from 1+1 = 1, prove that I am the Pope. A: The Pope and I make 2, but 1+1 = 1, so I and the Pope are one and the same. ** Anything that proves a false statement is false. ** If a then False => ~a * Induction = Class 2: Using HPC Resources = * accessing binaries and libraries, using modules * using scratch space * submitting a job script * managing queued jobs * advanced scripting tips and tricks = Homework 3 - due Monday, Sept. 22 = * Coding Problems ** Write a code to build a graph representation of what's inside the /usr/share/X11 directory on circe. Use (os.walk and/or os.listdir, os.path.join). **# How many directories are there total? **# What is the maximum depth, counting files and dirs so the depth of a dir with no files/subdirs = 0, and with any files/subdirs = 1? **# How many references are there to each directory -- node in-degree? (ignore symlinks) **# What is the maximum number of references from a directory (i.e. maximum out- degree)? * Problems from Algorithms in Python: ** 2-4 ** 2-7 (write and turn in a test code for each case mentioned) ** 2-10 ** 2-12 385981208bd42d13480887acf4c3bf4d7c8d68b1 194 192 2014-09-18T15:14:39Z David M. Rogers 2 wikitext text/x-wiki = Reading Assignment = * Algorithms, Chapter 2-3 = Class 1: Formal Proofs = * Complexity Notation * Rules - state assumptions, use logical operations on assumptions * Modus Ponens - (a, a =>b) => b * Modus Tollens - (a => b, ~b) => ~a * Disjunctive Syllogism - ((a v b), ~a) => b * Contradiction - (a, ~a) => Yikes! ex. from 1+1 = 1, prove that I am the Pope. A: The Pope and I make 2, but 1+1 = 1, so I and the Pope are one and the same. ** Anything that proves a false statement is false. ** If a then False => ~a * Induction = Class 2: Using HPC Resources = * accessing binaries and libraries, using modules * using scratch space * submitting a job script * managing queued jobs * advanced scripting tips and tricks == Profiling and Plotting Code == '''lib/ltime.py''' <source lang="python"> # Functions to time from random import random def lappend(n): l = [1]*n l.append(random()) def lmod(n): l = [1]*n l[0] = random() def make_list(n): l = [1]*n def rand(n): random() </source> Make sure that PYTHONPATH includes your '''lib''' directory (where ltime.py lives), e.g. PYTHONPATH=/usr/lib/python2.7/site-packages:$HOME/scicomp/lib '''time.sh''' <source lang="bash"> #!/bin/bash if [ $# -ne 1 ]; then echo "Usage: $0 <function name from ltime.py>" exit 1 fi cmd=$1 k=1 for((n=1;n<8;n++)); do echo -n "$k " python -m timeit -s"import ltime as m;" "m.$cmd($k)" | sed 's/.*[^0-9]\([0-9]*\.\)/\1/; s/ usec.*//;' k=$(($k*2)) done </source> '''analyze.py''' <source lang="python"> from numpy import * import sys, pylab assert len(sys.argv) == 2, "Usage: %s <function name>"%sys.argv[0] name = sys.argv[1] x = fromfile(name+".dat", sep=' ') x = reshape(x, (-1,2)) pylab.plot(x[:,0], x[:,1]) pylab.savefig(name+".png") </source> Both the shell and python scripts above have been modified from the version in class to show how to read command-line arguments. In the shell, the number of arguments is in the variable '''$#''', and the '''if''' statement checks for the right usage. '''$0''' is the program name and ''is not'' counted in '''$#'''. In python, the arguments are in the list, sys.argv, sys.argv[0] is the program name, and ''is'' counted in len(sys.argv). The '''assert''' statement checks for the right usage, and immediately terminates with an error (raises an AssertionError exception) if the assertion fails. = Homework 3 - due Monday, Sept. 22 = * Coding Problems ** Write a code to build a graph representation of what's inside the /usr/share/X11 directory on circe. Use (os.walk and/or os.listdir, os.path.join). **# How many directories are there total? **# What is the maximum depth, counting files and dirs so the depth of a dir with no files/subdirs = 0, and with any files/subdirs = 1? **# How many references are there to each directory -- node in-degree? (ignore symlinks) **# What is the maximum number of references from a directory (i.e. maximum out- degree)? * Problems from Algorithms in Python: ** 2-4 ** 2-7 (write and turn in a test code for each case mentioned) ** 2-10 ** 2-12 537d8fdd68e34629554e3587916b2372ff1fe3d1 200 194 2014-09-18T18:23:26Z David M. Rogers 2 /* Homework 3 - due Monday, Sept. 22 */ wikitext text/x-wiki = Reading Assignment = * Algorithms, Chapter 2-3 = Class 1: Formal Proofs = * Complexity Notation * Rules - state assumptions, use logical operations on assumptions * Modus Ponens - (a, a =>b) => b * Modus Tollens - (a => b, ~b) => ~a * Disjunctive Syllogism - ((a v b), ~a) => b * Contradiction - (a, ~a) => Yikes! ex. from 1+1 = 1, prove that I am the Pope. A: The Pope and I make 2, but 1+1 = 1, so I and the Pope are one and the same. ** Anything that proves a false statement is false. ** If a then False => ~a * Induction = Class 2: Using HPC Resources = * accessing binaries and libraries, using modules * using scratch space * submitting a job script * managing queued jobs * advanced scripting tips and tricks == Profiling and Plotting Code == '''lib/ltime.py''' <source lang="python"> # Functions to time from random import random def lappend(n): l = [1]*n l.append(random()) def lmod(n): l = [1]*n l[0] = random() def make_list(n): l = [1]*n def rand(n): random() </source> Make sure that PYTHONPATH includes your '''lib''' directory (where ltime.py lives), e.g. PYTHONPATH=/usr/lib/python2.7/site-packages:$HOME/scicomp/lib '''time.sh''' <source lang="bash"> #!/bin/bash if [ $# -ne 1 ]; then echo "Usage: $0 <function name from ltime.py>" exit 1 fi cmd=$1 k=1 for((n=1;n<8;n++)); do echo -n "$k " python -m timeit -s"import ltime as m;" "m.$cmd($k)" | sed 's/.*[^0-9]\([0-9]*\.\)/\1/; s/ usec.*//;' k=$(($k*2)) done </source> '''analyze.py''' <source lang="python"> from numpy import * import sys, pylab assert len(sys.argv) == 2, "Usage: %s <function name>"%sys.argv[0] name = sys.argv[1] x = fromfile(name+".dat", sep=' ') x = reshape(x, (-1,2)) pylab.plot(x[:,0], x[:,1]) pylab.savefig(name+".png") </source> Both the shell and python scripts above have been modified from the version in class to show how to read command-line arguments. In the shell, the number of arguments is in the variable '''$#''', and the '''if''' statement checks for the right usage. '''$0''' is the program name and ''is not'' counted in '''$#'''. In python, the arguments are in the list, sys.argv, sys.argv[0] is the program name, and ''is'' counted in len(sys.argv). The '''assert''' statement checks for the right usage, and immediately terminates with an error (raises an AssertionError exception) if the assertion fails. = Homework 3 - due Monday, Sept. 22 = * Coding Problems ** Write a code to build a graph representation of what's inside the /usr/share/X11 directory on circe. Use (os.walk and/or os.listdir, os.path.join). **# How many directories are there total? **# What is the maximum depth, counting files and dirs so the depth of a dir with no files/subdirs = 0, and with any files/subdirs = 1? **# How many references are there to each directory -- node in-degree? (ignore symlinks) **# What is the maximum number of references from a directory (i.e. maximum out- degree)? * Problems from Algorithms in Python: ** 2-4 (read the text definition of big-O notation) ** 2-7 (write and turn in a test code for each case mentioned -- see above) ** 2-10 *** The question describes a binary tree. Internal nodes are nodes with two children. Leaf nodes have no children. Try drawing some trees to get a sense of the answer for this one. ** 2-12 The idea of weighted edges is to add information to the graph, e.g. 42 steps between node u and node v. *** Specifically, explain how looking up children of a given node would work in this representation (how complicated is finding all children of node 'u'). 0fb2da7647c3e69df5b983668e311d806bc25878 201 200 2014-09-18T18:25:27Z David M. Rogers 2 /* Homework 3 - due Monday, Sept. 22 */ wikitext text/x-wiki = Reading Assignment = * Algorithms, Chapter 2-3 = Class 1: Formal Proofs = * Complexity Notation * Rules - state assumptions, use logical operations on assumptions * Modus Ponens - (a, a =>b) => b * Modus Tollens - (a => b, ~b) => ~a * Disjunctive Syllogism - ((a v b), ~a) => b * Contradiction - (a, ~a) => Yikes! ex. from 1+1 = 1, prove that I am the Pope. A: The Pope and I make 2, but 1+1 = 1, so I and the Pope are one and the same. ** Anything that proves a false statement is false. ** If a then False => ~a * Induction = Class 2: Using HPC Resources = * accessing binaries and libraries, using modules * using scratch space * submitting a job script * managing queued jobs * advanced scripting tips and tricks == Profiling and Plotting Code == '''lib/ltime.py''' <source lang="python"> # Functions to time from random import random def lappend(n): l = [1]*n l.append(random()) def lmod(n): l = [1]*n l[0] = random() def make_list(n): l = [1]*n def rand(n): random() </source> Make sure that PYTHONPATH includes your '''lib''' directory (where ltime.py lives), e.g. PYTHONPATH=/usr/lib/python2.7/site-packages:$HOME/scicomp/lib '''time.sh''' <source lang="bash"> #!/bin/bash if [ $# -ne 1 ]; then echo "Usage: $0 <function name from ltime.py>" exit 1 fi cmd=$1 k=1 for((n=1;n<8;n++)); do echo -n "$k " python -m timeit -s"import ltime as m;" "m.$cmd($k)" | sed 's/.*[^0-9]\([0-9]*\.\)/\1/; s/ usec.*//;' k=$(($k*2)) done </source> '''analyze.py''' <source lang="python"> from numpy import * import sys, pylab assert len(sys.argv) == 2, "Usage: %s <function name>"%sys.argv[0] name = sys.argv[1] x = fromfile(name+".dat", sep=' ') x = reshape(x, (-1,2)) pylab.plot(x[:,0], x[:,1]) pylab.savefig(name+".png") </source> Both the shell and python scripts above have been modified from the version in class to show how to read command-line arguments. In the shell, the number of arguments is in the variable '''$#''', and the '''if''' statement checks for the right usage. '''$0''' is the program name and ''is not'' counted in '''$#'''. In python, the arguments are in the list, sys.argv, sys.argv[0] is the program name, and ''is'' counted in len(sys.argv). The '''assert''' statement checks for the right usage, and immediately terminates with an error (raises an AssertionError exception) if the assertion fails. = Homework 3 - due Monday, Sept. 22 = * Coding Problems ** Write a code to build a graph representation of what's inside the /usr/share/X11 directory on circe. Use (os.walk and/or os.listdir, os.path.join). see example graph representation above! **# How many directories are there total? **# What is the maximum depth, counting files and dirs so the depth of a dir with no files/subdirs = 0, and with any files/subdirs = 1? **# How many references are there to each directory -- node in-degree? (ignore symlinks) **# What is the maximum number of references from a directory (i.e. maximum out- degree)? * Problems from Algorithms in Python: ** 2-4 (read the text definition of big-O notation) ** 2-7 (write and turn in a test code for each case mentioned -- see above) ** 2-10 *** The question describes a binary tree. Internal nodes are nodes with two children. Leaf nodes have no children. Try drawing some trees to get a sense of the answer for this one. ** 2-12 The idea of weighted edges is to add information to the graph, e.g. 42 steps between node u and node v. *** Specifically, explain how looking up children of a given node would work in this representation (how complicated is finding all children of node 'u'). be7b1dd2ead63b85734bc8aba73e28dd44ad6047 202 201 2014-09-18T18:29:07Z David M. Rogers 2 wikitext text/x-wiki = Reading Assignment = * Algorithms, Chapter 2-3 = Class 1: Formal Proofs = * Complexity Notation * Rules - state assumptions, use logical operations on assumptions * Modus Ponens - (a, a =>b) => b * Modus Tollens - (a => b, ~b) => ~a * Disjunctive Syllogism - ((a v b), ~a) => b * Contradiction - (a, ~a) => Yikes! ex. from 1+1 = 1, prove that I am the Pope. A: The Pope and I make 2, but 1+1 = 1, so I and the Pope are one and the same. ** Anything that proves a false statement is false. ** If a then False => ~a * Induction = Class 2: Code Profiling Examples = * Creating and loading a module * formatting the results as a flat text file * reading text files into arrays (numpy) and plotting (pylab) == Profiling and Plotting Code == '''lib/ltime.py''' <source lang="python"> # Functions to time from random import random def lappend(n): l = [1]*n l.append(random()) def lmod(n): l = [1]*n l[0] = random() def make_list(n): l = [1]*n def rand(n): random() </source> Make sure that PYTHONPATH includes your '''lib''' directory (where ltime.py lives), e.g. PYTHONPATH=/usr/lib/python2.7/site-packages:$HOME/scicomp/lib '''time.sh''' <source lang="bash"> #!/bin/bash if [ $# -ne 1 ]; then echo "Usage: $0 <function name from ltime.py>" exit 1 fi cmd=$1 k=1 for((n=1;n<8;n++)); do echo -n "$k " python -m timeit -s"import ltime as m;" "m.$cmd($k)" | sed 's/.*[^0-9]\([0-9]*\.\)/\1/; s/ usec.*//;' k=$(($k*2)) done </source> '''analyze.py''' <source lang="python"> from numpy import * import sys, pylab assert len(sys.argv) == 2, "Usage: %s <function name>"%sys.argv[0] name = sys.argv[1] x = fromfile(name+".dat", sep=' ') x = reshape(x, (-1,2)) pylab.plot(x[:,0], x[:,1]) pylab.savefig(name+".png") </source> Both the shell and python scripts above have been modified from the version in class to show how to read command-line arguments. In the shell, the number of arguments is in the variable '''$#''', and the '''if''' statement checks for the right usage. '''$0''' is the program name and ''is not'' counted in '''$#'''. In python, the arguments are in the list, sys.argv, sys.argv[0] is the program name, and ''is'' counted in len(sys.argv). The '''assert''' statement checks for the right usage, and immediately terminates with an error (raises an AssertionError exception) if the assertion fails. = Homework 3 - due Monday, Sept. 22 = * Coding Problems ** Write a code to build a graph representation of what's inside the /usr/share/X11 directory on circe. Use (os.walk and/or os.listdir, os.path.join). see [[Code:networkx|example graph representation]] **# How many directories are there total? **# What is the maximum depth, counting files and dirs so the depth of a dir with no files/subdirs = 0, and with any files/subdirs = 1? **# How many references are there to each directory -- node in-degree? (ignore symlinks) **# What is the maximum number of references from a directory (i.e. maximum out- degree)? * Problems from Algorithms in Python: ** 2-4 (read the text definition of big-O notation) ** 2-7 (write and turn in a test code for each case mentioned -- see above) ** 2-10 *** The question describes a binary tree. Internal nodes are nodes with two children. Leaf nodes have no children. Try drawing some trees to get a sense of the answer for this one. ** 2-12 The idea of weighted edges is to add information to the graph, e.g. 42 steps between node u and node v. *** Specifically, explain how looking up children of a given node would work in this representation (how complicated is finding all children of node 'u'). b30fb46b67562b5abdfe3b23eeecc2076bde5414 206 202 2014-09-18T19:34:43Z David M. Rogers 2 /* Homework 3 - due Monday, Sept. 22 */ wikitext text/x-wiki = Reading Assignment = * Algorithms, Chapter 2-3 = Class 1: Formal Proofs = * Complexity Notation * Rules - state assumptions, use logical operations on assumptions * Modus Ponens - (a, a =>b) => b * Modus Tollens - (a => b, ~b) => ~a * Disjunctive Syllogism - ((a v b), ~a) => b * Contradiction - (a, ~a) => Yikes! ex. from 1+1 = 1, prove that I am the Pope. A: The Pope and I make 2, but 1+1 = 1, so I and the Pope are one and the same. ** Anything that proves a false statement is false. ** If a then False => ~a * Induction = Class 2: Code Profiling Examples = * Creating and loading a module * formatting the results as a flat text file * reading text files into arrays (numpy) and plotting (pylab) == Profiling and Plotting Code == '''lib/ltime.py''' <source lang="python"> # Functions to time from random import random def lappend(n): l = [1]*n l.append(random()) def lmod(n): l = [1]*n l[0] = random() def make_list(n): l = [1]*n def rand(n): random() </source> Make sure that PYTHONPATH includes your '''lib''' directory (where ltime.py lives), e.g. PYTHONPATH=/usr/lib/python2.7/site-packages:$HOME/scicomp/lib '''time.sh''' <source lang="bash"> #!/bin/bash if [ $# -ne 1 ]; then echo "Usage: $0 <function name from ltime.py>" exit 1 fi cmd=$1 k=1 for((n=1;n<8;n++)); do echo -n "$k " python -m timeit -s"import ltime as m;" "m.$cmd($k)" | sed 's/.*[^0-9]\([0-9]*\.\)/\1/; s/ usec.*//;' k=$(($k*2)) done </source> '''analyze.py''' <source lang="python"> from numpy import * import sys, pylab assert len(sys.argv) == 2, "Usage: %s <function name>"%sys.argv[0] name = sys.argv[1] x = fromfile(name+".dat", sep=' ') x = reshape(x, (-1,2)) pylab.plot(x[:,0], x[:,1]) pylab.savefig(name+".png") </source> Both the shell and python scripts above have been modified from the version in class to show how to read command-line arguments. In the shell, the number of arguments is in the variable '''$#''', and the '''if''' statement checks for the right usage. '''$0''' is the program name and ''is not'' counted in '''$#'''. In python, the arguments are in the list, sys.argv, sys.argv[0] is the program name, and ''is'' counted in len(sys.argv). The '''assert''' statement checks for the right usage, and immediately terminates with an error (raises an AssertionError exception) if the assertion fails. = Homework 3 - due Monday, Sept. 22 = * Coding Problems ** Write a code to build a graph representation of what's inside the /usr/share/X11 directory on circe. Use (os.walk and/or os.listdir, os.path.join). see [[Code:networkx|example graph representation]] **# How many directories are there total? **# What is the maximum depth, counting files and dirs so the depth of a dir with no files/subdirs = 0, and with any files/subdirs = 1? **# How many references are there to each directory -- node in-degree? (ignore symlinks) **# What is the maximum number of references from a directory (i.e. maximum out- degree)? * Problems from Algorithms in Python: ** 2-4 (read the text definition of big-O notation) ** 2-7 (write and turn in a test code for each case mentioned -- see above) You should show the test function you used and write the answer to the question in big-O (or theta) notation, e.g. list append was tested with "def lappend(n): l = [1]*n; l.append(1);" and the append operation takes constant time, O(1). ** 2-10 *** The question describes a binary tree. Internal nodes are nodes with two children. Leaf nodes have no children. Try drawing some trees to get a sense of the answer for this one. ** 2-12 The idea of weighted edges is to add information to the graph, e.g. 42 steps between node u and node v. *** Specifically, explain how looking up children of a given node would work in this representation (how complicated is finding all children of node 'u'). 9441ea0da7f32c5e5efc2376c43d65d57a6dcf65 209 206 2014-09-22T16:06:17Z David M. Rogers 2 /* Homework 3 - due Monday, Sept. 22 */ wikitext text/x-wiki = Reading Assignment = * Algorithms, Chapter 2-3 = Class 1: Formal Proofs = * Complexity Notation * Rules - state assumptions, use logical operations on assumptions * Modus Ponens - (a, a =>b) => b * Modus Tollens - (a => b, ~b) => ~a * Disjunctive Syllogism - ((a v b), ~a) => b * Contradiction - (a, ~a) => Yikes! ex. from 1+1 = 1, prove that I am the Pope. A: The Pope and I make 2, but 1+1 = 1, so I and the Pope are one and the same. ** Anything that proves a false statement is false. ** If a then False => ~a * Induction = Class 2: Code Profiling Examples = * Creating and loading a module * formatting the results as a flat text file * reading text files into arrays (numpy) and plotting (pylab) == Profiling and Plotting Code == '''lib/ltime.py''' <source lang="python"> # Functions to time from random import random def lappend(n): l = [1]*n l.append(random()) def lmod(n): l = [1]*n l[0] = random() def make_list(n): l = [1]*n def rand(n): random() </source> Make sure that PYTHONPATH includes your '''lib''' directory (where ltime.py lives), e.g. PYTHONPATH=/usr/lib/python2.7/site-packages:$HOME/scicomp/lib '''time.sh''' <source lang="bash"> #!/bin/bash if [ $# -ne 1 ]; then echo "Usage: $0 <function name from ltime.py>" exit 1 fi cmd=$1 k=1 for((n=1;n<8;n++)); do echo -n "$k " python -m timeit -s"import ltime as m;" "m.$cmd($k)" | sed 's/.*[^0-9]\([0-9]*\.\)/\1/; s/ usec.*//;' k=$(($k*2)) done </source> '''analyze.py''' <source lang="python"> from numpy import * import sys, pylab assert len(sys.argv) == 2, "Usage: %s <function name>"%sys.argv[0] name = sys.argv[1] x = fromfile(name+".dat", sep=' ') x = reshape(x, (-1,2)) pylab.plot(x[:,0], x[:,1]) pylab.savefig(name+".png") </source> Both the shell and python scripts above have been modified from the version in class to show how to read command-line arguments. In the shell, the number of arguments is in the variable '''$#''', and the '''if''' statement checks for the right usage. '''$0''' is the program name and ''is not'' counted in '''$#'''. In python, the arguments are in the list, sys.argv, sys.argv[0] is the program name, and ''is'' counted in len(sys.argv). The '''assert''' statement checks for the right usage, and immediately terminates with an error (raises an AssertionError exception) if the assertion fails. = Homework 3 - due Monday, Sept. 29 = * Coding Problems ** Write a code to build a graph representation of what's inside the /usr/share/X11 directory on circe. Use (os.walk and/or os.listdir, os.path.join). see [[Code:networkx|example graph representation]] **# How many directories are there total? **# What is the maximum depth, counting files and dirs so the depth of a dir with no files/subdirs = 0, and with any files/subdirs = 1? **# How many references are there to each directory -- node in-degree? (ignore symlinks) **# What is the maximum number of references from a directory (i.e. maximum out- degree)? * Problems from Algorithms in Python: ** 2-4 (read the text definition of big-O notation) ** 2-7 (write and turn in a test code for each case mentioned -- see above) You should show the test function you used and write the answer to the question in big-O (or theta) notation, e.g. list append was tested with "def lappend(n): l = [1]*n; l.append(1);" and the append operation takes constant time, O(1). ** 2-10 *** The question describes a binary tree. Internal nodes are nodes with two children. Leaf nodes have no children. Try drawing some trees to get a sense of the answer for this one. ** 2-12 The idea of weighted edges is to add information to the graph, e.g. 42 steps between node u and node v. *** Specifically, explain how looking up children of a given node would work in this representation (how complicated is finding all children of node 'u'). 88fc77b9f9f951bb094b5159f6030a14b98ee38a File:Multiwfn.txt 6 45 177 2014-09-03T14:21:59Z David M. Rogers 2 wikitext text/x-wiki da39a3ee5e6b4b0d3255bfef95601890afd80709 Code 0 18 189 145 2014-09-15T13:01:21Z David M. Rogers 2 /* Templates */ wikitext text/x-wiki == Tutorials == When learning a new language, once you've memorized the words, you need to start conversing. Unfortunately, source code is not spoken. It's a stillborn language. One of the best ways to code well is to study and modify other, good code. For code, this means reading and tweaking tutorials first, then design patterns, then large-scale projects next. * [http://matt.might.net/articles/bash-by-example Bash By Example] * [http://docs.python.org/3/tutorial/datastructures.html Data Structures in Python] * [http://www.u.arizona.edu/~erdmann/mse350/topics/basic_linear_algebra.html Linear Algebra in Numpy] Remember that it's not enough to just read them. It's actually a positive waste of time. Rather, you have to do some run-tweak-run-debug development cycles with them. == C Libraries == With the exception of the standard libraries and the [http://www.gnu.org/software/gsl/ GNU Scientific Library], there are surprisingly few of these about. Here are some generics that we've implemented and are sharing under the GPL. Robust map and red/black tree code has recently been published to [https://github.com/frobnitzem?tab=repositories github]. == Python Libraries == === Geometric Algebra === The [http://www.predictivestatmech.org/code/galg.py Multivector] class implements geometric algebra using Python's operator overloading. It works with minimal space for any number of spatial dimensions, since it's not based on the matrix / spinor representation of Clifford algebra. Instead, it takes the basis blade approach recommended by Dorst, Fondijne, and Mann [http://www.geometricalgebra.net]. It's really just as easy as ordering all the basis vectors, and keeping track of the commutator (+/- <math>\hat 1</math>). == Templates == The real world has forms, computation has templates. Pick one up, fill in the blanks, and send it down the chute. * [[NWChem|NWChem Jobs]] * [[Code:SGE|SGE (USF Circe)]] * [[Code:text2pdf|Text conversion using text2pdf]] == Efficiencies == To chop a tree quickly, spend twice the time sharpening your axe. * [[Vimrc|vimrc files]] == Code Humor == Put this into your makefile: <source lang=bash> Clint\ Eastwood: myday echo "I feel great!" </source> dcae03134b16ef5fd70a64ff9cc115b1c0bb6e8f 205 189 2014-09-18T19:05:02Z David M. Rogers 2 /* Python Libraries */ wikitext text/x-wiki == Tutorials == When learning a new language, once you've memorized the words, you need to start conversing. Unfortunately, source code is not spoken. It's a stillborn language. One of the best ways to code well is to study and modify other, good code. For code, this means reading and tweaking tutorials first, then design patterns, then large-scale projects next. * [http://matt.might.net/articles/bash-by-example Bash By Example] * [http://docs.python.org/3/tutorial/datastructures.html Data Structures in Python] * [http://www.u.arizona.edu/~erdmann/mse350/topics/basic_linear_algebra.html Linear Algebra in Numpy] Remember that it's not enough to just read them. It's actually a positive waste of time. Rather, you have to do some run-tweak-run-debug development cycles with them. == C Libraries == With the exception of the standard libraries and the [http://www.gnu.org/software/gsl/ GNU Scientific Library], there are surprisingly few of these about. Here are some generics that we've implemented and are sharing under the GPL. Robust map and red/black tree code has recently been published to [https://github.com/frobnitzem?tab=repositories github]. == Python Libraries == * [[Code:networkx|Networkx]] a quick guide. === Geometric Algebra === The [http://www.predictivestatmech.org/code/galg.py Multivector] class implements geometric algebra using Python's operator overloading. It works with minimal space for any number of spatial dimensions, since it's not based on the matrix / spinor representation of Clifford algebra. Instead, it takes the basis blade approach recommended by Dorst, Fondijne, and Mann [http://www.geometricalgebra.net]. It's really just as easy as ordering all the basis vectors, and keeping track of the commutator (+/- <math>\hat 1</math>). == Templates == The real world has forms, computation has templates. Pick one up, fill in the blanks, and send it down the chute. * [[NWChem|NWChem Jobs]] * [[Code:SGE|SGE (USF Circe)]] * [[Code:text2pdf|Text conversion using text2pdf]] == Efficiencies == To chop a tree quickly, spend twice the time sharpening your axe. * [[Vimrc|vimrc files]] == Code Humor == Put this into your makefile: <source lang=bash> Clint\ Eastwood: myday echo "I feel great!" </source> 05380fc57894d0d19af6d000bbc33d7f3cf97f1e Code:text2pdf 0 46 190 2014-09-15T13:05:33Z David M. Rogers 2 Created page with "Here's a small shell script that uses the '''text2pdf''' utility (along with standard tr, sed, and fold utils) to create pdf documents from text file inputs. Note the ^==*, whic…" wikitext text/x-wiki Here's a small shell script that uses the '''text2pdf''' utility (along with standard tr, sed, and fold utils) to create pdf documents from text file inputs. Note the ^==*, which turns lines starting with '''= Name''' into clearly delimited sections. Tr and sed remove dos formatting and remove extra blank lines. <source lang="bash"> for i in *.txt; do name=`basename $i .txt` [ -s $name.pdf ] && continue echo $i >tmp cat $i | tr -d '\r' | sed -e '/^ *$/d; s/^==*\(.*\)/\ \ \ \ \ #=================== \1 ===================/;' | fold -w 80 -s >>tmp text2pdf -f "Courier" -s 12 -o $name.pdf tmp done rm -f tmp </source> 961c8ed3aa71fcd7138cc476d9719f5fa15c0f8a CompSciWeek5 0 47 197 2014-09-18T17:23:33Z David M. Rogers 2 Created page with "Reading: * Beginning Python, Chapters 7-8 * [http://www.aosabook.org/en/posa/working-with-big-data-in-bioinformatics.html Bioinformatics Code Design] = Class 1: Effective Design…" wikitext text/x-wiki Reading: * Beginning Python, Chapters 7-8 * [http://www.aosabook.org/en/posa/working-with-big-data-in-bioinformatics.html Bioinformatics Code Design] = Class 1: Effective Design = * Structured Code, Bioinformatics example from AOS Book * Code Testing * Source Code Versioning ** basic git = Class 2: Using HPC Resources = * Accessing binaries and libraries, using modules * Using scratch space * Submitting a job script * Managing queued jobs * Advanced scripting tips and tricks ** awk 1967b4406f70ce7d6d1af690d1633c044c87af9b 199 197 2014-09-18T18:11:10Z David M. Rogers 2 wikitext text/x-wiki Reading: * Beginning Python, Chapters 7-8 and 16 (on Testing) * [http://www.aosabook.org/en/posa/working-with-big-data-in-bioinformatics.html Bioinformatics Code Design] = Class 1: Effective Design = * Structured Code, Bioinformatics example from AOS Book * Code Testing * Source Code Versioning ** basic git = Class 2: Using HPC Resources = * Accessing binaries and libraries, using modules * Using scratch space * Submitting a job script * Managing queued jobs * Advanced scripting tips and tricks ** awk 7581bf1be4fcee79e74392c0407ec3b46ff79fff 210 199 2014-09-22T16:07:44Z David M. Rogers 2 /* Class 1: Effective Design */ wikitext text/x-wiki Reading: * Beginning Python, Chapters 7-8 and 16 (on Testing) * [http://www.aosabook.org/en/posa/working-with-big-data-in-bioinformatics.html Bioinformatics Code Design] = Class 1: Effective Design = * Code walk-through, parsing and using graphs * Structured Code, Bioinformatics example from AOS Book * Code Testing * Source Code Versioning ** basic git = Class 2: Using HPC Resources = * Accessing binaries and libraries, using modules * Using scratch space * Submitting a job script * Managing queued jobs * Advanced scripting tips and tricks ** awk e12d50ca9f3339078f5d29052b73ba4eb3f05dfb CompSciWeek6 0 48 198 2014-09-18T17:34:36Z David M. Rogers 2 Created page with "Reading: * Beginning Python - skim. chapters 8-14 (use as reference material) ** see expecially urlopen on p. 300, forks and threads on p. 304 * Beginning Python - Chapter 15 (We…" wikitext text/x-wiki Reading: * Beginning Python - skim. chapters 8-14 (use as reference material) ** see expecially urlopen on p. 300, forks and threads on p. 304 * Beginning Python - Chapter 15 (Web services) = Class 1: The Git Revision Control System = * Repository structure ** git clone, init ** examining git objects ** code branches, git branch, status, checkout * Version histories and diff-s ** git diff, patch * Working with remote repo-s ** git commit, pull, push = Class 2: Parallel Programming = * Parallel complexity - sum / min / max * Parallel caching * Eigenvalue computation - the "google" algo. * Web Services 153338e945f420d0d7d1758e2577ae63256337d3 Code:networkx 0 49 203 2014-09-18T19:01:36Z David M. Rogers 2 Created page with "The [https://networkx.github.io/ networkx] library is a great tool for quick graph operations in python put together by the wonderful folks at Los Alamos National Labs. It uses …" wikitext text/x-wiki The [https://networkx.github.io/ networkx] library is a great tool for quick graph operations in python put together by the wonderful folks at Los Alamos National Labs. It uses a representation based on dictionaries of dictionaries. A dictionary of sets is simpler, so I'll show that too. For both representations, each node is a dictionary key, and the value stores the names of its child nodes. So, a graph with nodes 1,2,3 connected in a triangle would look like: <source lang="python"> G = {1: {2,3}, 2: {1,3}, 3: {1,2} } # dict-of-sets G = {1: {2:1,3:1}, 2: {1:1,3:1}, 3: {1:1,2:1} } # dict-of-dicts </source> The '''{}''' notation means create a set. To test whether a node, '''u''' is parent to a node '''v''', we can just write, <source lang="python"> def is_child(G, u, v): return v in G[u] # both formats </source> To add a node to a tree, I would need to create a new key in the dictionary -- like so: <source lang="python"> def add_node(G, u): assert u not in G.keys() G[u] = set() # dict-of-sets G[u] = {} # dict-of-dicts </source> To put in parent-child edges, I have to add members to the right set, <source lang="python"> def add_children(G, u, kids): G[u] += kids # dict-of-set [G[u][k] = v for k,v in kids.iteritems()] # dict-of-dict # e.g. add_node(G, 4) add_children(G, 4, {1,2}) </source> This version of '''add_children''' makes a directed graph, since child to parent edges were not added. Amongst other things, networkx can visualize graphs: <source lang="python"> import matplotlib.pyplot as plt import networkx as nx nG=nx.from_dict_of_lists(G) # maybe works for dict-of-set nG=nx.from_dict_of_dicts(G) # for dict-of-dict nx.draw(nG) plt.show() </source> b1d7ff40865f2546e5e55687ac071c839ee67b33 204 203 2014-09-18T19:02:57Z David M. Rogers 2 wikitext text/x-wiki The [https://networkx.github.io/ networkx] library is a great tool for quick graph operations in python put together by the wonderful folks at Los Alamos National Labs. It uses a representation based on dictionaries of dictionaries. A dictionary of sets is simpler, so I'll show that too. For both representations, each node is a dictionary key, and the value stores the names of its child nodes. So, a graph with nodes 1,2,3 connected in a triangle would look like: <source lang="python"> G = {1: {2,3}, 2: {1,3}, 3: {1,2} } # dict-of-sets G = {1: {2:1,3:1}, 2: {1:1,3:1}, 3: {1:1,2:1} } # dict-of-dicts </source> The '''{1, 2, 3}''' notation means create a set, while '''{1:1, 2:2, 3:3}''' means create a dictionary. To test whether a node, '''u''' is parent to a node '''v''', we can just write, <source lang="python"> def is_child(G, u, v): return v in G[u] # both formats </source> To add a node to a tree, I would need to create a new key in the dictionary -- like so: <source lang="python"> def add_node(G, u): assert u not in G.keys() G[u] = set() # dict-of-sets G[u] = {} # dict-of-dicts </source> To put in parent-child edges, I have to add members to the right set, <source lang="python"> def add_children(G, u, kids): G[u] += kids # dict-of-set [G[u][k] = v for k,v in kids.iteritems()] # dict-of-dict # e.g. add_node(G, 4) add_children(G, 4, {1,2}) </source> This version of '''add_children''' makes a directed graph, since child to parent edges were not added. Amongst other things, networkx can visualize graphs: <source lang="python"> import matplotlib.pyplot as plt import networkx as nx nG=nx.from_dict_of_lists(G) # maybe works for dict-of-set nG=nx.from_dict_of_dicts(G) # for dict-of-dict nx.draw(nG) plt.show() </source> 0077c393429489b15729f739ae4e03d3dd790eb2 207 204 2014-09-19T21:45:50Z David M. Rogers 2 wikitext text/x-wiki The [https://networkx.github.io/ networkx] library is a great tool for quick graph operations in python put together by the wonderful folks at Los Alamos National Labs. It uses a representation based on dictionaries of dictionaries. A dictionary of sets is simpler, so I'll show that too. For both representations, each node is a dictionary key, and the value stores the names of its child nodes. So, a graph with nodes 1,2,3 connected in a triangle would look like: <source lang="python"> G = {1: {2,3}, 2: {1,3}, 3: {1,2} } # dict-of-sets G = {1: {2:1,3:1}, 2: {1:1,3:1}, 3: {1:1,2:1} } # dict-of-dicts </source> The '''{1, 2, 3}''' notation means create a set, while '''{1:1, 2:2, 3:3}''' means create a dictionary. To test whether a node, '''u''' is parent to a node '''v''', we can just write, <source lang="python"> def is_child(G, u, v): return v in G[u] # both formats </source> To add a node to a tree, I would need to create a new key in the dictionary -- like so: <source lang="python"> def add_node(G, u): assert u not in G G[u] = set() # dict-of-sets def add_node(G, u): assert u not in G G[u] = {} # dict-of-dicts </source> To put in parent-child edges, I have to add members to the right set, <source lang="python"> def add_children(G, u, kids): G[u] += kids # dict-of-set def add_children(G, u, kids): k,v in kids.iteritems(): # dict-of-dict G[u][k] = v # e.g. add_node(G, 4) add_children(G, 4, {1,2}) </source> This version of '''add_children''' makes a directed graph, since child to parent edges were not added. Amongst other things, networkx can visualize graphs: <source lang="python"> import matplotlib.pyplot as plt import networkx as nx nG=nx.from_dict_of_lists(G) # maybe works for dict-of-set nG=nx.from_dict_of_dicts(G) # for dict-of-dict nx.draw(nG) plt.show() </source> 1dca94a1472a193de32ebb7a2bde6f1e992d0977 Courses 0 16 208 154 2014-09-22T16:05:46Z David M. Rogers 2 /* Courses */ wikitext text/x-wiki Here's a list of courses with useful online materials: == Courses == * [[GradQuantumFall2013| USF Graduate Quantum Mechanics I]] * [[GradQuantumSpring2014| USF Graduate Quantum Mechanics II]] * [[CompSciFall2014|Introduction to Scientific Computing]] * [http://lambda-the-ultimate.org/classic/Courses.html Functional Programming] == Lecture Series == * [http://www.esqc.org/lectures European Summer School in Quantum Chemistry] == Tutorials == * [http://www.mathematica-journal.com/2012/02/evaluation-of-gaussian-molecular-integrals Evaluating Matrix Elements] * [http://www.haskell.org/tutorial/ Haskell] * [http://monads.haskell.cz/html/index.html Monads] * [http://www.yosefk.com/blog/my-history-with-forth-stack-machines.html The Forth Language] == Reference Material == * [http://dft.sandia.gov/Quest/DFT_codes.html List of DFT Codes] * [http://docs.python.org/3/tutorial/ Python Tutorial] * [http://www.nwchem-sw.org/index.php/Release62:NWChem_Documentation NWChem Documentation] * [http://www.ebi.ac.uk/pdbe-srv/pdbechem/ PDB Ligand Structures] 8d82b329acfb8108ab5b04b01ae56a842dc43d27 CompSciWeek7 0 50 211 2014-09-22T16:10:21Z David M. Rogers 2 Created page with "= Parallel programming examples = * Code walk-through parallel array analysis * walk-through mpi4py = Interfacing Python and C = * walk-through MPI interfaces from other languag…" wikitext text/x-wiki = Parallel programming examples = * Code walk-through parallel array analysis * walk-through mpi4py = Interfacing Python and C = * walk-through MPI interfaces from other languages * ctypes 04f5ef3833d25e5fc364156198a9b2f690b5033e 223 211 2014-09-29T15:07:32Z David M. Rogers 2 wikitext text/x-wiki = Reading (shared with Week 6) = * Beginning Python - skim. chapters 8-14 (use as reference material) ** see expecially urlopen on p. 300, forks and threads on p. 304 * Beginning Python - Chapter 15 (Web services) = Class 1: The Git Revision Control System = * Repository structure ** git clone, init ** examining git objects ** code branches, git branch, status, checkout * Version histories and diff-s ** git diff, patch * Working with remote repo-s ** git commit, pull, push = Class 2: Parallel Programming = * Parallel complexity - sum / min / max * Parallel caching * Eigenvalue computation - the "google" algo. * Web Services 68ff23d2b5d51767e21a6d7529ffab24bcd52974 239 223 2014-10-06T15:02:24Z David M. Rogers 2 /* Reading (shared with Week 6) */ wikitext text/x-wiki = Reading (shared with Week 6) = * Beginning Python - skim. chapters 8-14 (use as reference material) ** see especially urlopen on p. 300, forks and threads on p. 304 * Beginning Python - Chapter 15 (Web services) = Class 1: The Git Revision Control System = * Repository structure ** git clone, init ** examining git objects ** code branches, git branch, status, checkout * Version histories and diff-s ** git diff, patch * Working with remote repo-s ** git commit, pull, push = Class 2: Parallel Programming = * Parallel complexity - sum / min / max * Parallel caching * Eigenvalue computation - the "google" algo. * Web Services b6865858f1b3ef4411ee7028bec7d017395ca2a8 241 239 2014-10-06T20:43:50Z David M. Rogers 2 /* Class 1: The Git Revision Control System */ wikitext text/x-wiki = Reading (shared with Week 6) = * Beginning Python - skim. chapters 8-14 (use as reference material) ** see especially urlopen on p. 300, forks and threads on p. 304 * Beginning Python - Chapter 15 (Web services) = Class 1: The Git Revision Control System = * Repository structure ** git clone, init ** examining git objects ** code branches, git branch, status, checkout * Version histories and diff-s ** git diff, patch * Working with remote repo-s ** git commit, pull, push References (optional): * [https://github.com/git/git Git repository of git] * [http://git-scm.com/book/en/Git-Internals-Git-Objects Very Detailed Explanation of Internals] = Class 2: Parallel Programming = * Parallel complexity - sum / min / max * Parallel caching * Eigenvalue computation - the "google" algo. * Web Services 723d9359ad5415a71772531c3b2b72acf051fecb 242 241 2014-10-06T20:53:27Z David M. Rogers 2 /* Class 1: The Git Revision Control System */ wikitext text/x-wiki = Reading (shared with Week 6) = * Beginning Python - skim. chapters 8-14 (use as reference material) ** see especially urlopen on p. 300, forks and threads on p. 304 * Beginning Python - Chapter 15 (Web services) = Class 1: The Git Revision Control System = * Repository structure ** git clone, init ** examining git objects ** code branches, git branch, status, checkout * Version histories and diff-s ** git diff, patch * Working with remote repo-s ** git commit, pull, push References (optional): * [https://github.com/git/git Git repository of git] * [http://git-scm.com/book/en/Git-Internals-Git-Objects Very Detailed Explanation of Internals] Example git workflow: Starting up: <code lang="bash"> cd /path/to/source/dir git init # create the .git directory for storing git objects git add . # add all files in the current folder git rm -r --cached the_unversioned_dir # remove the_unversioned_dir from the staged files git commit -am "First commit" # perform the commit, saving the files into git </code> Alternate start-up: <code lang="bash"> cd /path/to/source/dir git clone https://github.com/git/git # create your own copy of a git tree </code> Reading status: <code lang="bash"> git status # check current directory against HEAD git branch # print a list of branches git diff <branchname> # see how branchname is different </code> Making changes: <code lang="bash"> git commit -am "A descriptive commit message." # save the current working state git checkout <branch> # switch to another (existing) branch git checkout -b <new_branch_name> # make a new branch </code> Repository to repository commands. If you used clone to start your project, these should "just work". If you didn't you have to use git remote. Follow the [http://gitref.org/remotes/ Gitref Docs] to do that. <code lang="bash> git pull # merge remote changes with current work. git push # push current changes to the remote server (this won't work unless you have permission to write there) </code> = Class 2: Parallel Programming = * Parallel complexity - sum / min / max * Parallel caching * Eigenvalue computation - the "google" algo. * Web Services 174091450665b3a2bc37c1476b71bb2cf0fb51ea 243 242 2014-10-06T20:54:12Z David M. Rogers 2 /* Class 1: The Git Revision Control System */ wikitext text/x-wiki = Reading (shared with Week 6) = * Beginning Python - skim. chapters 8-14 (use as reference material) ** see especially urlopen on p. 300, forks and threads on p. 304 * Beginning Python - Chapter 15 (Web services) = Class 1: The Git Revision Control System = * Repository structure ** git clone, init ** examining git objects ** code branches, git branch, status, checkout * Version histories and diff-s ** git diff, patch * Working with remote repo-s ** git commit, pull, push References (optional): * [https://github.com/git/git Git repository of git] * [http://git-scm.com/book/en/Git-Internals-Git-Objects Very Detailed Explanation of Internals] Example git workflow: Starting up: <source lang="bash"> cd /path/to/source/dir git init # create the .git directory for storing git objects git add . # add all files in the current folder git rm -r --cached the_unversioned_dir # remove the_unversioned_dir from the staged files git commit -am "First commit" # perform the commit, saving the files into git </source> Alternate start-up: <source lang="bash"> cd /path/to/source/dir git clone https://github.com/git/git # create your own copy of a git tree </source> Reading status: <source lang="bash"> git status # check current directory against HEAD git branch # print a list of branches git diff <branchname> # see how branchname is different </source> Making changes: <source lang="bash"> git commit -am "A descriptive commit message." # save the current working state git checkout <branch> # switch to another (existing) branch git checkout -b <new_branch_name> # make a new branch </source> Repository to repository commands. If you used clone to start your project, these should "just work". If you didn't you have to use git remote. Follow the [http://gitref.org/remotes/ Gitref Docs] to do that. <source lang="bash> git pull # merge remote changes with current work. git push # push current changes to the remote server (this won't work unless you have permission to write there) </source> = Class 2: Parallel Programming = * Parallel complexity - sum / min / max * Parallel caching * Eigenvalue computation - the "google" algo. * Web Services 95b185c0a0f462fc21dc17e89c53130cfabbbc0c 244 243 2014-10-06T20:54:58Z David M. Rogers 2 /* Class 1: The Git Revision Control System */ wikitext text/x-wiki = Reading (shared with Week 6) = * Beginning Python - skim. chapters 8-14 (use as reference material) ** see especially urlopen on p. 300, forks and threads on p. 304 * Beginning Python - Chapter 15 (Web services) = Class 1: The Git Revision Control System = * Repository structure ** git clone, init ** examining git objects ** code branches, git branch, status, checkout * Version histories and diff-s ** git diff, patch * Working with remote repo-s ** git commit, pull, push References (optional): * [https://github.com/git/git Git repository of git] * [http://git-scm.com/book/en/Git-Internals-Git-Objects Very Detailed Explanation of Internals] Example git workflow: Starting up: <source lang="bash"> cd /path/to/source/dir git init # create the .git directory for storing git objects git add . # add all files in the current folder git rm -r --cached the_unversioned_dir # remove the_unversioned_dir from the staged files git commit -am "First commit" # perform the commit, saving the files into git </source> Alternate start-up: <source lang="bash"> cd /path/to/source/dir git clone https://github.com/git/git # create your own copy of a git tree </source> Reading status: <source lang="bash"> git status # check current directory against HEAD git branch # print a list of branches git diff <branchname> # see how branchname is different </source> Making changes: <source lang="bash"> git commit -am "A descriptive commit message." # save the current working state git checkout <branch> # switch to another (existing) branch git checkout -b <new_branch_name> # make a new branch </source> Repository to repository commands. If you used clone to start your project, these should "just work". If you didn't you have to use git remote. Follow the [http://gitref.org/remotes/ Gitref Docs] to do that. <source lang="bash"> git pull # merge remote changes with current work. git push # push current changes to the remote server (this won't work unless you have permission to write there) </source> = Class 2: Parallel Programming = * Parallel complexity - sum / min / max * Parallel caching * Eigenvalue computation - the "google" algo. * Web Services 33ac9a52ad267535b7c297edb7e327c6353020e9 246 244 2014-10-13T16:12:14Z David M. Rogers 2 wikitext text/x-wiki = Reading (shared with Week 6) = * Beginning Python - skim. chapters 8-14 (use as reference material) ** see especially urlopen on p. 300, forks and threads on p. 304 * Beginning Python - Chapter 15 (Web services) = Class 1: The Git Revision Control System = * Repository structure ** git clone, init ** examining git objects ** code branches, git branch, status, checkout * Version histories and diff-s ** git diff, patch * Working with remote repo-s ** git commit, pull, push References (optional): * [https://github.com/git/git Git repository of git] * [http://git-scm.com/book/en/Git-Internals-Git-Objects Very Detailed Explanation of Internals] Example git workflow: Starting up: <source lang="bash"> cd /path/to/source/dir git init # create the .git directory for storing git objects git add . # add all files in the current folder git rm -r --cached the_unversioned_dir # remove the_unversioned_dir from the staged files git commit -am "First commit" # perform the commit, saving the files into git </source> Alternate start-up: <source lang="bash"> cd /path/to/source/dir git clone https://github.com/git/git # create your own copy of a git tree </source> Reading status: <source lang="bash"> git status # check current directory against HEAD git branch # print a list of branches git diff <branchname> # see how branchname is different </source> Making changes: <source lang="bash"> git commit -am "A descriptive commit message." # save the current working state git checkout <branch> # switch to another (existing) branch git checkout -b <new_branch_name> # make a new branch </source> Repository to repository commands. If you used clone to start your project, these should "just work". If you didn't you have to use git remote. Follow the [http://gitref.org/remotes/ Gitref Docs] to do that. <source lang="bash"> git pull # merge remote changes with current work. git push # push current changes to the remote server (this won't work unless you have permission to write there) </source> = Class 2: Parallel Programming = * Parallel complexity - sum / min / max * Parallel caching * Eigenvalue computation - the "google" algo. * Web Services = Binary Tree Code = <code lang="python"> class TreeNode: def __init__(self, left=None, right=None): self.left = left self.right = right def decode(G, addr): if G == None or len(addr) < 1: # base cases return G if addr[0] == '0': # inductive cases return G.left return G.right def decode_name(G, addr): res = decode(G, addr) return res.name # 'names' should be sorted on the first call, to make the tree balanced def create_tree(names): if len(names) == 0: # base cases return None if len(names) == 1: T = TreeNode() T.name = names[0] return T half = len(names)/2 return TreeNode(create_tree(names[:half]), create_tree(names[half:])) # inductive case # generate all codes as a list of (name, code) values # It returns the correct input format for dict(), to create a dictionary mapping names to codes. def get_codes(G): if G != None: if G.left == None and G.right == None: # base cases yield (G.name, "") else: for k,v in get_codes(G.left): # build up name structures yield (k, '0'+v) for k,v in get_codes(G.right): yield (k, '1'+v) </code> d29c98704c432749b233aadc65551d34935235fe 247 246 2014-10-13T16:17:03Z David M. Rogers 2 wikitext text/x-wiki = Reading (shared with Week 6) = * Beginning Python - skim. chapters 8-14 (use as reference material) ** see especially urlopen on p. 300, forks and threads on p. 304 * Beginning Python - Chapter 15 (Web services) = Class 1: The Git Revision Control System = * Repository structure ** git clone, init ** examining git objects ** code branches, git branch, status, checkout * Version histories and diff-s ** git diff, patch * Working with remote repo-s ** git commit, pull, push References (optional): * [https://github.com/git/git Git repository of git] * [http://git-scm.com/book/en/Git-Internals-Git-Objects Very Detailed Explanation of Internals] Example git workflow: Starting up: <source lang="bash"> cd /path/to/source/dir git init # create the .git directory for storing git objects git add . # add all files in the current folder git rm -r --cached the_unversioned_dir # remove the_unversioned_dir from the staged files git commit -am "First commit" # perform the commit, saving the files into git </source> Alternate start-up: <source lang="bash"> cd /path/to/source/dir git clone https://github.com/git/git # create your own copy of a git tree </source> Reading status: <source lang="bash"> git status # check current directory against HEAD git branch # print a list of branches git diff <branchname> # see how branchname is different </source> Making changes: <source lang="bash"> git commit -am "A descriptive commit message." # save the current working state git checkout <branch> # switch to another (existing) branch git checkout -b <new_branch_name> # make a new branch </source> Repository to repository commands. If you used clone to start your project, these should "just work". If you didn't you have to use git remote. Follow the [http://gitref.org/remotes/ Gitref Docs] to do that. <source lang="bash"> git pull # merge remote changes with current work. git push # push current changes to the remote server (this won't work unless you have permission to write there) </source> = Class 2: Parallel Programming = * Parallel complexity - sum / min / max * Parallel caching * Eigenvalue computation - the "google" algo. * Web Services = Binary Tree Code = <source lang="python"> class TreeNode: def __init__(self, left=None, right=None): self.left = left self.right = right def decode(G, addr): if G == None or len(addr) < 1: # base cases return G if addr[0] == '0': # inductive cases return decode(G.left, addr[1:]) return decode(G.right, addr[1:]) def decode_name(G, addr): res = decode(G, addr) return res.name # 'names' should be sorted on the first call, to make the tree balanced def create_tree(names): if len(names) == 0: # base cases return None if len(names) == 1: T = TreeNode() T.name = names[0] return T half = len(names)/2 return TreeNode(create_tree(names[:half]), create_tree(names[half:])) # inductive case # generate all codes as a list of (name, code) values # It returns the correct input format for dict(), to create a dictionary mapping names to codes. def get_codes(G): if G != None: if G.left == None and G.right == None: # base cases yield (G.name, "") else: for k,v in get_codes(G.left): # build up name structures yield (k, '0'+v) for k,v in get_codes(G.right): yield (k, '1'+v) </code> fc913531b695bd0a9533fe998713fe115aaafa84 248 247 2014-10-13T16:18:06Z David M. Rogers 2 /* Binary Tree Code */ wikitext text/x-wiki = Reading (shared with Week 6) = * Beginning Python - skim. chapters 8-14 (use as reference material) ** see especially urlopen on p. 300, forks and threads on p. 304 * Beginning Python - Chapter 15 (Web services) = Class 1: The Git Revision Control System = * Repository structure ** git clone, init ** examining git objects ** code branches, git branch, status, checkout * Version histories and diff-s ** git diff, patch * Working with remote repo-s ** git commit, pull, push References (optional): * [https://github.com/git/git Git repository of git] * [http://git-scm.com/book/en/Git-Internals-Git-Objects Very Detailed Explanation of Internals] Example git workflow: Starting up: <source lang="bash"> cd /path/to/source/dir git init # create the .git directory for storing git objects git add . # add all files in the current folder git rm -r --cached the_unversioned_dir # remove the_unversioned_dir from the staged files git commit -am "First commit" # perform the commit, saving the files into git </source> Alternate start-up: <source lang="bash"> cd /path/to/source/dir git clone https://github.com/git/git # create your own copy of a git tree </source> Reading status: <source lang="bash"> git status # check current directory against HEAD git branch # print a list of branches git diff <branchname> # see how branchname is different </source> Making changes: <source lang="bash"> git commit -am "A descriptive commit message." # save the current working state git checkout <branch> # switch to another (existing) branch git checkout -b <new_branch_name> # make a new branch </source> Repository to repository commands. If you used clone to start your project, these should "just work". If you didn't you have to use git remote. Follow the [http://gitref.org/remotes/ Gitref Docs] to do that. <source lang="bash"> git pull # merge remote changes with current work. git push # push current changes to the remote server (this won't work unless you have permission to write there) </source> = Class 2: Parallel Programming = * Parallel complexity - sum / min / max * Parallel caching * Eigenvalue computation - the "google" algo. * Web Services = Binary Tree Code = <source lang="python"> class TreeNode: def __init__(self, left=None, right=None): self.left = left self.right = right def decode(G, addr): if G == None or len(addr) < 1: # base cases return G if addr[0] == '0': # inductive cases return decode(G.left, addr[1:]) return decode(G.right, addr[1:]) def decode_name(G, addr): res = decode(G, addr) return res.name # 'names' should be sorted on the first call, to make the tree balanced def create_tree(names): if len(names) == 0: # base cases return None if len(names) == 1: T = TreeNode() T.name = names[0] return T half = len(names)/2 return TreeNode(create_tree(names[:half]), create_tree(names[half:])) # inductive case # generate all codes as a list of (name, code) values # It returns the correct input format for dict(), to create a dictionary mapping names to codes. def get_codes(G): if G != None: if G.left == None and G.right == None: # base cases yield (G.name, "") else: for k,v in get_codes(G.left): # build up name structures yield (k, '0'+v) for k,v in get_codes(G.right): yield (k, '1'+v) </source> e48d68c98df5b32775e5a64ca554a255c1b645c5 CompSciWeek5 0 47 212 210 2014-09-24T18:11:50Z David M. Rogers 2 wikitext text/x-wiki Reading: * Beginning Python, Chapters 7-8 and 16 (on Testing) * [http://www.aosabook.org/en/posa/working-with-big-data-in-bioinformatics.html Bioinformatics Code Design] = Class 1: Effective Design = * Code walk-through, parsing and using graphs * Structured Code, Bioinformatics example from AOS Book * Code Testing * Source Code Versioning ** basic git = Class 2: Using HPC Resources = * Accessing binaries and libraries, using modules * Using scratch space * Submitting a job script * Managing queued jobs * Advanced scripting tips and tricks ** awk = Example Codes = == Using Graphs == <source lang="python"> #!/usr/bin/env python from numpy import array, sum, reshape # input - list of names # - (3n)x 3 coordinate array # output - Graph G def make_G(names, x): assert x.shape[0]%3 == 0 assert x.shape[1] == 3 assert len(names) == len(x) print x.shape n = len(x)/3 G = {} D2 = sum((reshape(x, (1,3*n,3)) - reshape(x, (3*n,1,3)))**2, -1) print D2 # add bonds to G! for i,n in enumerate(names): print i,n G[i] = set() if n != 'O': continue for j,m in enumerate(names): print j,m if m != 'H': continue # all O-H distances, 1 at a time if D2[i,j] < 1.1: G[i].add(j) G[j].add(i) # Question for class: why does this cause an error? return G # input - list of names (1 O per 2 H-s) # - graph from atom number to atom numbers # output - list of atom numbers ordered O, H, H, O, H, H, ... def outp_graph(names, G): out = [] for i,n in enumerate(names): if n != "O": continue out.append(i) # 'O' number bonds = G[i] assert len(bonds) == 2, "Bad number (%d) of O-bonds."%(len(bonds)) for j in bonds: # 'H' numbers out.append(j) return out names = ['H', 'O', 'H', 'H', 'H', 'O'] x = array([[1,0,0],[0,0,0],[-1,0,0]]) G = make_G(names[:3], x) print G #G = {0:{1}, 1:{0,4, 1}, 2:{5}, 3:{5}, 4:{1}, 5:{2,3} } #l = outp_graph(names, G) #print l </source> 84cfce44dc8935dea629879bc550ebf4a8996784 221 212 2014-09-29T15:04:30Z David M. Rogers 2 wikitext text/x-wiki Reading: * Beginning Python, Chapters 7-8 and 16 (on Testing) * [http://www.aosabook.org/en/posa/working-with-big-data-in-bioinformatics.html Bioinformatics Code Design] = Class 1 and 2: Code walkthrough = * Structuring a list min/max problem over multiple timescales * Building and using a structured nearest neighbor graph = Example Codes = == List Min/Max == See [[CompSciWeek1]]. == Using Graphs == <source lang="python"> #!/usr/bin/env python from numpy import array, sum, reshape # input - list of names # - (3n)x 3 coordinate array # output - Graph G def make_G(names, x): assert x.shape[0]%3 == 0 assert x.shape[1] == 3 assert len(names) == len(x) print x.shape n = len(x)/3 G = {} D2 = sum((reshape(x, (1,3*n,3)) - reshape(x, (3*n,1,3)))**2, -1) print D2 # add bonds to G! for i,n in enumerate(names): print i,n G[i] = set() if n != 'O': continue for j,m in enumerate(names): print j,m if m != 'H': continue # all O-H distances, 1 at a time if D2[i,j] < 1.1: G[i].add(j) G[j].add(i) # Question for class: why does this cause an error? return G # input - list of names (1 O per 2 H-s) # - graph from atom number to atom numbers # output - list of atom numbers ordered O, H, H, O, H, H, ... def outp_graph(names, G): out = [] for i,n in enumerate(names): if n != "O": continue out.append(i) # 'O' number bonds = G[i] assert len(bonds) == 2, "Bad number (%d) of O-bonds."%(len(bonds)) for j in bonds: # 'H' numbers out.append(j) return out names = ['H', 'O', 'H', 'H', 'H', 'O'] x = array([[1,0,0],[0,0,0],[-1,0,0]]) G = make_G(names[:3], x) print G #G = {0:{1}, 1:{0,4, 1}, 2:{5}, 3:{5}, 4:{1}, 5:{2,3} } #l = outp_graph(names, G) #print l </source> 04b654b0a7b2ca59d986210693c85d12f95e8fee CompSciWeek1 0 41 213 181 2014-09-24T18:15:42Z David M. Rogers 2 /* Homework I */ wikitext text/x-wiki Required reading for this week is '''Beginning Python''', chapters 1-4. Be sure to try out the examples in python, not just read. == Class 1 == # Pretest # Basic Shell Usage #* pwd, ls, directory structure # Access to Resources #* Logging into the lab computers #** Explanation of dual boot, OS evolution #* opening terminals, and terminals through terminals #* Logging into circe.rc.usf.edu #* Moving files #* Running python on your own machine #** Windows: Python Idle + easy_install () #** alt: Cygwin #** OSX / Linux: Package managers (OSX: fink, Debian (deb): apt-get, RH (RPM): yum) # First-order data types: #* int(1.1), float(-3), string(4) [essentially all languages] #* (and 2nd order) tuple([5]), list((6,)), dict([(6,7)]) [python-specific] == Class 2 == # What is a Turing machine? # The infinite loop and other control structures. # First algorithms (Horner, Euclid, Babylonian) # Code walk-through for a poorly designed Euclid''s algo. # The KISS, DRY, and incremental principles # Higher-order constructs: #* functions #* functional code == Homework I == This assignment will be due in 2 weeks, on Monday, Sept. 8. # Create a program that reads in strings with raw_input() until a string containing a single '.' is sent. After that, the program should print out the strings it has read in reverse order (hint: use list.pop()). # Implement the Babylonian/Hero''s method to approximate the square root of 2 using 10 iterations. Plot the error in the approximation against iteration number. Is there a good way to automatically guess when to stop iterating? #* Edit 9/5/14 A printed list of the error at each iteration can be included in place of a plot. # Imagine Bassetts Ice Cream has a data set of daily ice cream sales for 3 different flavors stretching back to 1893. Write pseudocode for an algorithm that finds the largest and smallest sales over daily, weekly, monthly, and yearly time-scales. Use steps like `add together 7 days sales` and `get the smallest number in the list`. If each test or addition step for each number takes 0.1 microseconds (10^-7 seconds), estimate how many microfortnights (1 microfortnight = 1.2096 s) the code will take to run? #* Edit 9/5/14 One final result should be output for each timescale. For the monthly timescale, for example, the result would be the (flavor, month number) pair with the highest and lowest numbers. -- Congrats to Christine McNiff for forcing a formal specification of the result. Ambiguities like this are a common source of conflict in programming ''vs.'' specifications... # Obfuscation challenge: Write (in the most complicated unreadable way you can stand) a code that prints out the first 20 or so prime numbers. The code is limited to 100 lines, cannot use external packages, and must always finish running in less than 1 minute. Answer to Bassett's Ice Cream Problem (both pseudocode and code) <source lang="python> days = (2014-1893)*365.25 # for "starting this day in 1893" # 1. find max/min over days # 2. create weekly sums # - find max/min over weekly sums # 3. create monthly sums # - find max /min over monthly sums # 4. create yearly sums # - find max/min over yearly sum # combination! # 2-4: create sums over subsets # - find max/min over sum # this also covers 1 (with n = 1) # input - daily sales data array (days, 3) # - length scale (combined data size) # output min/max over subset #def subset_stat(sales, starts, extents): # 0, 31, 31+28, ... # run-time cost = f(L, n) = 3*L adds, 6*L/n comparisons # 3*L + 6/n *L = (3+6/n) * L -- linear time. def subset_stat(sales, n): L = len(sales) sub = [] for i in range(0, L, n): # loop over all subsets L/n y = sum(sales[i:i+n], 0) # access whole subset (n) sub.append(y) # L*3 additions sub = array(sub) # 6* L/n min/max return max(sub[:,0]), max(sub[:,1]), max(sub[:,2]), \ min(sub[:,0]), min(sub[:,1]), min(sub[:,2]) # max : [number] -> number subset_stat(sales, 1) subset_stat(sales, 7) subset_stat(sales, 30) subset_stat(sales, 365) </source> 9a24dfd370e1db5e1aace91ad24c313b90ca29ef 214 213 2014-09-24T18:15:58Z David M. Rogers 2 /* Homework I */ wikitext text/x-wiki Required reading for this week is '''Beginning Python''', chapters 1-4. Be sure to try out the examples in python, not just read. == Class 1 == # Pretest # Basic Shell Usage #* pwd, ls, directory structure # Access to Resources #* Logging into the lab computers #** Explanation of dual boot, OS evolution #* opening terminals, and terminals through terminals #* Logging into circe.rc.usf.edu #* Moving files #* Running python on your own machine #** Windows: Python Idle + easy_install () #** alt: Cygwin #** OSX / Linux: Package managers (OSX: fink, Debian (deb): apt-get, RH (RPM): yum) # First-order data types: #* int(1.1), float(-3), string(4) [essentially all languages] #* (and 2nd order) tuple([5]), list((6,)), dict([(6,7)]) [python-specific] == Class 2 == # What is a Turing machine? # The infinite loop and other control structures. # First algorithms (Horner, Euclid, Babylonian) # Code walk-through for a poorly designed Euclid''s algo. # The KISS, DRY, and incremental principles # Higher-order constructs: #* functions #* functional code == Homework I == This assignment will be due in 2 weeks, on Monday, Sept. 8. # Create a program that reads in strings with raw_input() until a string containing a single '.' is sent. After that, the program should print out the strings it has read in reverse order (hint: use list.pop()). # Implement the Babylonian/Hero''s method to approximate the square root of 2 using 10 iterations. Plot the error in the approximation against iteration number. Is there a good way to automatically guess when to stop iterating? #* Edit 9/5/14 A printed list of the error at each iteration can be included in place of a plot. # Imagine Bassetts Ice Cream has a data set of daily ice cream sales for 3 different flavors stretching back to 1893. Write pseudocode for an algorithm that finds the largest and smallest sales over daily, weekly, monthly, and yearly time-scales. Use steps like `add together 7 days sales` and `get the smallest number in the list`. If each test or addition step for each number takes 0.1 microseconds (10^-7 seconds), estimate how many microfortnights (1 microfortnight = 1.2096 s) the code will take to run? #* Edit 9/5/14 One final result should be output for each timescale. For the monthly timescale, for example, the result would be the (flavor, month number) pair with the highest and lowest numbers. -- Congrats to Christine McNiff for forcing a formal specification of the result. Ambiguities like this are a common source of conflict in programming ''vs.'' specifications... # Obfuscation challenge: Write (in the most complicated unreadable way you can stand) a code that prints out the first 20 or so prime numbers. The code is limited to 100 lines, cannot use external packages, and must always finish running in less than 1 minute. Answer to Bassett's Ice Cream Problem (both pseudocode and code) <source lang="python"> days = (2014-1893)*365.25 # for "starting this day in 1893" # 1. find max/min over days # 2. create weekly sums # - find max/min over weekly sums # 3. create monthly sums # - find max /min over monthly sums # 4. create yearly sums # - find max/min over yearly sum # combination! # 2-4: create sums over subsets # - find max/min over sum # this also covers 1 (with n = 1) # input - daily sales data array (days, 3) # - length scale (combined data size) # output min/max over subset #def subset_stat(sales, starts, extents): # 0, 31, 31+28, ... # run-time cost = f(L, n) = 3*L adds, 6*L/n comparisons # 3*L + 6/n *L = (3+6/n) * L -- linear time. def subset_stat(sales, n): L = len(sales) sub = [] for i in range(0, L, n): # loop over all subsets L/n y = sum(sales[i:i+n], 0) # access whole subset (n) sub.append(y) # L*3 additions sub = array(sub) # 6* L/n min/max return max(sub[:,0]), max(sub[:,1]), max(sub[:,2]), \ min(sub[:,0]), min(sub[:,1]), min(sub[:,2]) # max : [number] -> number subset_stat(sales, 1) subset_stat(sales, 7) subset_stat(sales, 30) subset_stat(sales, 365) </source> 740d061eb5e7ee28461699fea9139753eae1f58e 215 214 2014-09-24T18:17:44Z David M. Rogers 2 /* Homework I */ wikitext text/x-wiki Required reading for this week is '''Beginning Python''', chapters 1-4. Be sure to try out the examples in python, not just read. == Class 1 == # Pretest # Basic Shell Usage #* pwd, ls, directory structure # Access to Resources #* Logging into the lab computers #** Explanation of dual boot, OS evolution #* opening terminals, and terminals through terminals #* Logging into circe.rc.usf.edu #* Moving files #* Running python on your own machine #** Windows: Python Idle + easy_install () #** alt: Cygwin #** OSX / Linux: Package managers (OSX: fink, Debian (deb): apt-get, RH (RPM): yum) # First-order data types: #* int(1.1), float(-3), string(4) [essentially all languages] #* (and 2nd order) tuple([5]), list((6,)), dict([(6,7)]) [python-specific] == Class 2 == # What is a Turing machine? # The infinite loop and other control structures. # First algorithms (Horner, Euclid, Babylonian) # Code walk-through for a poorly designed Euclid''s algo. # The KISS, DRY, and incremental principles # Higher-order constructs: #* functions #* functional code == Homework I == This assignment will be due in 2 weeks, on Monday, Sept. 8. # Create a program that reads in strings with raw_input() until a string containing a single '.' is sent. After that, the program should print out the strings it has read in reverse order (hint: use list.pop()). # Implement the Babylonian/Hero''s method to approximate the square root of 2 using 10 iterations. Plot the error in the approximation against iteration number. Is there a good way to automatically guess when to stop iterating? #* Edit 9/5/14 A printed list of the error at each iteration can be included in place of a plot. # Imagine Bassetts Ice Cream has a data set of daily ice cream sales for 3 different flavors stretching back to 1893. Write pseudocode for an algorithm that finds the largest and smallest sales over daily, weekly, monthly, and yearly time-scales. Use steps like `add together 7 days sales` and `get the smallest number in the list`. If each test or addition step for each number takes 0.1 microseconds (10^-7 seconds), estimate how many microfortnights (1 microfortnight = 1.2096 s) the code will take to run? #* Edit 9/5/14 One final result should be output for each timescale. For the monthly timescale, for example, the result would be the (flavor, month number) pair with the highest and lowest numbers. -- Congrats to Christine McNiff for forcing a formal specification of the result. Ambiguities like this are a common source of conflict in programming ''vs.'' specifications... # Obfuscation challenge: Write (in the most complicated unreadable way you can stand) a code that prints out the first 20 or so prime numbers. The code is limited to 100 lines, cannot use external packages, and must always finish running in less than 1 minute. Answer to Bassett's Ice Cream Problem (both pseudocode and code) <source lang="python"> from numpy import * days = (2014-1893)*365.25 # for "starting this day in 1893" test_sales = (random.random((days,3))*10000).astype(int) # test data # 1. find max/min over days # 2. create weekly sums # - find max/min over weekly sums # 3. create monthly sums # - find max /min over monthly sums # 4. create yearly sums # - find max/min over yearly sum # combination! # 2-4: create sums over subsets # - find max/min over sum # this also covers 1 (with n = 1) # input - daily sales data array (days, 3) # - length scale (combined data size) # output min/max over subset #def subset_stat(sales, starts, extents): # 0, 31, 31+28, ... # run-time cost = f(L, n) = 3*L adds, 6*L/n comparisons # 3*L + 6/n *L = (3+6/n) * L -- linear time. def subset_stat(sales, n): L = len(sales) sub = [] for i in range(0, L, n): # loop over all subsets L/n y = sum(sales[i:i+n], 0) # access whole subset (n) sub.append(y) # L*3 additions sub = array(sub) # 6* L/n min/max return max(sub[:,0]), max(sub[:,1]), max(sub[:,2]), \ min(sub[:,0]), min(sub[:,1]), min(sub[:,2]) # max : [number] -> number subset_stat(test_sales, 1) subset_stat(test_sales, 7) subset_stat(test_sales, 30) subset_stat(test_sales, 365) </source> eaf32125dd4e14df3a07057b5b9f3e2a8bc6292d Silmaril 0 51 216 2014-09-26T13:55:23Z David M. Rogers 2 Created page with "The Silmaril programming language is built from the ground up for bleeding edge HPC. It has the following, fully automatic, killer features: * Git-like source code versioning * C…" wikitext text/x-wiki The Silmaril programming language is built from the ground up for bleeding edge HPC. It has the following, fully automatic, killer features: * Git-like source code versioning * Cryptographically secure, distributed filesystem storage * First-class objects ** functions ** types ** modules (aka. tables / record types / directories / structs / ML "Functors") ** parsing constructs (for extensible case analysis) * Extensible primitive operations (JIT C-compilation) * Extensible binary object types (i.e. opaque pointers) This documentation explains how to get up and running with the latest distribution. To interact with the server, you'll need a gpg key. The process for creating one is described [[HowTo:PGP|here]]. Send your public key to me via email, so that I can sign your key to allow access. Once this is done, you can run the sil client using sil -a tcp!rcslurm.usf.edu!5050 -p pubkey.asc privkey.asc where pubkey and privkey are the ascii-armored, exported keys you created above. You can now read all saved objects and create your own commits. You can get started by loading the standard library ([[Stdlib]]) and following along with the [http://predictivestatmech.org/sil/tour.html tutorial]. 12268856fe59e2db419f9eee3c6360d37af97118 233 216 2014-10-01T18:21:37Z David M. Rogers 2 wikitext text/x-wiki The Silmaril programming language is built from the ground up for bleeding edge HPC. It has the following, fully automatic, killer features: * Git-like source code versioning * Cryptographically secure, distributed filesystem storage * First-class objects ** functions ** types ** modules (aka. tables / record types / directories / structs / ML "Functors") ** parsing constructs (for extensible case analysis) * Extensible primitive operations (JIT C-compilation) * Extensible binary object types (i.e. opaque pointers) This documentation explains how to get up and running with the latest distribution. To interact with the server, you'll need a gpg key. The process for creating one is described [[HowTo:PGP|here]]. Send your public key to me via email, so that I can sign your key to allow access. Once this is done, you can run the sil client using sil -a tcp\!rcslurm.usf.edu\!5050 -p pubkey.asc privkey.asc (the backslashes are for bash's benefit) where pubkey and privkey are the ascii-armored, exported keys you created above. You can now read all saved objects and create your own commits. You can get started by loading the standard library ([[Stdlib]]) and following along with the [http://predictivestatmech.org/sil/tour.html tutorial]. 39cd680e48009cf54d32e2337b8fae5f21c3134a Stdlib 0 52 217 2014-09-26T13:55:50Z David M. Rogers 2 Created page with "<source lang="haskell"> /* Stdenv v 0.4 * * To be run once, create some useful standard objects, and save * as a commit structure (for later loading into stdenv-s). * * …" wikitext text/x-wiki <source lang="haskell"> /* Stdenv v 0.4 * * To be run once, create some useful standard objects, and save * as a commit structure (for later loading into stdenv-s). * * Create some useful primitives from the base commands, * 'typeof', 'commit', 'load_prim', and 'load_base' */ -- Test types Nat : ⋆ Z : Nat Succ : Nat → Nat -- Simple functions id = λ x → x seq = λ a b → b const = λ a b → a flip = λ f a b → f b a >>= = applyIO =<< = flip (>>=) infixl >>= 1 infixr =<< 1 -- $ : <a,b : 'kind> -> (a -> b) -> a -> b $ : (a -> b) -> a -> b $ = fun f x -> f x infixr $ 0 IO : (a : 'kind) -> 'kind ST : (a : 'kind) (r : 'kind) -> 'kind rm := Prim =<< commit { name = "rm", ptype = type String -> IO(Nil), n=1, extn = 1, -- IO prim API = "", reduce = " #include <ast.h> #include <cli.h> Ast *reduce(prim_cb_t *cb, struct Prim *p) { struct Environ *e = (struct Environ *)cb->st; if(p->t[0]->type != TBase || p->t[0]->base->type != TString) { printf(\"rm() called on non-string\\n\"); return mkNil(); } p9remove(e, p->t[0]->base->name); return mkNil(); }", } /* More work to do: unitIO applyIO unitST applyST rm pwd ls cd open gc_stat */ -- Save current project as a commit. -- commit_proj "stdenv-0.2" -- string cat ++ = Prim "b1c9a203f71d2e5bdc4ee2378de3ab2fdb1d8352" -- string slice !% = Prim "992740f62d4ca2f2ca9f6f6cf9274d8b9626a7c2" strlen = Prim "2081afb248e480a8f6ca6220156c69d7ac938ef8" infixl ++ 4 infix !% 5 </source> 859b9dee4e38ce6b2157462ff1f1e07d6bf18f78 218 217 2014-09-26T14:02:38Z David M. Rogers 2 wikitext text/x-wiki <source lang="haskell"> /* Stdenv v 0.4 * * To be run once, create some useful standard objects, and save * as a commit structure (for later loading into stdenv-s). * * Create some useful primitives from the base commands, * 'typeof' = λ (t:⋆) (x:t) → t -- compilation step not yet complete (and presently skipped) * 'commit' : {} -> IO(string) * 'open' : string -> {} -- retrieve a previously committed dir. * 'Prim' : string -> ? -- outputs a prim * 'Base' : string -> ⋆ -- outputs the type of a base object */ -- Test types Nat : ⋆ Z : Nat Succ : Nat → Nat -- Simple functions id = λ x → x seq = λ a b → b const = λ a b → a flip = λ f a b → f b a >>= = applyIO =<< = flip (>>=) infixl >>= 1 infixr =<< 1 -- $ : <a,b : 'kind> -> (a -> b) -> a -> b $ : (a -> b) -> a -> b $ = fun f x -> f x infixr $ 0 IO : (a : 'kind) -> 'kind ST : (a : 'kind) (r : 'kind) -> 'kind rm := Prim =<< commit { name = "rm", ptype = type String -> IO(Nil), n=1, extn = 1, -- IO prim API = "", reduce = " #include <ast.h> #include <cli.h> Ast *reduce(prim_cb_t *cb, struct Prim *p) { struct Environ *e = (struct Environ *)cb->st; if(p->t[0]->type != TBase || p->t[0]->base->type != TString) { printf(\"rm() called on non-string\\n\"); return mkNil(); } p9remove(e, p->t[0]->base->name); return mkNil(); }", } /* More work to do: unitIO applyIO unitST applyST rm pwd ls cd open gc_stat */ -- Save current project as a commit. -- commit_proj "stdenv-0.2" unApply = Prim "1572ad8f02e44c195ee3cfff433f0fa81df75268" -- string cat ++ = Prim "b1c9a203f71d2e5bdc4ee2378de3ab2fdb1d8352" -- string slice !% = Prim "992740f62d4ca2f2ca9f6f6cf9274d8b9626a7c2" strlen = Prim "2081afb248e480a8f6ca6220156c69d7ac938ef8" infixl ++ 4 infix !% 5 </source> df2061c86458196185ae60f72d5a091cbb2c1a4d 219 218 2014-09-26T15:21:36Z David M. Rogers 2 wikitext text/x-wiki <source lang="haskell"> /* Stdenv v 0.4 * * To be run once, create some useful standard objects, and save * as a commit structure (for later loading into stdenv-s). * * Create some useful primitives from the base commands, * 'typeof' = λ (t:⋆) (x:t) → t -- compilation step not yet complete (and presently skipped) * 'commit' : {} -> IO(string) * 'open' : string -> {} -- retrieve a previously committed dir. * 'Prim' : string -> ? -- outputs a prim * 'Base' : string -> ⋆ -- outputs the type of a base object */ -- Test types Nat : ⋆ Z : Nat Succ : Nat → Nat -- Simple functions id = λ x → x seq = λ a b → b const = λ a b → a flip = λ f a b → f b a >>= = applyIO =<< = flip (>>=) infixl >>= 1 infixr =<< 1 -- $ : <a,b : 'kind> -> (a -> b) -> a -> b $ : (a -> b) -> a -> b $ = fun f x -> f x infixr $ 0 IO : (a : 'kind) -> 'kind ST : (a : 'kind) (r : 'kind) -> 'kind rm := Prim =<< commit { name = "rm", ptype = type String -> IO(Nil), n=1, extn = 1, -- IO prim API = "", reduce = " #include <ast.h> #include <cli.h> Ast *reduce(prim_cb_t *cb, struct Prim *p) { struct Environ *e = (struct Environ *)cb->st; if(p->t[0]->type != TBase || p->t[0]->base->type != TString) { printf(\"rm() called on non-string\\n\"); return mkNil(); } p9remove(e, p->t[0]->base->name); return mkNil(); }", } /* More work to do: unitIO applyIO unitST applyST rm pwd ls cd open gc_stat */ -- Save current project as a commit. -- commit_proj "stdenv-0.2" unApply = Prim "1572ad8f02e44c195ee3cfff433f0fa81df75268" -- string cat ++ = Prim "04abdf66335ce0504c9e7a1707445e2f700fc185" -- string slice !% = Prim "992740f62d4ca2f2ca9f6f6cf9274d8b9626a7c2" strlen = Prim "2081afb248e480a8f6ca6220156c69d7ac938ef8" infixl ++ 4 infix !% 5 </source> fc0ddc562a7edef558b9775196c44106146882c0 220 219 2014-09-26T15:52:40Z David M. Rogers 2 wikitext text/x-wiki <source lang="haskell"> /* Stdenv v 0.4 * * To be run once, create some useful standard objects, and save * as a commit structure (for later loading into stdenv-s). * * Create some useful primitives from the base commands, * 'typeof' = λ (t:⋆) (x:t) → t -- compilation step not yet complete (and presently skipped) * 'commit' : {} -> IO(string) * 'open' : string -> {} -- retrieve a previously committed dir. * 'Prim' : string -> ? -- outputs a prim * 'Base' : string -> ⋆ -- outputs the type of a base object */ -- Test types Nat : ⋆ Z : Nat Succ : Nat → Nat -- Simple functions id = λ x → x seq = λ a b → b const = λ a b → a flip = λ f a b → f b a >>= = applyIO =<< = flip (>>=) >> = λ a b → applyIO a (const b) infixl >>= 1 infixr =<< 1 infixl >> 1 -- $ : <a,b : 'kind> -> (a -> b) -> a -> b $ : (a -> b) -> a -> b $ = fun f x -> f x infixr $ 0 IO : (a : 'kind) -> 'kind ST : (a : 'kind) (r : 'kind) -> 'kind rm := Prim =<< commit { name = "rm", ptype = type String -> IO(Nil), n=1, extn = 1, -- IO prim API = "", reduce = " #include <ast.h> #include <cli.h> Ast *reduce(prim_cb_t *cb, struct Prim *p) { struct Environ *e = (struct Environ *)cb->st; if(p->t[0]->type != TBase || p->t[0]->base->type != TString) { printf(\"rm() called on non-string\\n\"); return mkNil(); } p9remove(e, p->t[0]->base->name); return mkNil(); }", } /* More work to do: unitIO applyIO unitST applyST rm pwd ls cd open gc_stat */ -- Save current project as a commit. -- commit_proj "stdenv-0.2" unApply = Prim "1572ad8f02e44c195ee3cfff433f0fa81df75268" -- string cat ++ = Prim "04abdf66335ce0504c9e7a1707445e2f700fc185" -- string slice !% = Prim "992740f62d4ca2f2ca9f6f6cf9274d8b9626a7c2" strlen = Prim "2081afb248e480a8f6ca6220156c69d7ac938ef8" infixl ++ 4 infix !% 5 </source> 0c8acc7ce6c91ee771d513ca3d5f1682e80d5354 CompSciWeek6 0 48 222 198 2014-09-29T15:06:51Z David M. Rogers 2 wikitext text/x-wiki = Reading (shared with Week 7) = * Beginning Python - skim. chapters 8-14 (use as reference material) ** see expecially urlopen on p. 300, forks and threads on p. 304 * Beginning Python - Chapter 15 (Web services) = Class 1: Effective Design = * Code walk-through, parsing and using graphs * Structured Code, Bioinformatics example from AOS Book * Code Testing * Source Code Versioning ** basic git = Class 2: Using HPC Resources = * Accessing binaries and libraries, using modules * Using scratch space * Submitting a job script * Managing queued jobs * Advanced scripting tips and tricks ** awk 1cd7930ff5bb14aed8b48f190147c5c94313f7c0 229 222 2014-09-29T15:17:00Z David M. Rogers 2 /* Class 1: Effective Design */ wikitext text/x-wiki = Reading (shared with Week 7) = * Beginning Python - skim. chapters 8-14 (use as reference material) ** see expecially urlopen on p. 300, forks and threads on p. 304 * Beginning Python - Chapter 15 (Web services) = Class 1: Effective Design = * Structured Code, Bioinformatics example from AOS Book * Code Testing * Source Code Versioning ** basic git = Class 2: Using HPC Resources = * Accessing binaries and libraries, using modules * Using scratch space * Submitting a job script * Managing queued jobs * Advanced scripting tips and tricks ** awk 9ba88aadc6a85f396bc9d6517298b69eaddab40a 231 229 2014-09-30T15:44:14Z David M. Rogers 2 wikitext text/x-wiki = Reading (shared with Week 7) = * Beginning Python - skim. chapters 8-14 (use as reference material) ** see expecially urlopen on p. 300, forks and threads on p. 304 * Beginning Python - Chapter 15 (Web services) = Class 1: Effective Design = * Structured Code, Bioinformatics example from AOS Book * Code Testing * Source Code Versioning ** basic git = Class 2: Using HPC Resources = * Accessing binaries and libraries, using modules * Using scratch space * Submitting a job script * Managing queued jobs * Advanced scripting tips and tricks ** awk = Homework 4 (Due Fri., Oct. 10) = Please email the completed homework with the subject line "SciComp HW4, (your name)" # Write example functions that use the advanced function notation from Beginning Python, Ch. 6 (see especially the example on p. 124). ## f(arg=default): the function should do nothing if the function is called as f(), and it should call arg.set_price(12) if it is called as f(type("InvItem", (), {"set_price":(lambda a,b: b)})()) ## f(*arg): the function should return the number of arguments passed in the call f('a', 'b', 1, 5, {'t': [4]}) ## f(**args): the function should return the value associated with the key "agent" in the call f(auto="DB5", lno=31337, agent="007") # Write an example python class to represent a general inventory item. It should store its own name, and must contain the following methods: getCount(), returning the (arbitrary, fixed) number of items in inventory, and getPrice(), which computes the price using the formula price = price0 - k*log(count), where price0 and k are arbitrary, fixed variables belonging to the object. # The article [http://www.aosabook.org/en/posa/working-with-big-data-in-bioinformatics.html "Working with Big Data in Bioinformatics"] describes software that reads lots of small strings and increments some counters for each string. The overall structure of their code contains a fast C++ library, a python wrapper, and python scripts. Describe which of those three categories you would place each of the following routines in, and why. ## A class that creates C++ objects representing counters for sequence data and that contains methods for translating the counts to numpy arrays. ## A script that creates a plot of the k-mer counts in a subset of the data. ## A function reading and parsing files containing genomic sequence data. ## A script installing the complete Khmer package, (compiling the C++ library, copying the python package, etc.) # Explain (without trying to solve their problems) why each of the following quotes from the article might be relevant to the performance of their code: ## "We expected the highest traffic to be in the k-mer counting logic." ## "Redundant calls to the toupper function were present in the highest traffic regions of the code." ## "Input of genomic reads was performed line-by-line and on demand and without any readahead tuning." ## "A copy-by-value of the genomic read struct [was] performed for every parsed and valid genomic read." a6d91f6c0cd7a2adec081b13ec606ac94a2a0d41 232 231 2014-09-30T15:44:56Z David M. Rogers 2 /* Homework 4 (Due Fri., Oct. 10) */ wikitext text/x-wiki = Reading (shared with Week 7) = * Beginning Python - skim. chapters 8-14 (use as reference material) ** see expecially urlopen on p. 300, forks and threads on p. 304 * Beginning Python - Chapter 15 (Web services) = Class 1: Effective Design = * Structured Code, Bioinformatics example from AOS Book * Code Testing * Source Code Versioning ** basic git = Class 2: Using HPC Resources = * Accessing binaries and libraries, using modules * Using scratch space * Submitting a job script * Managing queued jobs * Advanced scripting tips and tricks ** awk = Homework 4 (Due Fri., Oct. 10) = Please email the completed homework with the subject line "SciComp HW4, (your name)" # Write example functions that use the advanced function notation from Beginning Python, Ch. 6 (see especially the example on p. 124). ## f(arg=default): the function should do nothing if the function is called as f(), and it should call arg.set_price(12) if it is called as f(type("InvItem", (), {"set_price":(lambda a,b: b)})()) ## f(*arg): the function should return the number of arguments passed in the call f('a', 'b', 1, 5, {'t': [4]}) ## f(**args): the function should return the value associated with the key "agent" in the call f(auto="DB5", lno=31337, agent="007") # Write an example python class to represent a general inventory item. It should store its own name, and must contain the following methods: getCount(), returning the (arbitrary, fixed) number of items in inventory, and getPrice(), which computes the price using the formula price = price0 - k*log(count), where price0 and k are arbitrary, fixed variables belonging to the object. # The article [http://www.aosabook.org/en/posa/working-with-big-data-in-bioinformatics.html "Working with Big Data in Bioinformatics"] describes software that reads lots of small strings and increments some counters for each string. The overall structure of their code contains a fast C++ library, a python wrapper, and python scripts. Describe which of those three categories you would place each of the following routines in, and why. ## A class that creates C++ objects representing counters for sequence data and that contains methods for translating the counts to numpy arrays. ## A script that creates a plot of the k-mer counts in a subset of the data. ## A function reading and parsing files containing genomic sequence data. ## A script installing the complete Khmer package, (compiling the C++ library, copying the python package, etc.) # Explain (without trying to solve their problems) why each of the following quotes from the article might be relevant to the performance of their code: ## "We expected the highest traffic to be in the k-mer counting logic." ## "Redundant calls to the toupper function were present in the highest traffic regions of the code." ## "Input of genomic reads was performed line-by-line and on demand and without any readahead tuning." ## "A copy-by-value of the genomic read struct [was] performed for every parsed and valid genomic read." b67429403aac32883cd732ba651fdfed7cca7455 234 232 2014-10-01T19:00:47Z David M. Rogers 2 wikitext text/x-wiki = Reading (shared with Week 7) = * Beginning Python - skim. chapters 8-14 (use as reference material) ** see expecially urlopen on p. 300, forks and threads on p. 304 * Beginning Python - Chapter 15 (Web services) = Class 1: Effective Design = * Structured Code, Bioinformatics example from AOS Book * Code Testing * Source Code Versioning ** basic git = Class 2: Using HPC Resources = * Accessing binaries and libraries, using modules * Using scratch space * Submitting a job script * Managing queued jobs * Advanced scripting tips and tricks ** awk = Homework 4 (Due Fri., Oct. 10) = Please email the completed homework with the subject line "SciComp HW4, (your name)" # Write example functions that use the advanced function notation from Beginning Python, Ch. 6 (see especially the example on p. 124). ## f(arg=default): the function should do nothing if the function is called as f(), and it should call arg.set_price(12) if it is called as f(type("InvItem", (), {"set_price":(lambda a,b: b)})()) ## f(*arg): the function should return the number of arguments passed in the call f('a', 'b', 1, 5, {'t': [4]}) ## f(**args): the function should return the value associated with the key "agent" in the call f(auto="DB5", lno=31337, agent="007") # Write an example python class to represent a general inventory item. It should store its own name, and must contain the following methods: getCount(), returning the (arbitrary, fixed) number of items in inventory, and getPrice(), which computes the price using the formula price = price0 - k*log(count), where price0 and k are arbitrary, fixed variables belonging to the object. # The article [http://www.aosabook.org/en/posa/working-with-big-data-in-bioinformatics.html "Working with Big Data in Bioinformatics"] describes software that reads lots of small strings and increments some counters for each string. The overall structure of their code contains a fast C++ library, a python wrapper, and python scripts. Describe which of those three categories you would place each of the following routines in, and why. ## A class that creates C++ objects representing counters for sequence data and that contains methods for translating the counts to numpy arrays. ## A script that creates a plot of the k-mer counts in a subset of the data. ## A function reading and parsing files containing genomic sequence data. ## A script installing the complete Khmer package, (compiling the C++ library, copying the python package, etc.) # Explain (without trying to solve their problems) why each of the following quotes from the article might be relevant to the performance of their code: ## "We expected the highest traffic to be in the k-mer counting logic." ## "Redundant calls to the toupper function were present in the highest traffic regions of the code." ## "Input of genomic reads was performed line-by-line and on demand and without any readahead tuning." ## "A copy-by-value of the genomic read struct [was] performed for every parsed and valid genomic read." = Codes = Power function with logarithmic run time in n (linear in the ''size'' of n) <source lang="python> def pow(x, n): ''' Returns the number x raised to the integer power, n. >>> pow(2, 4) 16 >>> pow(3, 2) 9 >>> pow(5, 0) 1 complexity = O(log n) = O(m), where m = # digits in n ''' if n < 1: return 1 # correct for n=0 elif n == 1: return x elif n % 2 == 0: hp = pow(x, n/2) return hp*hp else: # 3, 5, 7, ... hp = pow(x, (n-1)/2) return x*hp*hp </source> Using the python-geocoder-0.2 interface to Google's web-API to get distances: <source lang="python"> from geocode.google import GoogleGeocoderClient from numpy import * geocoder = GoogleGeocoderClient(False) # must specify sensor parameter explicitely def to_xyz(phi, th): c = cos(phi) return array([c*cos(th), c*sin(th), sin(phi)]) def to_polar(lat, lon): return (90-float(lat))*pi/180.0, float(lon)*pi/180.0 def dist(a, b): # distance in kilometers across a perfect sphere of radius 6370 km return 6370*arccos(dot(to_xyz(*a), to_xyz(*b))) def get_loc(name): result = geocoder.geocode(name) if result.is_success(): return to_polar(*result.get_location()) else: print "Geocoding failed" return (0.0, 0.0) a = get_loc("Lowry Park Zoo") # spherical polar b = get_loc("MOSI, Tampa, FL") print dist(a, b) </source> 16e9f9f2d3c43a16b32442afd23133aec0db40be 235 234 2014-10-01T19:01:04Z David M. Rogers 2 /* Codes */ wikitext text/x-wiki = Reading (shared with Week 7) = * Beginning Python - skim. chapters 8-14 (use as reference material) ** see expecially urlopen on p. 300, forks and threads on p. 304 * Beginning Python - Chapter 15 (Web services) = Class 1: Effective Design = * Structured Code, Bioinformatics example from AOS Book * Code Testing * Source Code Versioning ** basic git = Class 2: Using HPC Resources = * Accessing binaries and libraries, using modules * Using scratch space * Submitting a job script * Managing queued jobs * Advanced scripting tips and tricks ** awk = Homework 4 (Due Fri., Oct. 10) = Please email the completed homework with the subject line "SciComp HW4, (your name)" # Write example functions that use the advanced function notation from Beginning Python, Ch. 6 (see especially the example on p. 124). ## f(arg=default): the function should do nothing if the function is called as f(), and it should call arg.set_price(12) if it is called as f(type("InvItem", (), {"set_price":(lambda a,b: b)})()) ## f(*arg): the function should return the number of arguments passed in the call f('a', 'b', 1, 5, {'t': [4]}) ## f(**args): the function should return the value associated with the key "agent" in the call f(auto="DB5", lno=31337, agent="007") # Write an example python class to represent a general inventory item. It should store its own name, and must contain the following methods: getCount(), returning the (arbitrary, fixed) number of items in inventory, and getPrice(), which computes the price using the formula price = price0 - k*log(count), where price0 and k are arbitrary, fixed variables belonging to the object. # The article [http://www.aosabook.org/en/posa/working-with-big-data-in-bioinformatics.html "Working with Big Data in Bioinformatics"] describes software that reads lots of small strings and increments some counters for each string. The overall structure of their code contains a fast C++ library, a python wrapper, and python scripts. Describe which of those three categories you would place each of the following routines in, and why. ## A class that creates C++ objects representing counters for sequence data and that contains methods for translating the counts to numpy arrays. ## A script that creates a plot of the k-mer counts in a subset of the data. ## A function reading and parsing files containing genomic sequence data. ## A script installing the complete Khmer package, (compiling the C++ library, copying the python package, etc.) # Explain (without trying to solve their problems) why each of the following quotes from the article might be relevant to the performance of their code: ## "We expected the highest traffic to be in the k-mer counting logic." ## "Redundant calls to the toupper function were present in the highest traffic regions of the code." ## "Input of genomic reads was performed line-by-line and on demand and without any readahead tuning." ## "A copy-by-value of the genomic read struct [was] performed for every parsed and valid genomic read." = Codes = Power function with logarithmic run time in n (linear in the ''size'' of n) <source lang="python"> def pow(x, n): ''' Returns the number x raised to the integer power, n. >>> pow(2, 4) 16 >>> pow(3, 2) 9 >>> pow(5, 0) 1 complexity = O(log n) = O(m), where m = # digits in n ''' if n < 1: return 1 # correct for n=0 elif n == 1: return x elif n % 2 == 0: hp = pow(x, n/2) return hp*hp else: # 3, 5, 7, ... hp = pow(x, (n-1)/2) return x*hp*hp </source> Using the python-geocoder-0.2 interface to Google's web-API to get distances: <source lang="python"> from geocode.google import GoogleGeocoderClient from numpy import * geocoder = GoogleGeocoderClient(False) # must specify sensor parameter explicitely def to_xyz(phi, th): c = cos(phi) return array([c*cos(th), c*sin(th), sin(phi)]) def to_polar(lat, lon): return (90-float(lat))*pi/180.0, float(lon)*pi/180.0 def dist(a, b): # distance in kilometers across a perfect sphere of radius 6370 km return 6370*arccos(dot(to_xyz(*a), to_xyz(*b))) def get_loc(name): result = geocoder.geocode(name) if result.is_success(): return to_polar(*result.get_location()) else: print "Geocoding failed" return (0.0, 0.0) a = get_loc("Lowry Park Zoo") # spherical polar b = get_loc("MOSI, Tampa, FL") print dist(a, b) </source> 27ef1419b9298c921b19c8c94f4d65152bfef7a3 236 235 2014-10-01T19:02:48Z David M. Rogers 2 /* Codes */ wikitext text/x-wiki = Reading (shared with Week 7) = * Beginning Python - skim. chapters 8-14 (use as reference material) ** see expecially urlopen on p. 300, forks and threads on p. 304 * Beginning Python - Chapter 15 (Web services) = Class 1: Effective Design = * Structured Code, Bioinformatics example from AOS Book * Code Testing * Source Code Versioning ** basic git = Class 2: Using HPC Resources = * Accessing binaries and libraries, using modules * Using scratch space * Submitting a job script * Managing queued jobs * Advanced scripting tips and tricks ** awk = Homework 4 (Due Fri., Oct. 10) = Please email the completed homework with the subject line "SciComp HW4, (your name)" # Write example functions that use the advanced function notation from Beginning Python, Ch. 6 (see especially the example on p. 124). ## f(arg=default): the function should do nothing if the function is called as f(), and it should call arg.set_price(12) if it is called as f(type("InvItem", (), {"set_price":(lambda a,b: b)})()) ## f(*arg): the function should return the number of arguments passed in the call f('a', 'b', 1, 5, {'t': [4]}) ## f(**args): the function should return the value associated with the key "agent" in the call f(auto="DB5", lno=31337, agent="007") # Write an example python class to represent a general inventory item. It should store its own name, and must contain the following methods: getCount(), returning the (arbitrary, fixed) number of items in inventory, and getPrice(), which computes the price using the formula price = price0 - k*log(count), where price0 and k are arbitrary, fixed variables belonging to the object. # The article [http://www.aosabook.org/en/posa/working-with-big-data-in-bioinformatics.html "Working with Big Data in Bioinformatics"] describes software that reads lots of small strings and increments some counters for each string. The overall structure of their code contains a fast C++ library, a python wrapper, and python scripts. Describe which of those three categories you would place each of the following routines in, and why. ## A class that creates C++ objects representing counters for sequence data and that contains methods for translating the counts to numpy arrays. ## A script that creates a plot of the k-mer counts in a subset of the data. ## A function reading and parsing files containing genomic sequence data. ## A script installing the complete Khmer package, (compiling the C++ library, copying the python package, etc.) # Explain (without trying to solve their problems) why each of the following quotes from the article might be relevant to the performance of their code: ## "We expected the highest traffic to be in the k-mer counting logic." ## "Redundant calls to the toupper function were present in the highest traffic regions of the code." ## "Input of genomic reads was performed line-by-line and on demand and without any readahead tuning." ## "A copy-by-value of the genomic read struct [was] performed for every parsed and valid genomic read." = Codes = Power function with logarithmic run time in n (linear in the ''size'' of n) <source lang="python"> def pow(x, n): ''' Returns the number x raised to the integer power, n. >>> pow(2, 4) 16 >>> pow(3, 2) 9 >>> pow(5, 0) 1 complexity = O(log n) = O(m), where m = # digits in n ''' if n < 1: return 1 # correct for n=0 elif n == 1: return x elif n % 2 == 0: hp = pow(x, n/2) return hp*hp else: # 3, 5, 7, ... hp = pow(x, (n-1)/2) return x*hp*hp </source> Testing the last module using python's doctest: <source lang="python"> #!/usr/bin/env python if __name__=="__main__": import doctest, vector # assumes pow() is defined in vector doctest.testmod(vector) </source> Using the python-geocoder-0.2 interface to Google's web-API to get distances: <source lang="python"> from geocode.google import GoogleGeocoderClient from numpy import * geocoder = GoogleGeocoderClient(False) # must specify sensor parameter explicitely def to_xyz(phi, th): c = cos(phi) return array([c*cos(th), c*sin(th), sin(phi)]) def to_polar(lat, lon): return (90-float(lat))*pi/180.0, float(lon)*pi/180.0 def dist(a, b): # distance in kilometers across a perfect sphere of radius 6370 km return 6370*arccos(dot(to_xyz(*a), to_xyz(*b))) def get_loc(name): result = geocoder.geocode(name) if result.is_success(): return to_polar(*result.get_location()) else: print "Geocoding failed" return (0.0, 0.0) a = get_loc("Lowry Park Zoo") # spherical polar b = get_loc("MOSI, Tampa, FL") print dist(a, b) </source> eb6de192396f1ee88fce62a1a2232f7525f39fbc CompSciWeek8 0 53 224 2014-09-29T15:07:54Z David M. Rogers 2 Created page with "= Parallel programming examples = * Code walk-through parallel array analysis * walk-through mpi4py = Interfacing Python and C = * walk-through MPI interfaces from other languag…" wikitext text/x-wiki = Parallel programming examples = * Code walk-through parallel array analysis * walk-through mpi4py = Interfacing Python and C = * walk-through MPI interfaces from other languages * ctypes 04f5ef3833d25e5fc364156198a9b2f690b5033e 245 224 2014-10-13T15:56:53Z David M. Rogers 2 wikitext text/x-wiki = Reading = Review previous chapters and complete your midterm projects by Friday! = Classes 1 & 2 = * Example project walk-through * Demonstrates use of git, python ctypes, class objects, sed, and batch job organization * Complexity of searching for a key * Design pattern: sorted list + bisection search vs. hashing * Design patterns: sorting an index to recover a permutation * Working with permutations ** Random permutation, conditional probability concepts * Complexity and solution of the Hanoi tower problem == Midterm Project Outline == * Motivation - explain where this problem comes from / where the solution applies * Problem Description - explain what makes your problem difficult ** If more than one paragraph of reviewing previous work is needed, put here. (ex. the [http://termemulator.sourceforge.net/ termemulator] project by Siva Chandran provides a great example of using the subprocess module to run shell programs with interactive user input. It provides ..., but does not solve ... This work builds on its use of subprocess.) * Code - explain what new code / structure / algorithm design improvement you have made (ex. My job-server design queries a directory for new problem descriptions, then either uses stored data to directly compute the result or else creates a new SGE job to produce more stored data.) * Results and Discussion - present numerical results (if applicable) or discuss the trade-offs involved in your design choices (ex. This strategy automates stored data computation and management, saving more time than it required to write the server. Manual management took ... per data set, automatic management required ... to write. It will not scale beyond 100 Gb, or work for problem ..., etc.) Note that the above sections are suitable for this project, whose goal is to show proficiency in going from a scientific problem to a structured piece of code. They are inadequate for a scientific paper, for which much more effort needs to be spent on defending a single claim, anticipating the prejudices of your audience (this means literature review), and making understandable figures to illustrate your defense. aa17336d3db8bd699e8d96385f901e3159188a26 253 245 2014-10-13T20:57:20Z David M. Rogers 2 wikitext text/x-wiki = Reading = Review previous chapters and complete your midterm projects by Friday! * Advertisment: [[Code:SLURM|Use the slurm queue]] on USF Circe for an overall better user experience (sign up at rc user portal)! = Classes 1 & 2 = * Example project walk-through * Demonstrates use of git, python ctypes, class objects, sed, and batch job organization * Complexity of searching for a key * Design pattern: sorted list + bisection search vs. hashing * Design patterns: sorting an index to recover a permutation * Working with permutations ** Random permutation, conditional probability concepts * Complexity and solution of the Hanoi tower problem == Midterm Project Outline == * Motivation - explain where this problem comes from / where the solution applies * Problem Description - explain what makes your problem difficult ** If more than one paragraph of reviewing previous work is needed, put here. (ex. the [http://termemulator.sourceforge.net/ termemulator] project by Siva Chandran provides a great example of using the subprocess module to run shell programs with interactive user input. It provides ..., but does not solve ... This work builds on its use of subprocess.) * Code - explain what new code / structure / algorithm design improvement you have made (ex. My job-server design queries a directory for new problem descriptions, then either uses stored data to directly compute the result or else creates a new SGE job to produce more stored data.) * Results and Discussion - present numerical results (if applicable) or discuss the trade-offs involved in your design choices (ex. This strategy automates stored data computation and management, saving more time than it required to write the server. Manual management took ... per data set, automatic management required ... to write. It will not scale beyond 100 Gb, or work for problem ..., etc.) Note that the above sections are suitable for this project, whose goal is to show proficiency in going from a scientific problem to a structured piece of code. They are inadequate for a scientific paper, for which much more effort needs to be spent on defending a single claim, anticipating the prejudices of your audience (this means literature review), and making understandable figures to illustrate your defense. = Homework 5, Due Wed., Oct. 22 = Refer to the [[CompSciWeek7#Binary_Tree_Code|Binary Tree Code]] for all except the last question. Email your homework answers with "SciComp HW5" in the subject line, using a text file formatting that can be input to [[Code:text2pdf|text2pdf]]. Specifically, each to-level question (1-7) should start with '''= Question 1''' at the beginning of a line. # Write a one-liner using these functions to print the binary encoding for 'd' in the prefix code for "abcdefg". # What is the asymptotic worst case complexity notation of each operation: ## decode ## create_tree ## get_codes # What is special about get_codes? # Write an inductive proof for the following properties of get_codes: ## The iteration covers all leaf nodes under the current node. (hint: Remember an inductive proof has a base case and a recursive case and add more detail to the definition of ''all leaf nodes under the current node''). ## At each internal node, every address generated is a prefix code (i.e. no code is a prefix of another code). # A balanced binary tree has approximately equally sized left and right sub-trees. Why does the tree remain balanced when the input to create_tree is sorted? # Compare the design choice made here of separate functions with the alternative of putting some of the functions (decode, create_tree, etc.) inside the class TreeNode. Which are the best candidates for turining into class methods? If create_tree is used as TreeNode's init function, what would be lost? # Calculate the average case complexity of list.index(), which searches for an item in a list of size n by checking each list element (0, ..., n-1) in order. Use the assumptions that 1) the probability that X occurs in the list is 2/3. 2) If X occurs in the list, it is equally likely to appear anywhere. 48e28bf96b52b738ac27f5f8b4ccdd7dc4ea6556 254 253 2014-10-13T20:57:59Z David M. Rogers 2 /* Homework 5, Due Wed., Oct. 22 */ wikitext text/x-wiki = Reading = Review previous chapters and complete your midterm projects by Friday! * Advertisment: [[Code:SLURM|Use the slurm queue]] on USF Circe for an overall better user experience (sign up at rc user portal)! = Classes 1 & 2 = * Example project walk-through * Demonstrates use of git, python ctypes, class objects, sed, and batch job organization * Complexity of searching for a key * Design pattern: sorted list + bisection search vs. hashing * Design patterns: sorting an index to recover a permutation * Working with permutations ** Random permutation, conditional probability concepts * Complexity and solution of the Hanoi tower problem == Midterm Project Outline == * Motivation - explain where this problem comes from / where the solution applies * Problem Description - explain what makes your problem difficult ** If more than one paragraph of reviewing previous work is needed, put here. (ex. the [http://termemulator.sourceforge.net/ termemulator] project by Siva Chandran provides a great example of using the subprocess module to run shell programs with interactive user input. It provides ..., but does not solve ... This work builds on its use of subprocess.) * Code - explain what new code / structure / algorithm design improvement you have made (ex. My job-server design queries a directory for new problem descriptions, then either uses stored data to directly compute the result or else creates a new SGE job to produce more stored data.) * Results and Discussion - present numerical results (if applicable) or discuss the trade-offs involved in your design choices (ex. This strategy automates stored data computation and management, saving more time than it required to write the server. Manual management took ... per data set, automatic management required ... to write. It will not scale beyond 100 Gb, or work for problem ..., etc.) Note that the above sections are suitable for this project, whose goal is to show proficiency in going from a scientific problem to a structured piece of code. They are inadequate for a scientific paper, for which much more effort needs to be spent on defending a single claim, anticipating the prejudices of your audience (this means literature review), and making understandable figures to illustrate your defense. = Homework 5, Due Wed., Oct. 22 = Refer to the [[CompSciWeek7#Binary_Tree_Code|Binary Tree Code]] for all except the last question. Email your homework answers with "SciComp HW5" in the subject line, using a text file formatting that can be input to [[Code:text2pdf|text2pdf]]. Specifically, each to-level question (1-7) should start with '''= Question 1''' at the beginning of a line. # Write a one-liner using these functions to print the binary encoding for 'd' in the prefix code for "abcdefg". # What is the asymptotic worst case complexity notation of each operation: ## decode ## create_tree ## get_codes # What makes get_codes different than an ordinary function? # Write an inductive proof for the following properties of get_codes: ## The iteration covers all leaf nodes under the current node. (hint: Remember an inductive proof has a base case and a recursive case and add more detail to the definition of ''all leaf nodes under the current node''). ## At each internal node, every address generated is a prefix code (i.e. no code is a prefix of another code). # A balanced binary tree has approximately equally sized left and right sub-trees. Why does the tree remain balanced when the input to create_tree is sorted? # Compare the design choice made here of separate functions with the alternative of putting some of the functions (decode, create_tree, etc.) inside the class TreeNode. Which are the best candidates for turining into class methods? If create_tree is used as TreeNode's init function, what would be lost? # Calculate the average case complexity of list.index(), which searches for an item in a list of size n by checking each list element (0, ..., n-1) in order. Use the assumptions that 1) the probability that X occurs in the list is 2/3. 2) If X occurs in the list, it is equally likely to appear anywhere. 7cead7559b61fdf2a87e2f0601601a9d8445f67f 255 254 2014-10-15T18:00:21Z David M. Rogers 2 wikitext text/x-wiki = Reading = Review previous chapters and complete your midterm projects by Friday! * Advertisment: [[Code:SLURM|Use the slurm queue]] on USF Circe for an overall better user experience (sign up at rc user portal)! = Classes 1 & 2 = * Example project walk-through * Demonstrates use of git, python ctypes, class objects, sed, and batch job organization * Complexity of searching for a key * Design pattern: sorted list + bisection search vs. hashing * Design patterns: sorting an index to recover a permutation * Working with permutations ** Random permutation, conditional probability concepts * Complexity and solution of the Hanoi tower problem == Midterm Project Outline == * Motivation - explain where this problem comes from / where the solution applies * Problem Description - explain what makes your problem difficult ** If more than one paragraph of reviewing previous work is needed, put here. (ex. the [http://termemulator.sourceforge.net/ termemulator] project by Siva Chandran provides a great example of using the subprocess module to run shell programs with interactive user input. It provides ..., but does not solve ... This work builds on its use of subprocess.) * Code - explain what new code / structure / algorithm design improvement you have made (ex. My job-server design queries a directory for new problem descriptions, then either uses stored data to directly compute the result or else creates a new SGE job to produce more stored data.) * Results and Discussion - present numerical results (if applicable) or discuss the trade-offs involved in your design choices (ex. This strategy automates stored data computation and management, saving more time than it required to write the server. Manual management took ... per data set, automatic management required ... to write. It will not scale beyond 100 Gb, or work for problem ..., etc.) Note that the above sections are suitable for this project, whose goal is to show proficiency in going from a scientific problem to a structured piece of code. They are inadequate for a scientific paper, for which much more effort needs to be spent on defending a single claim, anticipating the prejudices of your audience (this means literature review), and making understandable figures to illustrate your defense. = Homework 5, Due Wed., Oct. 22 = Refer to the [[CompSciWeek7#Binary_Tree_Code|Binary Tree Code]] for all except the last question. Email your homework answers with "SciComp HW5" in the subject line, using a text file formatting that can be input to [[Code:text2pdf|text2pdf]]. Specifically, each to-level question (1-7) should start with '''= Question 1''' at the beginning of a line. # Write a one-liner using these functions to print the binary encoding for 'd' in the prefix code for "abcdefg". # What is the asymptotic worst case complexity notation of each operation: ## decode ## create_tree ## get_codes # What makes get_codes different than an ordinary function? # Write an inductive proof for the following properties of get_codes: ## The iteration covers all leaf nodes under the current node. (hint: Remember an inductive proof has a base case and a recursive case and add more detail to the definition of ''all leaf nodes under the current node''). ## At each internal node, every address generated is a prefix code (i.e. no code is a prefix of another code). # A balanced binary tree has approximately equally sized left and right sub-trees. Why does create_tree always return a balanced tree? # Compare the design choice made here of separate functions with the alternative of putting some of the functions (decode, create_tree, etc.) inside the class TreeNode. Which are the best candidates for turining into class methods? If create_tree is used as TreeNode's init function, what would be lost? # Calculate the average case complexity of list.index(), which searches for an item in a list of size n by checking each list element (0, ..., n-1) in order. Use the assumptions that 1) the probability that X occurs in the list is 2/3. 2) If X occurs in the list, it is equally likely to appear anywhere. b91c9c4e81be568e8cf600118f7d8160e4ebfb43 CompSciFall2014 0 38 225 196 2014-09-29T15:11:44Z David M. Rogers 2 /* Notes & Homework */ wikitext text/x-wiki '''<BIG>Introduction to Scientific Computing</BIG>''' Course Info * Course Numbers CHM 4932/6938, CRN: 94314 * Credit Hours: 3 * Meeting Dates: Aug. 25 - Dec. 3, 2014 ** No Class Sept. 1 and Nov. 28 * Meeting Times: Mon. and Wed., 12:30-13:45 in SCA 222 ** Lab Session & Office Hours: Fri. 12:30-13:45 in SCA 222 * Assignments: ** [[#Notes & Homework|Weekly Homework]] (60%) ** Midterm Project (20%) *** Topic by Friday, Sept. 19 *** due Friday, Oct. 17, 2014 ** Final Project (20%) *** Topic by Friday, Nov. 14 *** due Friday, Dec. 5, 2014 == Overview == Mathematical models in the natural sciences take many shapes and forms. The moment they become more complicated than tracking a few variables over time, we have to put away our Excel spreadsheets and make use of a solid foundation in computational science. The course establishes this foundation by introducing data structures and algorithms used in everyday scientific computing using examples in the python scripting language. By the end of the Semester, students will be able to navigate the Linux command-line to go from a mathematical model to a numerical solution. Best practices for working with computer code and visualizing data will also be covered. == Textbooks == * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-0072-7 Beginning Python, Hetland, 2005] (eBook avail. from USF Library) * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-3238-4 Python Algorithms, Hetland, 2010] (eBook avail. from USF Library) * [http://aosabook.org/en/index.html The Architecture of Open Source Applications] * [http://docs.python.org Python Documentation] * [https://developers.google.com/edu/python/ Google Introductory Python Notes] Other (possibly useful) materials: * Chapters 7&8 of Modelling and Simulation, Birta and Arbez, Springer 2007 (eBook avail. from USF Library). * Chapters 4-6 of Models and Algorithms for Intelligent Data Analysis, Runkler, Springer 2012 (eBook avail. from USF Library). * Guide to Scientific Computing in C++, Francis and Whiteley, Springer, 2012. (eBook avail. from USF Library) * Extra info. On the basics: ** Chapters 3 and 7 of Mathematics in Computing, Regan, Springer 2013. (eBook avail. from USF Library) ** Instant feedback graphical programming with [https://www.khanacademy.org/cs/programming/ Khan Academy] * [http://www.meetup.com/python-178/ Local PyBulls Meetings] == Topics == # Languages #* bash (shell) #* python (scripting) #* stack & register-based machine languages: overview of C and Fortran syntax & compiling with gcc, ‘thread safety’ #* Shared libraries & language inter-operability (FFI) # Algorithms #* Horner’s algorithm for polynomials #* Newton’s root finding algo. #* Overview of general optimization algo-s (example: linear & nonlin. least-squares) #* Numerical integration (scripted, plus gnu ODE) #* Communication (how HTTP get/put works) # Data Structures #* Linked Lists #* Trees (file system hierarchies) #* Graphs #* Arrays (dense & sparse) example: vectors & rotations / transpositions, densities and difference operators # Presentation & visualization #* Flat CSV files (and excel) #* Working with binary data #* Python matplotlib (2D images) #* Binning histograms & weighted averages # Best Practices #* High-level code design (modularity, interface specifications, unit testing, etc.) #* Code audit: open-source libraries, ex. Gnu Scientific Library, qsort in libc, Boost #* Source code versioning (example: git or mercurial) #* gdb & execution profiling #* documentation #* Makefiles === Notes & Homework === * [[CompSciWeek1]] Aug. 25 * [[CompSciWeek2]] Sept. 1 * [[CompSciWeek3]] Sept. 8 * [[CompSciWeek4]] Sept. 15 * [[CompSciWeek5]] Sept. 22 * [[CompSciWeek6]] Sept. 29 * [[CompSciWeek7]] Oct. 6 * [[CompSciWeek8]] Oct. 13 * [[CompSciWeek9]] Oct. 20 * [[CompSciWeek10]] Oct. 27 * [[CompSciWeek11]] Nov. 3 7dc8fd65871225888a46527c1e0f73a624b77772 226 225 2014-09-29T15:13:14Z David M. Rogers 2 /* Notes & Homework */ wikitext text/x-wiki '''<BIG>Introduction to Scientific Computing</BIG>''' Course Info * Course Numbers CHM 4932/6938, CRN: 94314 * Credit Hours: 3 * Meeting Dates: Aug. 25 - Dec. 3, 2014 ** No Class Sept. 1 and Nov. 28 * Meeting Times: Mon. and Wed., 12:30-13:45 in SCA 222 ** Lab Session & Office Hours: Fri. 12:30-13:45 in SCA 222 * Assignments: ** [[#Notes & Homework|Weekly Homework]] (60%) ** Midterm Project (20%) *** Topic by Friday, Sept. 19 *** due Friday, Oct. 17, 2014 ** Final Project (20%) *** Topic by Friday, Nov. 14 *** due Friday, Dec. 5, 2014 == Overview == Mathematical models in the natural sciences take many shapes and forms. The moment they become more complicated than tracking a few variables over time, we have to put away our Excel spreadsheets and make use of a solid foundation in computational science. The course establishes this foundation by introducing data structures and algorithms used in everyday scientific computing using examples in the python scripting language. By the end of the Semester, students will be able to navigate the Linux command-line to go from a mathematical model to a numerical solution. Best practices for working with computer code and visualizing data will also be covered. == Textbooks == * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-0072-7 Beginning Python, Hetland, 2005] (eBook avail. from USF Library) * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-3238-4 Python Algorithms, Hetland, 2010] (eBook avail. from USF Library) * [http://aosabook.org/en/index.html The Architecture of Open Source Applications] * [http://docs.python.org Python Documentation] * [https://developers.google.com/edu/python/ Google Introductory Python Notes] Other (possibly useful) materials: * Chapters 7&8 of Modelling and Simulation, Birta and Arbez, Springer 2007 (eBook avail. from USF Library). * Chapters 4-6 of Models and Algorithms for Intelligent Data Analysis, Runkler, Springer 2012 (eBook avail. from USF Library). * Guide to Scientific Computing in C++, Francis and Whiteley, Springer, 2012. (eBook avail. from USF Library) * Extra info. On the basics: ** Chapters 3 and 7 of Mathematics in Computing, Regan, Springer 2013. (eBook avail. from USF Library) ** Instant feedback graphical programming with [https://www.khanacademy.org/cs/programming/ Khan Academy] * [http://www.meetup.com/python-178/ Local PyBulls Meetings] == Topics == # Languages #* bash (shell) #* python (scripting) #* stack & register-based machine languages: overview of C and Fortran syntax & compiling with gcc, ‘thread safety’ #* Shared libraries & language inter-operability (FFI) # Algorithms #* Horner’s algorithm for polynomials #* Newton’s root finding algo. #* Overview of general optimization algo-s (example: linear & nonlin. least-squares) #* Numerical integration (scripted, plus gnu ODE) #* Communication (how HTTP get/put works) # Data Structures #* Linked Lists #* Trees (file system hierarchies) #* Graphs #* Arrays (dense & sparse) example: vectors & rotations / transpositions, densities and difference operators # Presentation & visualization #* Flat CSV files (and excel) #* Working with binary data #* Python matplotlib (2D images) #* Binning histograms & weighted averages # Best Practices #* High-level code design (modularity, interface specifications, unit testing, etc.) #* Code audit: open-source libraries, ex. Gnu Scientific Library, qsort in libc, Boost #* Source code versioning (example: git or mercurial) #* gdb & execution profiling #* documentation #* Makefiles === Notes & Homework === * [[CompSciWeek1]] Aug. 25 * [[CompSciWeek2]] Sept. 1 * [[CompSciWeek3]] Sept. 8 * [[CompSciWeek4]] Sept. 15 * [[CompSciWeek5]] Sept. 22 * [[CompSciWeek6]] Sept. 29 * [[CompSciWeek7]] Oct. 6 * [[CompSciWeek8]] Oct. 13 * [[CompSciWeek9]] Oct. 20 * [[CompSciWeek10]] Oct. 27 * [[CompSciWeek11]] Nov. 3 * [[CompSciWeek12]] Nov. 10 * [[CompSciWeek13]] Nov. 17 * [[CompSciWeek14]] Nov. 24 * [[CompSciWeek14]] Dec. 1 37e242ef609cae759ac6ed2962c38beb1fceff9c 227 226 2014-09-29T15:15:55Z David M. Rogers 2 /* Notes & Homework */ wikitext text/x-wiki '''<BIG>Introduction to Scientific Computing</BIG>''' Course Info * Course Numbers CHM 4932/6938, CRN: 94314 * Credit Hours: 3 * Meeting Dates: Aug. 25 - Dec. 3, 2014 ** No Class Sept. 1 and Nov. 28 * Meeting Times: Mon. and Wed., 12:30-13:45 in SCA 222 ** Lab Session & Office Hours: Fri. 12:30-13:45 in SCA 222 * Assignments: ** [[#Notes & Homework|Weekly Homework]] (60%) ** Midterm Project (20%) *** Topic by Friday, Sept. 19 *** due Friday, Oct. 17, 2014 ** Final Project (20%) *** Topic by Friday, Nov. 14 *** due Friday, Dec. 5, 2014 == Overview == Mathematical models in the natural sciences take many shapes and forms. The moment they become more complicated than tracking a few variables over time, we have to put away our Excel spreadsheets and make use of a solid foundation in computational science. The course establishes this foundation by introducing data structures and algorithms used in everyday scientific computing using examples in the python scripting language. By the end of the Semester, students will be able to navigate the Linux command-line to go from a mathematical model to a numerical solution. Best practices for working with computer code and visualizing data will also be covered. == Textbooks == * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-0072-7 Beginning Python, Hetland, 2005] (eBook avail. from USF Library) * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-3238-4 Python Algorithms, Hetland, 2010] (eBook avail. from USF Library) * [http://aosabook.org/en/index.html The Architecture of Open Source Applications] * [http://docs.python.org Python Documentation] * [https://developers.google.com/edu/python/ Google Introductory Python Notes] Other (possibly useful) materials: * Chapters 7&8 of Modelling and Simulation, Birta and Arbez, Springer 2007 (eBook avail. from USF Library). * Chapters 4-6 of Models and Algorithms for Intelligent Data Analysis, Runkler, Springer 2012 (eBook avail. from USF Library). * Guide to Scientific Computing in C++, Francis and Whiteley, Springer, 2012. (eBook avail. from USF Library) * Extra info. On the basics: ** Chapters 3 and 7 of Mathematics in Computing, Regan, Springer 2013. (eBook avail. from USF Library) ** Instant feedback graphical programming with [https://www.khanacademy.org/cs/programming/ Khan Academy] * [http://www.meetup.com/python-178/ Local PyBulls Meetings] == Topics == # Languages #* bash (shell) #* python (scripting) #* stack & register-based machine languages: overview of C and Fortran syntax & compiling with gcc, ‘thread safety’ #* Shared libraries & language inter-operability (FFI) # Algorithms #* Horner’s algorithm for polynomials #* Newton’s root finding algo. #* Overview of general optimization algo-s (example: linear & nonlin. least-squares) #* Numerical integration (scripted, plus gnu ODE) #* Communication (how HTTP get/put works) # Data Structures #* Linked Lists #* Trees (file system hierarchies) #* Graphs #* Arrays (dense & sparse) example: vectors & rotations / transpositions, densities and difference operators # Presentation & visualization #* Flat CSV files (and excel) #* Working with binary data #* Python matplotlib (2D images) #* Binning histograms & weighted averages # Best Practices #* High-level code design (modularity, interface specifications, unit testing, etc.) #* Code audit: open-source libraries, ex. Gnu Scientific Library, qsort in libc, Boost #* Source code versioning (example: git or mercurial) #* gdb & execution profiling #* documentation #* Makefiles === Notes & Homework === * [[CompSciWeek1]] Aug. 25 * [[CompSciWeek2]] Sept. 1 * [[CompSciWeek3]] Sept. 8 * [[CompSciWeek4]] Sept. 15 * [[CompSciWeek5]] Sept. 22 * [[CompSciWeek6]] Sept. 29 * [[CompSciWeek7]] Oct. 6 * [[CompSciWeek8]] Oct. 13 (No class Fri., Oct. 17) * [[CompSciWeek9]] Oct. 20 * [[CompSciWeek10]] Oct. 27 * [[CompSciWeek11]] Nov. 3 * [[CompSciWeek12]] Nov. 10 * [[CompSciWeek13]] Nov. 17 * [[CompSciWeek14-15]] Nov. 24 (No class Fri., Nov. 28) * [[CompSciWeek14-15]] Dec. 1 36be9983dda9f1760a76b2d8c248bdebc3f5b9f0 228 227 2014-09-29T15:16:22Z David M. Rogers 2 wikitext text/x-wiki '''<BIG>Introduction to Scientific Computing</BIG>''' Course Info * Course Numbers CHM 4932/6938, CRN: 94314 * Credit Hours: 3 * Meeting Dates: Aug. 25 - Dec. 3, 2014 ** No Class Sept. 1, Oct. 17, and Nov. 28 * Meeting Times: Mon. and Wed., 12:30-13:45 in SCA 222 ** Lab Session & Office Hours: Fri. 12:30-13:45 in SCA 222 * Assignments: ** [[#Notes & Homework|Weekly Homework]] (60%) ** Midterm Project (20%) *** Topic by Friday, Sept. 19 *** due Friday, Oct. 17, 2014 ** Final Project (20%) *** Topic by Friday, Nov. 14 *** due Friday, Dec. 5, 2014 == Overview == Mathematical models in the natural sciences take many shapes and forms. The moment they become more complicated than tracking a few variables over time, we have to put away our Excel spreadsheets and make use of a solid foundation in computational science. The course establishes this foundation by introducing data structures and algorithms used in everyday scientific computing using examples in the python scripting language. By the end of the Semester, students will be able to navigate the Linux command-line to go from a mathematical model to a numerical solution. Best practices for working with computer code and visualizing data will also be covered. == Textbooks == * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-0072-7 Beginning Python, Hetland, 2005] (eBook avail. from USF Library) * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-3238-4 Python Algorithms, Hetland, 2010] (eBook avail. from USF Library) * [http://aosabook.org/en/index.html The Architecture of Open Source Applications] * [http://docs.python.org Python Documentation] * [https://developers.google.com/edu/python/ Google Introductory Python Notes] Other (possibly useful) materials: * Chapters 7&8 of Modelling and Simulation, Birta and Arbez, Springer 2007 (eBook avail. from USF Library). * Chapters 4-6 of Models and Algorithms for Intelligent Data Analysis, Runkler, Springer 2012 (eBook avail. from USF Library). * Guide to Scientific Computing in C++, Francis and Whiteley, Springer, 2012. (eBook avail. from USF Library) * Extra info. On the basics: ** Chapters 3 and 7 of Mathematics in Computing, Regan, Springer 2013. (eBook avail. from USF Library) ** Instant feedback graphical programming with [https://www.khanacademy.org/cs/programming/ Khan Academy] * [http://www.meetup.com/python-178/ Local PyBulls Meetings] == Topics == # Languages #* bash (shell) #* python (scripting) #* stack & register-based machine languages: overview of C and Fortran syntax & compiling with gcc, ‘thread safety’ #* Shared libraries & language inter-operability (FFI) # Algorithms #* Horner’s algorithm for polynomials #* Newton’s root finding algo. #* Overview of general optimization algo-s (example: linear & nonlin. least-squares) #* Numerical integration (scripted, plus gnu ODE) #* Communication (how HTTP get/put works) # Data Structures #* Linked Lists #* Trees (file system hierarchies) #* Graphs #* Arrays (dense & sparse) example: vectors & rotations / transpositions, densities and difference operators # Presentation & visualization #* Flat CSV files (and excel) #* Working with binary data #* Python matplotlib (2D images) #* Binning histograms & weighted averages # Best Practices #* High-level code design (modularity, interface specifications, unit testing, etc.) #* Code audit: open-source libraries, ex. Gnu Scientific Library, qsort in libc, Boost #* Source code versioning (example: git or mercurial) #* gdb & execution profiling #* documentation #* Makefiles === Notes & Homework === * [[CompSciWeek1]] Aug. 25 * [[CompSciWeek2]] Sept. 1 * [[CompSciWeek3]] Sept. 8 * [[CompSciWeek4]] Sept. 15 * [[CompSciWeek5]] Sept. 22 * [[CompSciWeek6]] Sept. 29 * [[CompSciWeek7]] Oct. 6 * [[CompSciWeek8]] Oct. 13 (No class Fri., Oct. 17) * [[CompSciWeek9]] Oct. 20 * [[CompSciWeek10]] Oct. 27 * [[CompSciWeek11]] Nov. 3 * [[CompSciWeek12]] Nov. 10 * [[CompSciWeek13]] Nov. 17 * [[CompSciWeek14-15]] Nov. 24 (No class Fri., Nov. 28) * [[CompSciWeek14-15]] Dec. 1 d85a3a2ac34abd594a644bdb2fdaf658e6a38808 237 228 2014-10-02T18:51:12Z David M. Rogers 2 wikitext text/x-wiki '''<BIG>Introduction to Scientific Computing</BIG>''' Course Info * Course Numbers CHM 4932/6938, CRN: 94314 * Credit Hours: 3 * Meeting Dates: Aug. 25 - Dec. 3, 2014 ** No Class Sept. 1, Oct. 17, and Nov. 28 * Meeting Times: Mon. and Wed., 12:30-13:45 in SCA 222 ** Lab Session & Office Hours: Fri. 12:30-13:45 in SCA 222 * Assignments: ** [[#Notes & Homework|Weekly Homework]] (60%) ** Midterm Project (20%) *** Topic by Friday, Sept. 19 *** due Friday, Oct. 17, 2014 ** Final Project (20%) *** Topic by Friday, Nov. 14 *** due Friday, Dec. 5, 2014 == Overview == Mathematical models in the natural sciences take many shapes and forms. The moment they become more complicated than tracking a few variables over time, we have to put away our Excel spreadsheets and make use of a solid foundation in computational science. The course establishes this foundation by introducing data structures and algorithms used in everyday scientific computing using examples in the python scripting language. By the end of the Semester, students will be able to navigate the Linux command-line to go from a mathematical model to a numerical solution. Best practices for working with computer code and visualizing data will also be covered. == Textbooks == * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-0072-7 Beginning Python, Hetland, 2005] (eBook avail. from USF Library) * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-3238-4 Python Algorithms, Hetland, 2010] (eBook avail. from USF Library) * [http://aosabook.org/en/index.html The Architecture of Open Source Applications] * [http://docs.python.org Python Documentation] * [https://developers.google.com/edu/python/ Google Introductory Python Notes] Other (possibly useful) materials: * Chapters 7&8 of Modelling and Simulation, Birta and Arbez, Springer 2007 (eBook avail. from USF Library). * Chapters 4-6 of Models and Algorithms for Intelligent Data Analysis, Runkler, Springer 2012 (eBook avail. from USF Library). * Guide to Scientific Computing in C++, Francis and Whiteley, Springer, 2012. (eBook avail. from USF Library) * Extra info. On the basics: ** Chapters 3 and 7 of Mathematics in Computing, Regan, Springer 2013. (eBook avail. from USF Library) ** Instant feedback graphical programming with [https://www.khanacademy.org/cs/programming/ Khan Academy] * [http://www.meetup.com/python-178/ Local PyBulls Meetings] Interactive Interpreters: * [http://www.codewars.com CodeWars] Recommended for building experience with practice problems. * [http://exercism.io Exercism] A command-line client with a similar learn-through-challenge philosophy. * [http://repl.it repl.it] A read-eval-print loop for several computer languages. * [http://en.cppreference.com/w/cpp/language] Documentation with an online evaluator for C++ code. == Topics == # Languages #* bash (shell) #* python (scripting) #* stack & register-based machine languages: overview of C and Fortran syntax & compiling with gcc, ‘thread safety’ #* Shared libraries & language inter-operability (FFI) # Algorithms #* Horner’s algorithm for polynomials #* Newton’s root finding algo. #* Overview of general optimization algo-s (example: linear & nonlin. least-squares) #* Numerical integration (scripted, plus gnu ODE) #* Communication (how HTTP get/put works) # Data Structures #* Linked Lists #* Trees (file system hierarchies) #* Graphs #* Arrays (dense & sparse) example: vectors & rotations / transpositions, densities and difference operators # Presentation & visualization #* Flat CSV files (and excel) #* Working with binary data #* Python matplotlib (2D images) #* Binning histograms & weighted averages # Best Practices #* High-level code design (modularity, interface specifications, unit testing, etc.) #* Code audit: open-source libraries, ex. Gnu Scientific Library, qsort in libc, Boost #* Source code versioning (example: git or mercurial) #* gdb & execution profiling #* documentation #* Makefiles === Notes & Homework === * [[CompSciWeek1]] Aug. 25 * [[CompSciWeek2]] Sept. 1 * [[CompSciWeek3]] Sept. 8 * [[CompSciWeek4]] Sept. 15 * [[CompSciWeek5]] Sept. 22 * [[CompSciWeek6]] Sept. 29 * [[CompSciWeek7]] Oct. 6 * [[CompSciWeek8]] Oct. 13 (No class Fri., Oct. 17) * [[CompSciWeek9]] Oct. 20 * [[CompSciWeek10]] Oct. 27 * [[CompSciWeek11]] Nov. 3 * [[CompSciWeek12]] Nov. 10 * [[CompSciWeek13]] Nov. 17 * [[CompSciWeek14-15]] Nov. 24 (No class Fri., Nov. 28) * [[CompSciWeek14-15]] Dec. 1 d94a554e8e82e497839a369c3c0a1863cdf73ab8 238 237 2014-10-02T18:51:44Z David M. Rogers 2 /* Textbooks */ wikitext text/x-wiki '''<BIG>Introduction to Scientific Computing</BIG>''' Course Info * Course Numbers CHM 4932/6938, CRN: 94314 * Credit Hours: 3 * Meeting Dates: Aug. 25 - Dec. 3, 2014 ** No Class Sept. 1, Oct. 17, and Nov. 28 * Meeting Times: Mon. and Wed., 12:30-13:45 in SCA 222 ** Lab Session & Office Hours: Fri. 12:30-13:45 in SCA 222 * Assignments: ** [[#Notes & Homework|Weekly Homework]] (60%) ** Midterm Project (20%) *** Topic by Friday, Sept. 19 *** due Friday, Oct. 17, 2014 ** Final Project (20%) *** Topic by Friday, Nov. 14 *** due Friday, Dec. 5, 2014 == Overview == Mathematical models in the natural sciences take many shapes and forms. The moment they become more complicated than tracking a few variables over time, we have to put away our Excel spreadsheets and make use of a solid foundation in computational science. The course establishes this foundation by introducing data structures and algorithms used in everyday scientific computing using examples in the python scripting language. By the end of the Semester, students will be able to navigate the Linux command-line to go from a mathematical model to a numerical solution. Best practices for working with computer code and visualizing data will also be covered. == Textbooks == * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-0072-7 Beginning Python, Hetland, 2005] (eBook avail. from USF Library) * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-3238-4 Python Algorithms, Hetland, 2010] (eBook avail. from USF Library) * [http://aosabook.org/en/index.html The Architecture of Open Source Applications] * [http://docs.python.org Python Documentation] * [https://developers.google.com/edu/python/ Google Introductory Python Notes] Other (possibly useful) materials: * Chapters 7&8 of Modelling and Simulation, Birta and Arbez, Springer 2007 (eBook avail. from USF Library). * Chapters 4-6 of Models and Algorithms for Intelligent Data Analysis, Runkler, Springer 2012 (eBook avail. from USF Library). * Guide to Scientific Computing in C++, Francis and Whiteley, Springer, 2012. (eBook avail. from USF Library) * Extra info. On the basics: ** Chapters 3 and 7 of Mathematics in Computing, Regan, Springer 2013. (eBook avail. from USF Library) ** Instant feedback graphical programming with [https://www.khanacademy.org/cs/programming/ Khan Academy] * [http://www.meetup.com/python-178/ Local PyBulls Meetings] Interactive Interpreters: * [http://www.codewars.com CodeWars] Recommended for building experience with practice problems. * [http://exercism.io Exercism] A command-line client with a similar learn-through-challenge philosophy. * [http://repl.it repl.it] A read-eval-print loop for several computer languages. * [http://en.cppreference.com/w/cpp/language CppReference] Documentation with an online evaluator for C++ code. == Topics == # Languages #* bash (shell) #* python (scripting) #* stack & register-based machine languages: overview of C and Fortran syntax & compiling with gcc, ‘thread safety’ #* Shared libraries & language inter-operability (FFI) # Algorithms #* Horner’s algorithm for polynomials #* Newton’s root finding algo. #* Overview of general optimization algo-s (example: linear & nonlin. least-squares) #* Numerical integration (scripted, plus gnu ODE) #* Communication (how HTTP get/put works) # Data Structures #* Linked Lists #* Trees (file system hierarchies) #* Graphs #* Arrays (dense & sparse) example: vectors & rotations / transpositions, densities and difference operators # Presentation & visualization #* Flat CSV files (and excel) #* Working with binary data #* Python matplotlib (2D images) #* Binning histograms & weighted averages # Best Practices #* High-level code design (modularity, interface specifications, unit testing, etc.) #* Code audit: open-source libraries, ex. Gnu Scientific Library, qsort in libc, Boost #* Source code versioning (example: git or mercurial) #* gdb & execution profiling #* documentation #* Makefiles === Notes & Homework === * [[CompSciWeek1]] Aug. 25 * [[CompSciWeek2]] Sept. 1 * [[CompSciWeek3]] Sept. 8 * [[CompSciWeek4]] Sept. 15 * [[CompSciWeek5]] Sept. 22 * [[CompSciWeek6]] Sept. 29 * [[CompSciWeek7]] Oct. 6 * [[CompSciWeek8]] Oct. 13 (No class Fri., Oct. 17) * [[CompSciWeek9]] Oct. 20 * [[CompSciWeek10]] Oct. 27 * [[CompSciWeek11]] Nov. 3 * [[CompSciWeek12]] Nov. 10 * [[CompSciWeek13]] Nov. 17 * [[CompSciWeek14-15]] Nov. 24 (No class Fri., Nov. 28) * [[CompSciWeek14-15]] Dec. 1 9843c5054bfe8762497734a7054fe9e15122d748 Publications 0 8 230 155 2014-09-30T02:02:41Z David M. Rogers 2 wikitext text/x-wiki {| cellpadding="4" style="border: 1px solid darkgray;" |- style="border: 1px solid darkgray;" || David M. Rogers. "Silmaril, A Functional Language for Distributed Parallel Evaluation." [http://predictivestatmech.org/sil/papers/sil.pdf Submitted version] |- style="border: 1px solid darkgray;" || Mathias B. Andersen, David M. Rogers, Junyu Mai, Benjamin Schudel, Anson V. Hatch, Susan B. Rempe and Ali Mani. "Spatiotemporal pH dynamics in concentration polarization near ion-selective membranes." [http://dx.doi.org/10.1021/la5014297 Langmuir, 30(26):7902–7912, 2014] |- style="border: 1px solid darkgray;" || W. K. Chan, P. L. Lorenzi, A. Anishkin, P. Purwaha, D. M. Rogers, S. Sukharev, S.B. Rempe, and J. N. Weinstein. "The glutaminase activity of l-asparaginase is not required for anticancer activity against ASNS-negative cells." [http://dx.doi.org/10.1182/blood-2013-10-535112 Blood. 123(23):3596-606, 2014]. |- style="border: 1px solid darkgray;" || David M. Rogers, Dian Jiao, Lawrence Pratt, and Susan B. Rempe. "Structural Models and Molecular Thermodynamics of Hydration of Ions and Small Molecules" [http://dx.doi.org/10.1016/B978-0-444-59440-2.00004-1 Annu. Rep. Comp. Chem. 8:71–127, 2012.] |- style="border: 1px solid darkgray;" || David M. Rogers and Susan B. Rempe. "Irreversible Thermodynamics." [http://dx.doi.org/10.1088/1742-6596/402/1/012014 J. Phys.: Conf. Ser. 402:012014, 2012]. |- style="border: 1px solid darkgray;" || David M. Rogers, Thomas L. Beck, and Susan B. Rempe. [[Media:Dmroge_InfoNonequ2011.pdf|"An Information Theory Approach to Nonlinear, Nonequilibrium Thermodynamics."]] [http://dx.doi.org/10.1007/s10955-011-0358-9 J. Stat. Phys. 145(2):385-409, 2011] We show how the interpretation of thermodynamic states as representing system information leads naturally to thermodynamic cycles and the first and second laws of thermodynamics as well as similar formulations for nontrivial nonequilibrium problems. The logical development of the theory also leads naturally to correct indistinguishability factors in the partition function. |- style="border: 1px solid darkgray;" || Sameer Varma, David M. Rogers, Lawrence R. Pratt, and Susan B. Rempe. "Perspectives on Ion Selectivity: Design Principles for K+ Selectivity in Membrane Transport." [http://jgp.rupress.org/content/137/6/479.full J. Gen. Physiol., 137(6):479-488, 2011.] We review the development of models for understanding the physical basis of selectivity for K+ ions over Na+, its sibling only one row behind, in membrane channels and transporters. Although the problem is subtle because of the morass of competing effects, we emphasize work analyzing the systematic influence of the environment on tipping local binding site structure toward selective configurations. |- style="border: 1px solid darkgray;" || David M. Rogers and Susan B. Rempe. [http://www.ncbi.nlm.nih.gov/pmc/articles/PMC3443978/ “Probing the Thermodynamics of Competitive Ion Binding Using Minimum Energy Structures.”] [http://dx.doi.org/10.1021/jp2012864 J. Phys. Chem. B, 115(29):9116-29, 2011]. We presented an extension of the Quasi-Chemical theory for quantifying the impact of local structure on ion complexation thermodynamics. The theory can be simply represented using a set of thermodynamic cycles involving binding site structural and compositional states as reaction intermediates. |- style="border: 1px solid darkgray;" || Susan B. Rempe and David M. Rogers; et. al. “Computational and experimental platform for understanding and optimizing water flux and salt rejection in nanoporous membranes.” [http://prod.sandia.gov/techlib/access-control.cgi/2010/106735.pdf Sandia Technical Report, SAND2010-6735, 2010.] We summarize work on designing polymer coatings for salt exclusion in water transporting nanopores. In this work, I collected available molecular dynamics results for these systems and performed a novel energy efficiency analysis able to relate atomistic and experimental scales as well as identify important design goals and chemical principles for material performance. |- style="border: 1px solid darkgray;" || David M. Rogers, [http://rave.ohiolink.edu/etdc/view?acc_num=ucin1251832030 ''''Using Bayes' Theorem for Free Energy Calculations''''], 2009. We investigated the central quantity of free energies in a Bayesian context and provide estimators for solvation free energies as well as optimal potential of mean force approximations to model polymer coarse-grained dynamics from atomistic simulations. |- style="border: 1px solid darkgray;" || Zhen Zhao, David M. Rogers and Thomas L. Beck. "Polarization and Charge Transfer in the Hydration of Chloride Ions." [http://link.aip.org/link/?JCP/132/014502/1 J. Chem. Phys., 132:014502, 2010.] Dr. Zhao's ab-initio analysis of the charge distribution in water-ion clusters highlighted the importance of many-body water-water interactions and charge transfer effects in determining cluster structural and energetic properties. These are still challenging to represent in modern polarizable forcefields and have implications for anion properties at interfaces. |- style="border: 1px solid darkgray;" || David M. Rogers and Thomas L. Beck. "Quasi-Chemical and Structural Analysis of Polarizable Anion Hydration." [http://link.aip.org/link/?JCP/132/014505/1 J. Chem. Phys., 132:014505, 2010.] The role of polarizability in forcefield-based models of ions and water was examined. Utilizing some of our recent developments on quasi-chemical theory, we have been able to quantify the tightened, asymmetric nature of the ion's local solvation waters induced by increased polarizability as well as the exact effects of polarization on the solvation free energy. The results suggest some potential problems and diagnostics for such models. |- style="border: 1px solid darkgray;" || David M. Rogers and Thomas L. Beck. [http://forcesolve.sourceforge.net/ Force Solve] (Sourceforge, Chicago IL, 2008). This force matching software implements and tests coarse-graining for general molecular systems in a mere 4000 lines of code. It is able to parametrize coarse Hamiltonians from atomic trajectory data given arbitrary definitions of coarse united-atom type models as well as carry out short Langevin Dynamics simulations on the coarse scale. The program's main drawbacks are its slow speed and high memory usage due to its simplistic design, attributable to the interpreted nature of python. |- style="border: 1px solid darkgray;" || David M. Rogers and Thomas L. Beck. "Resolution and Scale Independent Nonparametric Function Matching Using a String Energy Penalized Spline Prior." 2008. [http://arxiv.org/abs/1003.4741 arXiv:1003.4741v1] (stat.ML). Fresh insight is provided into long-standing mathematical issues surrounding computational modeling of continuous functions from a few sampled data points. The present research lays the groundwork for predicting the behavior of complicated many-body systems using advanced regression techniques. |} 4846d4a00cbbdc253d80022926ffec8784c800d9 Code:SGE 0 32 240 115 2014-10-06T16:40:19Z David M. Rogers 2 wikitext text/x-wiki == User environment == Zeroth, set up your own system (for linux), by adding a host def for circe to your '''$HOME/.ssh/config''' file. Then you don't have to keep typing in circe's full path and your username when running ssh from linux. Host circe User <username on circe> Hostname circe.rc.usf.edu ServerAliveInterval 30 ServerAliveCountMax 120 ForwardX11 yes You may need: chmod 600 $HOME/.ssh/config On circe, first, setup your user environment by creating/editing a '''$HOME/.bashrc''' <source lang="bash"> # .bashrc # Source global definitions if [ -f /etc/bashrc ]; then . /etc/bashrc fi # User specific aliases and functions alias mystat="qstat -u $USER -t" </source> Then create $HOME/.bash_profile, which is run for interactive, login sessions on circe. <source lang="bash"> # .bash_profile # Get the aliases and functions if [ -f ~/.bashrc ]; then . ~/.bashrc fi # User specific environment and startup programs PATH=$PATH:$HOME/bin #module load compilers/intel/11.1.064 mpi/openmpi-1.4.1/intel-11.1.064 module purge module load compilers/intel/11.1.064 mpi/openmpi-1.4.1/intel-11.1.064 apps/cuda/5.0.35 # apps/nwchem/6.1.1 #module load apps/namd/2.7 apps/iso2mesh/0.8.0 apps/netcdf/4.2.0 apps/gaussian/03e01_em64t apps/gromacs/4.5.5a export PATH </source> == Queue == Here's a basic template for queuing a job using MPI (here 4 cpus and 6h max run-time). <source lang="bash"> #$ -N a-test-job #$ -cwd #$ -o job-$JOB_ID.out #$ -e job-$JOB_ID.err #$ -l pcpus=4,h_rt=06:00:00 # Example minimum memory request: #$ -l mpj=10G # Max run-time sets queue: # queue max run-time # devel 1 hour # short 6 hours # medium 2 day # long 1 week mpirun parallel-executable </source> Submit with <source lang="bash"> qsub job.sh </source> For execution and status, use '''qstat''', or the '''mystat''' command, defined as an alias in '''.bashrc'''. For more info, see [https://cwa.rc.usf.edu/projects/research-computing/wiki/Guide_to_GridEngine the CIRCE SGE guide.] Here's a run-down on the environment variables available during running (for scripting): <source lang="bash"> # Environment Menu: # $JOB_ID: The job number assigned by the scheduler to your job # 1844896 # $JOBDIR: The directory your job is currently running in # <blank> # $USER: The username of the person currently running the job # anyuser # $TMPDIR: The directory containing informational files about the job e.g. the machines allocated to run the job, etc. # /tmp/1844896.1.default # $SGE_O_WORKDIR: Similar to $JOBDIR # /home/a/anyuser/test # $HOME: User's home directory on execution machine # /home/d/anyuser # $JOB_NAME: The job name specified by -N option # a-test-job # $HOSTNAME: Name of execution host # wh-520-7-5.rc.usf.edu # $TASK_ID: You can submit array jobs. This would be the TASK number in the array job of the current task # <blank> # $SGE_CELL: SGE cell that the job is currently running in # default # $SGE_O_SHELL: Invoking shell of the current SGE job # /bin/bash # $QUEUE: Current running queue # default </source> 2318143c488a30465d91da7973b5032ee5524690 Code 0 18 249 205 2014-10-13T18:15:20Z David M. Rogers 2 /* Templates */ wikitext text/x-wiki == Tutorials == When learning a new language, once you've memorized the words, you need to start conversing. Unfortunately, source code is not spoken. It's a stillborn language. One of the best ways to code well is to study and modify other, good code. For code, this means reading and tweaking tutorials first, then design patterns, then large-scale projects next. * [http://matt.might.net/articles/bash-by-example Bash By Example] * [http://docs.python.org/3/tutorial/datastructures.html Data Structures in Python] * [http://www.u.arizona.edu/~erdmann/mse350/topics/basic_linear_algebra.html Linear Algebra in Numpy] Remember that it's not enough to just read them. It's actually a positive waste of time. Rather, you have to do some run-tweak-run-debug development cycles with them. == C Libraries == With the exception of the standard libraries and the [http://www.gnu.org/software/gsl/ GNU Scientific Library], there are surprisingly few of these about. Here are some generics that we've implemented and are sharing under the GPL. Robust map and red/black tree code has recently been published to [https://github.com/frobnitzem?tab=repositories github]. == Python Libraries == * [[Code:networkx|Networkx]] a quick guide. === Geometric Algebra === The [http://www.predictivestatmech.org/code/galg.py Multivector] class implements geometric algebra using Python's operator overloading. It works with minimal space for any number of spatial dimensions, since it's not based on the matrix / spinor representation of Clifford algebra. Instead, it takes the basis blade approach recommended by Dorst, Fondijne, and Mann [http://www.geometricalgebra.net]. It's really just as easy as ordering all the basis vectors, and keeping track of the commutator (+/- <math>\hat 1</math>). == Templates == The real world has forms, computation has templates. Pick one up, fill in the blanks, and send it down the chute. * [[NWChem|NWChem Jobs]] * [[Code:SLURM|Slurm (USF Circe)]] * [[Code:SGE|SGE (USF Circe)]] * [[Code:text2pdf|Text conversion using text2pdf]] == Efficiencies == To chop a tree quickly, spend twice the time sharpening your axe. * [[Vimrc|vimrc files]] == Code Humor == Put this into your makefile: <source lang=bash> Clint\ Eastwood: myday echo "I feel great!" </source> 8e4425603be64668402f8af4f9adcf788456f94e 256 249 2014-10-21T18:00:56Z David M. Rogers 2 /* Python Libraries */ wikitext text/x-wiki == Tutorials == When learning a new language, once you've memorized the words, you need to start conversing. Unfortunately, source code is not spoken. It's a stillborn language. One of the best ways to code well is to study and modify other, good code. For code, this means reading and tweaking tutorials first, then design patterns, then large-scale projects next. * [http://matt.might.net/articles/bash-by-example Bash By Example] * [http://docs.python.org/3/tutorial/datastructures.html Data Structures in Python] * [http://www.u.arizona.edu/~erdmann/mse350/topics/basic_linear_algebra.html Linear Algebra in Numpy] Remember that it's not enough to just read them. It's actually a positive waste of time. Rather, you have to do some run-tweak-run-debug development cycles with them. == C Libraries == With the exception of the standard libraries and the [http://www.gnu.org/software/gsl/ GNU Scientific Library], there are surprisingly few of these about. Here are some generics that we've implemented and are sharing under the GPL. Robust map and red/black tree code has recently been published to [https://github.com/frobnitzem?tab=repositories github]. == Python Libraries == * [[Code:libnwchem|libnwchem]] A patch against Nwchem 6.5 to build its functionality as a shared library, along with glue code for access using python ctypes. * [[Code:networkx|Networkx]] a quick guide. === Geometric Algebra === The [http://www.predictivestatmech.org/code/galg.py Multivector] class implements geometric algebra using Python's operator overloading. It works with minimal space for any number of spatial dimensions, since it's not based on the matrix / spinor representation of Clifford algebra. Instead, it takes the basis blade approach recommended by Dorst, Fondijne, and Mann [http://www.geometricalgebra.net]. It's really just as easy as ordering all the basis vectors, and keeping track of the commutator (+/- <math>\hat 1</math>). == Templates == The real world has forms, computation has templates. Pick one up, fill in the blanks, and send it down the chute. * [[NWChem|NWChem Jobs]] * [[Code:SLURM|Slurm (USF Circe)]] * [[Code:SGE|SGE (USF Circe)]] * [[Code:text2pdf|Text conversion using text2pdf]] == Efficiencies == To chop a tree quickly, spend twice the time sharpening your axe. * [[Vimrc|vimrc files]] == Code Humor == Put this into your makefile: <source lang=bash> Clint\ Eastwood: myday echo "I feel great!" </source> a342fd90468af3f547d444d308517cf8eac79cee Code:SLURM 0 54 250 2014-10-13T18:34:37Z David M. Rogers 2 Created page with "== User environment == Zeroth, set up your own system (for linux), by adding a host def for circe to your '''$HOME/.ssh/config''' file. Then you don't have to keep typing in cir…" wikitext text/x-wiki == User environment == Zeroth, set up your own system (for linux), by adding a host def for circe to your '''$HOME/.ssh/config''' file. Then you don't have to keep typing in circe's full path and your username when running ssh from linux. Host rc User <username on circe> Hostname rcslurm.rc.usf.edu ServerAliveInterval 30 ServerAliveCountMax 120 ForwardX11 yes You may need: mkdir -p $HOME/.ssh && chmod 700 $HOME/.ssh vi $HOME/.ssh/config # ':q' to exit chmod 600 $HOME/.ssh/config The slurm job status command is squeue. A helpful alias to monitor your own jobs is, alias myq="squeue -u $USER" == Queue == Here's a basic template for queuing a job using MPI (here 2 whole nodes and 6h max run-time). <source lang="bash"> #!/bin/bash #SBATCH -J test #SBATCH -N 2 -t 6:00:00 module load mpi/openmpi/1.4.5 compilers/intel/11.1.064 start=`date +%s` mpirun parallel-executable end=`date +%s` echo "Job completed in $((end-start)) seconds." </source> By default, slurm jobs start in the same directory that sbatch was invoked. A few more useful options are: #SBATCH -o output_log_name.log #SBATCH --mem=2000 These will specify the name of the output log file instead of the default () Submit with <source lang="bash"> sbatch -p saturn job.sh </source> The '''-p saturn''' is the default and can be left out. Other possible values select different node partitions, and are: * "jupiter": 444 cores; preemptable by "deadline" QOS (currently inactive). * "saturn": 280 cores; default; preemptable by "deadline" QOS (currently inactive). * "neptune": 168 cores; preemptable by "deadline" QOS (currently inactive). * "hii_broad": 80 cores; testing "contributor" hardware pool; preemptable by "hii_broad" QOS (active). * "titan": 16 cores; no preemption; 128 GB RAM for large memory jobs. * "pluto": 8 cores; no preemption. For execution and status, use '''squeue''', or the '''myq''' command, defined above as an alias in '''.bashrc'''. For more info, see [https://computing.llnl.gov/linux/slurm/quickstart.html LLNL's Slurm Quickstart Guide]. Here's a run-down on some of the environment variables available during running (for scripting) see sbatch's manpage for more: * SLURM_JOB_NAME - Name of the job. * SLURM_JOB_ID - The ID of the job allocation. * SLURM_CPUS_ON_NODE - Number of CPUS on the allocated node. * SLURM_JOB_NODELIST - List of nodes allocated to the job in a compressed format. * SLURM_JOB_NUM_NODES - Total number of nodes in the job’s resource allocation. * SLURM_JOB_CPUS_PER_NODE - Count of processors available to the job on this node. * SLURM_SUBMIT_DIR - The directory from which sbatch was invoked. * SLURM_JOB_PARTITION - Name of the partition in which the job is running. * SLURM_LOCALID - Node local task ID for the process within a job. * SLURM_GTIDS - Global task IDs running on this node. Zero origin and comma separated. 02b9f9a51447453708b79d22488728f2ac923bae 251 250 2014-10-13T18:38:02Z David M. Rogers 2 wikitext text/x-wiki == User environment == Zeroth, set up your own system (for linux), by adding a host def for circe to your '''$HOME/.ssh/config''' file. Then you don't have to keep typing in circe's full path and your username when running ssh from linux. Host rc User <username on circe> Hostname rcslurm.rc.usf.edu ServerAliveInterval 30 ServerAliveCountMax 120 ForwardX11 yes You may need: mkdir -p $HOME/.ssh && chmod 700 $HOME/.ssh vi $HOME/.ssh/config # ':q' to exit chmod 600 $HOME/.ssh/config The slurm job status command is squeue. A helpful alias to monitor your own jobs is, alias myq="squeue -u $USER" == Queue == Here's a basic template for queuing a job using MPI (here 2 whole nodes and 6h max run-time). <source lang="bash"> #!/bin/bash #SBATCH -J test #SBATCH -N 2 -t 6:00:00 module load mpi/openmpi/1.4.5 compilers/intel/11.1.064 start=`date +%s` mpirun parallel-executable end=`date +%s` echo "Job completed in $((end-start)) seconds." </source> By default, slurm jobs start in the same directory that sbatch was invoked. A few more useful options are: #SBATCH -o output_log_name.log #SBATCH --mem=2000 These will specify the name of the output log file instead of the default (names auto-generated from the job number, e.g. '''slurm-22425.out'''). By default, the log files include both standard output and standard error from the job. Submit with <source lang="bash"> sbatch -p saturn job.sh </source> The '''-p saturn''' selects the default queue and can be left out. Other possible values select different node partitions, and are: * "jupiter": 444 cores; preemptable by "deadline" QOS (currently inactive). * "saturn": 280 cores; default; preemptable by "deadline" QOS (currently inactive). * "neptune": 168 cores; preemptable by "deadline" QOS (currently inactive). * "hii_broad": 80 cores; testing "contributor" hardware pool; preemptable by "hii_broad" QOS (active). * "titan": 16 cores; no preemption; 128 GB RAM for large memory jobs. * "pluto": 8 cores; no preemption. For execution and status, use '''squeue''', or the '''myq''' command, defined above as an alias in '''.bashrc'''. For more info, see [https://computing.llnl.gov/linux/slurm/quickstart.html LLNL's Slurm Quickstart Guide]. Here's a run-down on some of the environment variables available during running (for scripting) see sbatch's manpage for more: * SLURM_JOB_NAME - Name of the job. * SLURM_JOB_ID - The ID of the job allocation. * SLURM_CPUS_ON_NODE - Number of CPUS on the allocated node. * SLURM_JOB_NODELIST - List of nodes allocated to the job in a compressed format. * SLURM_JOB_NUM_NODES - Total number of nodes in the job’s resource allocation. * SLURM_JOB_CPUS_PER_NODE - Count of processors available to the job on this node. * SLURM_SUBMIT_DIR - The directory from which sbatch was invoked. * SLURM_JOB_PARTITION - Name of the partition in which the job is running. * SLURM_LOCALID - Node local task ID for the process within a job. * SLURM_GTIDS - Global task IDs running on this node. Zero origin and comma separated. b23b51f51f008423f9ee28583a8b06c2a095ed4f CompSciWeek4 0 44 252 209 2014-10-13T20:50:20Z David M. Rogers 2 /* Class 1: Formal Proofs */ wikitext text/x-wiki = Reading Assignment = * Algorithms, Chapter 2-3 = Class 1: Formal Proofs = * Complexity Notation * Rules - state assumptions, use logical operations on assumptions * Modus Ponens - (a, a =>b) => b * Modus Tollens - (a => b, ~b) => ~a * Disjunctive Syllogism - ((a v b), ~a) => b * Contradiction - (a, ~a) => Yikes! ex. from 1+1 = 1, prove that I am the Pope. A: The Pope and I make 2, but 1+1 = 1, so I and the Pope are one and the same. ** This is a famous argument from the Cambridge mathematician G. H. Hardy, written to satisfy J. E. McTaggart's doubt that anything can be proven from a false proposition. It was cited in the first chapter of Sir Harold Jeffreys' "Scientific Inference" and in a discussion discounting set theory in appendix B to Jaynes "Probability Theory, the Logic of Science." ** Anything that proves a false statement is false. ** If a then False => ~a * Induction = Class 2: Code Profiling Examples = * Creating and loading a module * formatting the results as a flat text file * reading text files into arrays (numpy) and plotting (pylab) == Profiling and Plotting Code == '''lib/ltime.py''' <source lang="python"> # Functions to time from random import random def lappend(n): l = [1]*n l.append(random()) def lmod(n): l = [1]*n l[0] = random() def make_list(n): l = [1]*n def rand(n): random() </source> Make sure that PYTHONPATH includes your '''lib''' directory (where ltime.py lives), e.g. PYTHONPATH=/usr/lib/python2.7/site-packages:$HOME/scicomp/lib '''time.sh''' <source lang="bash"> #!/bin/bash if [ $# -ne 1 ]; then echo "Usage: $0 <function name from ltime.py>" exit 1 fi cmd=$1 k=1 for((n=1;n<8;n++)); do echo -n "$k " python -m timeit -s"import ltime as m;" "m.$cmd($k)" | sed 's/.*[^0-9]\([0-9]*\.\)/\1/; s/ usec.*//;' k=$(($k*2)) done </source> '''analyze.py''' <source lang="python"> from numpy import * import sys, pylab assert len(sys.argv) == 2, "Usage: %s <function name>"%sys.argv[0] name = sys.argv[1] x = fromfile(name+".dat", sep=' ') x = reshape(x, (-1,2)) pylab.plot(x[:,0], x[:,1]) pylab.savefig(name+".png") </source> Both the shell and python scripts above have been modified from the version in class to show how to read command-line arguments. In the shell, the number of arguments is in the variable '''$#''', and the '''if''' statement checks for the right usage. '''$0''' is the program name and ''is not'' counted in '''$#'''. In python, the arguments are in the list, sys.argv, sys.argv[0] is the program name, and ''is'' counted in len(sys.argv). The '''assert''' statement checks for the right usage, and immediately terminates with an error (raises an AssertionError exception) if the assertion fails. = Homework 3 - due Monday, Sept. 29 = * Coding Problems ** Write a code to build a graph representation of what's inside the /usr/share/X11 directory on circe. Use (os.walk and/or os.listdir, os.path.join). see [[Code:networkx|example graph representation]] **# How many directories are there total? **# What is the maximum depth, counting files and dirs so the depth of a dir with no files/subdirs = 0, and with any files/subdirs = 1? **# How many references are there to each directory -- node in-degree? (ignore symlinks) **# What is the maximum number of references from a directory (i.e. maximum out- degree)? * Problems from Algorithms in Python: ** 2-4 (read the text definition of big-O notation) ** 2-7 (write and turn in a test code for each case mentioned -- see above) You should show the test function you used and write the answer to the question in big-O (or theta) notation, e.g. list append was tested with "def lappend(n): l = [1]*n; l.append(1);" and the append operation takes constant time, O(1). ** 2-10 *** The question describes a binary tree. Internal nodes are nodes with two children. Leaf nodes have no children. Try drawing some trees to get a sense of the answer for this one. ** 2-12 The idea of weighted edges is to add information to the graph, e.g. 42 steps between node u and node v. *** Specifically, explain how looking up children of a given node would work in this representation (how complicated is finding all children of node 'u'). 13bbf004b4286318fd66faa1bc5310cbd54dc2b6 Code:libnwchem 0 55 257 2014-10-21T18:42:48Z David M. Rogers 2 Created page with "Libnwchem is a patch to the [http://www.nwchem-sw.org/index.php/Download#Patches_for_the_26243_revision_of_NWChem_6.5 6.5 Revision of NWChem] that adds three useful features. # …" wikitext text/x-wiki Libnwchem is a patch to the [http://www.nwchem-sw.org/index.php/Download#Patches_for_the_26243_revision_of_NWChem_6.5 6.5 Revision of NWChem] that adds three useful features. # push_inp_string and pop_inp_string (nw_inp_from_file.F) to fake string input as input from an nwchem parameter file #* push_inp_cstring (push_inp_cstring.c) to provide a 0-terminated c-string interface to same # an nwchem_init function (libnwchem.F) to perform the start-up tasks of nwchem and return its runtime database #* a libnwchem target to the GNUMakefile (sorry, no cygwin right now) # nwchem.py, rtdb.py and related python wrappers to call nwchem's top-level functions and handle io from the rtdb #* various fixes to error handling in rtdb == Obtaining == You can download the patch [http://predictivestatmech.org/libnwchem-6.5.patch here]. Next, get the nwchem sources from the link at the top of the page. To unpack and patch them, use <source> tar xjf Nwchem-6.5.revision26243-src.2014-09-10.tar.bz2 mv Nwchem-6.5.revision26243-src nwchem-6.5 cd nwchem-6.5 patch -p1 <../libnwchem-6.5.patch bash ../build-6.5.sh # the build-6.5.sh script is at the bottom of this page. </source> The mv line is really required, since nwchem's build can fail if the path to the source directory is too long! == Compilation == For most Linux systems (but not BSD-based OSX), the -fPIC flag is required. This is such a PITA to add to nwchem's compilation that my solution is an ugly hack. Replace the real compiler with a shell script in your $HOME/bin directory, and make sure your path has $HOME/bin in front of all other directories. (for icc) <source lang="bash"> #!/bin/sh # file $HOME/bin/icc /opt/intel/bin/icc -fPIC $@ </source> (or gcc) <source lang="bash"> #!/bin/sh # file $HOME/bin/gcc /usr/bin/gcc -fPIC $@ </source> I use the following script for compiling NWChem: (on 64-bit Linux with icc) <source lang="bash"> #!/bin/bash # file build-6.5.sh export NWCHEM_TOP=$HOME/build/nwchem-6.5 export NWCHEM_TARGET=LINUX64 export NWCHEM_MODULES=all export USE_MPI=y export USE_MPIF=y export USE_MPIF4=y export MPI_LIB=/apps/openmpi/1.4.5/lib export MPI_INCLUDE=/apps/openmpi/1.4.5/include export LIBMPI="-lpthread -lmpi_f90 -lmpi_f77 -lmpi -lopen-rte -lopen-pal -lrdmacm -libverbs -lpsm_infinipath -lnuma -ldl -Wl,--export-dynamic -lnsl -lutil -lm -ldl" export ARMCI_NETWORK=OPENIB # export IB_INCLUDE <Location of Infiniband libraries>/include export MSG_COMMS=MPI export CC=icc export FCC=ifort export FOPTIMIZE="-O2 -fPIC" export FFLAGS="-O2 -fPIC" export CFLAGS="-O2 -fPIC" export MKLROOT=/apps/intel/mkl # see intel's link-line advisor for generating the next line. Use the options for single dynamic library. (this is for MKL 10.3.6 with icc 11.1) export BLASOPT="-i8 -I$MKLROOT/include/intel64/ilp64 -I$MKLROOT/include $MKLROOT/lib/intel64/libmkl_blas95_ilp64.a $MKLROOT/lib/intel64/libmkl_lapack95_ilp64.a -Wl,--start-group $MKLROOT/lib/intel64/libmkl_intel_ilp64.a $MKLROOT/lib/intel64/libmkl_core.a $MKLROOT/lib/intel64/libmkl_sequential.a -Wl,--end-group -lpthread -lm" # These may be helpful for compiling with CUDA, but beware - the resulting program no longer loads without cuda libraries! #export TCE_CUDA=n #export CUDA=$CUDA_HOME/bin/nvcc #export CUDA_FLAGS="-arch=sm_35" #export CUDA_INCLUDE="-I$CUDA_HOME/include" #export CUDA_LIBS="-L$CUDA_HOME/lib64 -lcudart -lcufft" # -L/usr/X11R6/lib -lGL -lGLU -lX11 -lXi -lXmu -lglut -lGLEW cd $NWCHEM_TOP/src #make realclean # These two lines let you start again (theoretically). #find . -name dependencies -exec rm {} \; -print make nwchem_config make nwchem #make -B -C ddscf # in case you just changed something in the ddscf directory make libnwchem </source> (on 64/32 OSX with gcc) to appear! == Testing == Inspecting the patch file, you will notice that the python wrapper was added into the src/python directory. It also includes a simple test (test.py), which opens libnwchem.so from its compiled location and does geometry optimization on a water molecule. To use it yourself, # cd to nwchem-6.5/src/python # export PYTHONPATH=$PWD:$PYTHONPATH # edit nwchem.py to make sure the CDLL() command has the right path to libnwchem.so (in a pinch, just move libnwchem.so to the current dir, and change the CDLL line to CDLL("libnwchem.so")) # run: python test.py # if all goes well, you should see normal nwchem output (listing basis functions, showing geometry convergence, and ending with a citation note) 0c50dfadf74c4efccbf307ca93a74ef711548cd4 258 257 2014-10-21T18:43:09Z David M. Rogers 2 /* Obtaining */ wikitext text/x-wiki Libnwchem is a patch to the [http://www.nwchem-sw.org/index.php/Download#Patches_for_the_26243_revision_of_NWChem_6.5 6.5 Revision of NWChem] that adds three useful features. # push_inp_string and pop_inp_string (nw_inp_from_file.F) to fake string input as input from an nwchem parameter file #* push_inp_cstring (push_inp_cstring.c) to provide a 0-terminated c-string interface to same # an nwchem_init function (libnwchem.F) to perform the start-up tasks of nwchem and return its runtime database #* a libnwchem target to the GNUMakefile (sorry, no cygwin right now) # nwchem.py, rtdb.py and related python wrappers to call nwchem's top-level functions and handle io from the rtdb #* various fixes to error handling in rtdb == Obtaining == You can download the patch [http://predictivestatmech.org/libnwchem-6.5.patch here]. Next, get the nwchem sources from the link at the top of the page. To unpack and patch them, use <source lang="bash"> tar xjf Nwchem-6.5.revision26243-src.2014-09-10.tar.bz2 mv Nwchem-6.5.revision26243-src nwchem-6.5 cd nwchem-6.5 patch -p1 <../libnwchem-6.5.patch bash ../build-6.5.sh # the build-6.5.sh script is at the bottom of this page. </source> The mv line is really required, since nwchem's build can fail if the path to the source directory is too long! == Compilation == For most Linux systems (but not BSD-based OSX), the -fPIC flag is required. This is such a PITA to add to nwchem's compilation that my solution is an ugly hack. Replace the real compiler with a shell script in your $HOME/bin directory, and make sure your path has $HOME/bin in front of all other directories. (for icc) <source lang="bash"> #!/bin/sh # file $HOME/bin/icc /opt/intel/bin/icc -fPIC $@ </source> (or gcc) <source lang="bash"> #!/bin/sh # file $HOME/bin/gcc /usr/bin/gcc -fPIC $@ </source> I use the following script for compiling NWChem: (on 64-bit Linux with icc) <source lang="bash"> #!/bin/bash # file build-6.5.sh export NWCHEM_TOP=$HOME/build/nwchem-6.5 export NWCHEM_TARGET=LINUX64 export NWCHEM_MODULES=all export USE_MPI=y export USE_MPIF=y export USE_MPIF4=y export MPI_LIB=/apps/openmpi/1.4.5/lib export MPI_INCLUDE=/apps/openmpi/1.4.5/include export LIBMPI="-lpthread -lmpi_f90 -lmpi_f77 -lmpi -lopen-rte -lopen-pal -lrdmacm -libverbs -lpsm_infinipath -lnuma -ldl -Wl,--export-dynamic -lnsl -lutil -lm -ldl" export ARMCI_NETWORK=OPENIB # export IB_INCLUDE <Location of Infiniband libraries>/include export MSG_COMMS=MPI export CC=icc export FCC=ifort export FOPTIMIZE="-O2 -fPIC" export FFLAGS="-O2 -fPIC" export CFLAGS="-O2 -fPIC" export MKLROOT=/apps/intel/mkl # see intel's link-line advisor for generating the next line. Use the options for single dynamic library. (this is for MKL 10.3.6 with icc 11.1) export BLASOPT="-i8 -I$MKLROOT/include/intel64/ilp64 -I$MKLROOT/include $MKLROOT/lib/intel64/libmkl_blas95_ilp64.a $MKLROOT/lib/intel64/libmkl_lapack95_ilp64.a -Wl,--start-group $MKLROOT/lib/intel64/libmkl_intel_ilp64.a $MKLROOT/lib/intel64/libmkl_core.a $MKLROOT/lib/intel64/libmkl_sequential.a -Wl,--end-group -lpthread -lm" # These may be helpful for compiling with CUDA, but beware - the resulting program no longer loads without cuda libraries! #export TCE_CUDA=n #export CUDA=$CUDA_HOME/bin/nvcc #export CUDA_FLAGS="-arch=sm_35" #export CUDA_INCLUDE="-I$CUDA_HOME/include" #export CUDA_LIBS="-L$CUDA_HOME/lib64 -lcudart -lcufft" # -L/usr/X11R6/lib -lGL -lGLU -lX11 -lXi -lXmu -lglut -lGLEW cd $NWCHEM_TOP/src #make realclean # These two lines let you start again (theoretically). #find . -name dependencies -exec rm {} \; -print make nwchem_config make nwchem #make -B -C ddscf # in case you just changed something in the ddscf directory make libnwchem </source> (on 64/32 OSX with gcc) to appear! == Testing == Inspecting the patch file, you will notice that the python wrapper was added into the src/python directory. It also includes a simple test (test.py), which opens libnwchem.so from its compiled location and does geometry optimization on a water molecule. To use it yourself, # cd to nwchem-6.5/src/python # export PYTHONPATH=$PWD:$PYTHONPATH # edit nwchem.py to make sure the CDLL() command has the right path to libnwchem.so (in a pinch, just move libnwchem.so to the current dir, and change the CDLL line to CDLL("libnwchem.so")) # run: python test.py # if all goes well, you should see normal nwchem output (listing basis functions, showing geometry convergence, and ending with a citation note) 411e6eb1cae1f07a6ea175708049124c4e00d346 259 258 2014-10-21T18:47:00Z David M. Rogers 2 wikitext text/x-wiki Libnwchem is a patch to the [http://www.nwchem-sw.org/index.php/Download#Patches_for_the_26243_revision_of_NWChem_6.5 6.5 Revision of NWChem] that adds three useful features. # push_inp_string and pop_inp_string (nw_inp_from_file.F) to fake string input as input from an nwchem parameter file #* push_inp_cstring (push_inp_cstring.c) to provide a 0-terminated c-string interface to same # an nwchem_init function (libnwchem.F) to perform the start-up tasks of nwchem and return its runtime database #* a libnwchem target to the GNUMakefile (sorry, no cygwin right now) # nwchem.py, rtdb.py and related python wrappers to call nwchem's top-level functions and handle io from the rtdb #* various fixes to error handling in rtdb #* the test for a "movecs" file as proof of convergence was removed in the scf module, since the python script may change the geometry, requiring a new run of SCF despite a valid movecs file. == Obtaining == You can download the patch [http://predictivestatmech.org/libnwchem-6.5.patch here]. Next, get the nwchem sources from the link at the top of the page. To unpack and patch them, use <source lang="bash"> tar xjf Nwchem-6.5.revision26243-src.2014-09-10.tar.bz2 mv Nwchem-6.5.revision26243-src nwchem-6.5 cd nwchem-6.5 patch -p1 <../libnwchem-6.5.patch bash ../build-6.5.sh # the build-6.5.sh script is at the bottom of this page. </source> The mv line is really required, since nwchem's build can fail if the path to the source directory is too long! == Compilation == For most Linux systems (but not BSD-based OSX), the -fPIC flag is required. This is such a PITA to add to nwchem's compilation that my solution is an ugly hack. Replace the real compiler with a shell script in your $HOME/bin directory, and make sure your path has $HOME/bin in front of all other directories. (for icc) <source lang="bash"> #!/bin/sh # file $HOME/bin/icc /opt/intel/bin/icc -fPIC $@ </source> (or gcc) <source lang="bash"> #!/bin/sh # file $HOME/bin/gcc /usr/bin/gcc -fPIC $@ </source> I use the following script for compiling NWChem: (on 64-bit Linux with icc) <source lang="bash"> #!/bin/bash # file build-6.5.sh export NWCHEM_TOP=$HOME/build/nwchem-6.5 export NWCHEM_TARGET=LINUX64 export NWCHEM_MODULES=all export USE_MPI=y export USE_MPIF=y export USE_MPIF4=y export MPI_LIB=/apps/openmpi/1.4.5/lib export MPI_INCLUDE=/apps/openmpi/1.4.5/include export LIBMPI="-lpthread -lmpi_f90 -lmpi_f77 -lmpi -lopen-rte -lopen-pal -lrdmacm -libverbs -lpsm_infinipath -lnuma -ldl -Wl,--export-dynamic -lnsl -lutil -lm -ldl" export ARMCI_NETWORK=OPENIB # export IB_INCLUDE <Location of Infiniband libraries>/include export MSG_COMMS=MPI export CC=icc export FCC=ifort export FOPTIMIZE="-O2 -fPIC" export FFLAGS="-O2 -fPIC" export CFLAGS="-O2 -fPIC" export MKLROOT=/apps/intel/mkl # see intel's link-line advisor for generating the next line. Use the options for single dynamic library. (this is for MKL 10.3.6 with icc 11.1) export BLASOPT="-i8 -I$MKLROOT/include/intel64/ilp64 -I$MKLROOT/include $MKLROOT/lib/intel64/libmkl_blas95_ilp64.a $MKLROOT/lib/intel64/libmkl_lapack95_ilp64.a -Wl,--start-group $MKLROOT/lib/intel64/libmkl_intel_ilp64.a $MKLROOT/lib/intel64/libmkl_core.a $MKLROOT/lib/intel64/libmkl_sequential.a -Wl,--end-group -lpthread -lm" # These may be helpful for compiling with CUDA, but beware - the resulting program no longer loads without cuda libraries! #export TCE_CUDA=n #export CUDA=$CUDA_HOME/bin/nvcc #export CUDA_FLAGS="-arch=sm_35" #export CUDA_INCLUDE="-I$CUDA_HOME/include" #export CUDA_LIBS="-L$CUDA_HOME/lib64 -lcudart -lcufft" # -L/usr/X11R6/lib -lGL -lGLU -lX11 -lXi -lXmu -lglut -lGLEW cd $NWCHEM_TOP/src #make realclean # These two lines let you start again (theoretically). #find . -name dependencies -exec rm {} \; -print make nwchem_config make nwchem #make -B -C ddscf # in case you just changed something in the ddscf directory make libnwchem </source> (on 64/32 OSX with gcc) to appear! == Testing == Inspecting the patch file, you will notice that the python wrapper was added into the src/python directory. It also includes a simple test (test.py), which opens libnwchem.so from its compiled location and does geometry optimization on a water molecule. To use it yourself, # cd to nwchem-6.5/src/python # export PYTHONPATH=$PWD:$PYTHONPATH # edit nwchem.py to make sure the CDLL() command has the right path to libnwchem.so (in a pinch, just move libnwchem.so to the current dir, and change the CDLL line to CDLL("libnwchem.so")) # run: python test.py # if all goes well, you should see normal nwchem output (listing basis functions, showing geometry convergence, and ending with a citation note) == Help == The patch is released without any warranty or indeed any guarantee of working at all. If you are . 139ccfca5382a2606eafb89421fbe14562f82948 260 259 2014-10-21T19:22:57Z David M. Rogers 2 /* Help */ wikitext text/x-wiki Libnwchem is a patch to the [http://www.nwchem-sw.org/index.php/Download#Patches_for_the_26243_revision_of_NWChem_6.5 6.5 Revision of NWChem] that adds three useful features. # push_inp_string and pop_inp_string (nw_inp_from_file.F) to fake string input as input from an nwchem parameter file #* push_inp_cstring (push_inp_cstring.c) to provide a 0-terminated c-string interface to same # an nwchem_init function (libnwchem.F) to perform the start-up tasks of nwchem and return its runtime database #* a libnwchem target to the GNUMakefile (sorry, no cygwin right now) # nwchem.py, rtdb.py and related python wrappers to call nwchem's top-level functions and handle io from the rtdb #* various fixes to error handling in rtdb #* the test for a "movecs" file as proof of convergence was removed in the scf module, since the python script may change the geometry, requiring a new run of SCF despite a valid movecs file. == Obtaining == You can download the patch [http://predictivestatmech.org/libnwchem-6.5.patch here]. Next, get the nwchem sources from the link at the top of the page. To unpack and patch them, use <source lang="bash"> tar xjf Nwchem-6.5.revision26243-src.2014-09-10.tar.bz2 mv Nwchem-6.5.revision26243-src nwchem-6.5 cd nwchem-6.5 patch -p1 <../libnwchem-6.5.patch bash ../build-6.5.sh # the build-6.5.sh script is at the bottom of this page. </source> The mv line is really required, since nwchem's build can fail if the path to the source directory is too long! == Compilation == For most Linux systems (but not BSD-based OSX), the -fPIC flag is required. This is such a PITA to add to nwchem's compilation that my solution is an ugly hack. Replace the real compiler with a shell script in your $HOME/bin directory, and make sure your path has $HOME/bin in front of all other directories. (for icc) <source lang="bash"> #!/bin/sh # file $HOME/bin/icc /opt/intel/bin/icc -fPIC $@ </source> (or gcc) <source lang="bash"> #!/bin/sh # file $HOME/bin/gcc /usr/bin/gcc -fPIC $@ </source> I use the following script for compiling NWChem: (on 64-bit Linux with icc) <source lang="bash"> #!/bin/bash # file build-6.5.sh export NWCHEM_TOP=$HOME/build/nwchem-6.5 export NWCHEM_TARGET=LINUX64 export NWCHEM_MODULES=all export USE_MPI=y export USE_MPIF=y export USE_MPIF4=y export MPI_LIB=/apps/openmpi/1.4.5/lib export MPI_INCLUDE=/apps/openmpi/1.4.5/include export LIBMPI="-lpthread -lmpi_f90 -lmpi_f77 -lmpi -lopen-rte -lopen-pal -lrdmacm -libverbs -lpsm_infinipath -lnuma -ldl -Wl,--export-dynamic -lnsl -lutil -lm -ldl" export ARMCI_NETWORK=OPENIB # export IB_INCLUDE <Location of Infiniband libraries>/include export MSG_COMMS=MPI export CC=icc export FCC=ifort export FOPTIMIZE="-O2 -fPIC" export FFLAGS="-O2 -fPIC" export CFLAGS="-O2 -fPIC" export MKLROOT=/apps/intel/mkl # see intel's link-line advisor for generating the next line. Use the options for single dynamic library. (this is for MKL 10.3.6 with icc 11.1) export BLASOPT="-i8 -I$MKLROOT/include/intel64/ilp64 -I$MKLROOT/include $MKLROOT/lib/intel64/libmkl_blas95_ilp64.a $MKLROOT/lib/intel64/libmkl_lapack95_ilp64.a -Wl,--start-group $MKLROOT/lib/intel64/libmkl_intel_ilp64.a $MKLROOT/lib/intel64/libmkl_core.a $MKLROOT/lib/intel64/libmkl_sequential.a -Wl,--end-group -lpthread -lm" # These may be helpful for compiling with CUDA, but beware - the resulting program no longer loads without cuda libraries! #export TCE_CUDA=n #export CUDA=$CUDA_HOME/bin/nvcc #export CUDA_FLAGS="-arch=sm_35" #export CUDA_INCLUDE="-I$CUDA_HOME/include" #export CUDA_LIBS="-L$CUDA_HOME/lib64 -lcudart -lcufft" # -L/usr/X11R6/lib -lGL -lGLU -lX11 -lXi -lXmu -lglut -lGLEW cd $NWCHEM_TOP/src #make realclean # These two lines let you start again (theoretically). #find . -name dependencies -exec rm {} \; -print make nwchem_config make nwchem #make -B -C ddscf # in case you just changed something in the ddscf directory make libnwchem </source> (on 64/32 OSX with gcc) to appear! == Testing == Inspecting the patch file, you will notice that the python wrapper was added into the src/python directory. It also includes a simple test (test.py), which opens libnwchem.so from its compiled location and does geometry optimization on a water molecule. To use it yourself, # cd to nwchem-6.5/src/python # export PYTHONPATH=$PWD:$PYTHONPATH # edit nwchem.py to make sure the CDLL() command has the right path to libnwchem.so (in a pinch, just move libnwchem.so to the current dir, and change the CDLL line to CDLL("libnwchem.so")) # run: python test.py # if all goes well, you should see normal nwchem output (listing basis functions, showing geometry convergence, and ending with a citation note) == Help == The patch is released without any warranty or indeed any guarantee of working at all. If you have lots of ($$$) around, shoot me an email. edff0d3875728cbb28f335faf72fdd9b73557c6c Silmaril 0 51 261 233 2014-10-21T19:41:17Z David M. Rogers 2 wikitext text/x-wiki The Silmaril programming language is built from the ground up for bleeding edge HPC. It has the following, fully automatic, killer features: * Git-like source code versioning * Cryptographically secure, distributed filesystem storage * First-class objects ** functions ** types ** modules (aka. tables / record types / directories / structs / ML "Functors") ** parsing constructs (for extensible case analysis) * Extensible primitive operations (JIT C-compilation) * Extensible binary object types (i.e. opaque pointers) This documentation explains how to get up and running with the latest distribution. To interact with the server, you'll need a gpg key. The process for creating one is easy: <source lang="bash"> gpg --gen-key # just create an RSA signing key with 2048 bits gpg --export --armor your.email@org.edu >key.asc gpg --export-secret-keys --armor your.email@org.edu >key-sec.asc </source> More details on the client/server code are [[HowTo:PGP|here]]. Send your public key to me via email, so that I can sign your key to allow access. Once this is done, you can run the sil client using: sil -a tcp\!rcslurm.usf.edu\!5050 -p pubkey.asc privkey.asc (the backslashes are for bash's benefit) where pubkey and privkey are the ascii-armored, exported keys you created above. You can now read all saved objects and create your own commits. You can get started by loading the standard library ([[Stdlib]]) and following along with the [http://predictivestatmech.org/sil/tour.html tutorial]. c7f8d9a28ccbb4e85941ff315b33206c362bc645 262 261 2014-10-21T19:42:08Z David M. Rogers 2 wikitext text/x-wiki The Silmaril programming language is built from the ground up for bleeding edge HPC. It has the following, fully automatic, killer features: * Git-like source code versioning * Cryptographically secure, distributed filesystem storage * First-class objects ** functions ** types ** modules (aka. tables / record types / directories / structs / ML "Functors") ** parsing constructs (for extensible case analysis) * Extensible primitive operations (JIT C-compilation) * Extensible binary object types (i.e. opaque pointers) This documentation explains how to get up and running with the latest distribution. To interact with the server, you'll need a gpg key. The process for creating one is easy: <source lang="bash"> gpg --gen-key # just create an RSA signing key with 2048 bits gpg --export --armor your.email@org.edu >pubkey.asc gpg --export-secret-keys --armor your.email@org.edu >privkey.asc </source> More details on the client/server code are [[HowTo:PGP|here]]. Send your public key to me via email, so that I can sign your key to allow access. Once this is done, you can run the sil client using: sil -a tcp\!rcslurm.usf.edu\!5050 -p pubkey.asc privkey.asc (the backslashes are for bash's benefit) where pubkey and privkey are the ascii-armored, exported keys you created above. You can now read all saved objects and create your own commits. You can get started by loading the standard library ([[Stdlib]]) and following along with the [http://predictivestatmech.org/sil/tour.html tutorial]. 3195dd339e9b0f595d4c3f88b59521cb0eb81c74 Code:libnwchem 0 55 263 260 2014-10-21T21:49:46Z David M. Rogers 2 /* Obtaining */ wikitext text/x-wiki Libnwchem is a patch to the [http://www.nwchem-sw.org/index.php/Download#Patches_for_the_26243_revision_of_NWChem_6.5 6.5 Revision of NWChem] that adds three useful features. # push_inp_string and pop_inp_string (nw_inp_from_file.F) to fake string input as input from an nwchem parameter file #* push_inp_cstring (push_inp_cstring.c) to provide a 0-terminated c-string interface to same # an nwchem_init function (libnwchem.F) to perform the start-up tasks of nwchem and return its runtime database #* a libnwchem target to the GNUMakefile (sorry, no cygwin right now) # nwchem.py, rtdb.py and related python wrappers to call nwchem's top-level functions and handle io from the rtdb #* various fixes to error handling in rtdb #* the test for a "movecs" file as proof of convergence was removed in the scf module, since the python script may change the geometry, requiring a new run of SCF despite a valid movecs file. == Obtaining == You can download the patch [http://predictivestatmech.org/libnwchem-6.5.patch here]. Next, get the nwchem sources from the link at the top of the page. To unpack and patch them, use <source lang="bash"> tar xjf Nwchem-6.5.revision26243-src.2014-09-10.tar.bz2 mv Nwchem-6.5.revision26243-src nwchem-6.5 cd nwchem-6.5/src for i in Util_md_sockets Hbar Tcenxtask Parallelmpi Makefile_gcc4x Bcast_ccsd Elpa_syncs; do wget http://www.nwchem-sw.org/images/$i.patch.gz zcat $i.patch.gz | patch -p0 rm -f $i.patch.gz done i=Hnd_giaxyz_noinline # there's always that one. wget http://www.nwchem-sw.org/images/$i.patch.gz zcat $i.patch.gz | (cd NWints/hondo && patch -p0) rm -f $i.patch.gz # Finally, apply the libnwchem patch. zcat ../../libnwchem-6.5.patch.gz | patch -p0 cd .. bash ../build-6.5.sh # the build-6.5.sh script is at the bottom of this page. </source> The mv line is really required, since nwchem's build can fail if the path to the source directory is too long! == Compilation == For most Linux systems (but not BSD-based OSX), the -fPIC flag is required. This is such a PITA to add to nwchem's compilation that my solution is an ugly hack. Replace the real compiler with a shell script in your $HOME/bin directory, and make sure your path has $HOME/bin in front of all other directories. (for icc) <source lang="bash"> #!/bin/sh # file $HOME/bin/icc /opt/intel/bin/icc -fPIC $@ </source> (or gcc) <source lang="bash"> #!/bin/sh # file $HOME/bin/gcc /usr/bin/gcc -fPIC $@ </source> I use the following script for compiling NWChem: (on 64-bit Linux with icc) <source lang="bash"> #!/bin/bash # file build-6.5.sh export NWCHEM_TOP=$HOME/build/nwchem-6.5 export NWCHEM_TARGET=LINUX64 export NWCHEM_MODULES=all export USE_MPI=y export USE_MPIF=y export USE_MPIF4=y export MPI_LIB=/apps/openmpi/1.4.5/lib export MPI_INCLUDE=/apps/openmpi/1.4.5/include export LIBMPI="-lpthread -lmpi_f90 -lmpi_f77 -lmpi -lopen-rte -lopen-pal -lrdmacm -libverbs -lpsm_infinipath -lnuma -ldl -Wl,--export-dynamic -lnsl -lutil -lm -ldl" export ARMCI_NETWORK=OPENIB # export IB_INCLUDE <Location of Infiniband libraries>/include export MSG_COMMS=MPI export CC=icc export FCC=ifort export FOPTIMIZE="-O2 -fPIC" export FFLAGS="-O2 -fPIC" export CFLAGS="-O2 -fPIC" export MKLROOT=/apps/intel/mkl # see intel's link-line advisor for generating the next line. Use the options for single dynamic library. (this is for MKL 10.3.6 with icc 11.1) export BLASOPT="-i8 -I$MKLROOT/include/intel64/ilp64 -I$MKLROOT/include $MKLROOT/lib/intel64/libmkl_blas95_ilp64.a $MKLROOT/lib/intel64/libmkl_lapack95_ilp64.a -Wl,--start-group $MKLROOT/lib/intel64/libmkl_intel_ilp64.a $MKLROOT/lib/intel64/libmkl_core.a $MKLROOT/lib/intel64/libmkl_sequential.a -Wl,--end-group -lpthread -lm" # These may be helpful for compiling with CUDA, but beware - the resulting program no longer loads without cuda libraries! #export TCE_CUDA=n #export CUDA=$CUDA_HOME/bin/nvcc #export CUDA_FLAGS="-arch=sm_35" #export CUDA_INCLUDE="-I$CUDA_HOME/include" #export CUDA_LIBS="-L$CUDA_HOME/lib64 -lcudart -lcufft" # -L/usr/X11R6/lib -lGL -lGLU -lX11 -lXi -lXmu -lglut -lGLEW cd $NWCHEM_TOP/src #make realclean # These two lines let you start again (theoretically). #find . -name dependencies -exec rm {} \; -print make nwchem_config make nwchem #make -B -C ddscf # in case you just changed something in the ddscf directory make libnwchem </source> (on 64/32 OSX with gcc) to appear! == Testing == Inspecting the patch file, you will notice that the python wrapper was added into the src/python directory. It also includes a simple test (test.py), which opens libnwchem.so from its compiled location and does geometry optimization on a water molecule. To use it yourself, # cd to nwchem-6.5/src/python # export PYTHONPATH=$PWD:$PYTHONPATH # edit nwchem.py to make sure the CDLL() command has the right path to libnwchem.so (in a pinch, just move libnwchem.so to the current dir, and change the CDLL line to CDLL("libnwchem.so")) # run: python test.py # if all goes well, you should see normal nwchem output (listing basis functions, showing geometry convergence, and ending with a citation note) == Help == The patch is released without any warranty or indeed any guarantee of working at all. If you have lots of ($$$) around, shoot me an email. 75f737a5264638d331a0e6ea13a258e7840fed7c 264 263 2014-10-21T21:52:53Z David M. Rogers 2 /* Compilation */ wikitext text/x-wiki Libnwchem is a patch to the [http://www.nwchem-sw.org/index.php/Download#Patches_for_the_26243_revision_of_NWChem_6.5 6.5 Revision of NWChem] that adds three useful features. # push_inp_string and pop_inp_string (nw_inp_from_file.F) to fake string input as input from an nwchem parameter file #* push_inp_cstring (push_inp_cstring.c) to provide a 0-terminated c-string interface to same # an nwchem_init function (libnwchem.F) to perform the start-up tasks of nwchem and return its runtime database #* a libnwchem target to the GNUMakefile (sorry, no cygwin right now) # nwchem.py, rtdb.py and related python wrappers to call nwchem's top-level functions and handle io from the rtdb #* various fixes to error handling in rtdb #* the test for a "movecs" file as proof of convergence was removed in the scf module, since the python script may change the geometry, requiring a new run of SCF despite a valid movecs file. == Obtaining == You can download the patch [http://predictivestatmech.org/libnwchem-6.5.patch here]. Next, get the nwchem sources from the link at the top of the page. To unpack and patch them, use <source lang="bash"> tar xjf Nwchem-6.5.revision26243-src.2014-09-10.tar.bz2 mv Nwchem-6.5.revision26243-src nwchem-6.5 cd nwchem-6.5/src for i in Util_md_sockets Hbar Tcenxtask Parallelmpi Makefile_gcc4x Bcast_ccsd Elpa_syncs; do wget http://www.nwchem-sw.org/images/$i.patch.gz zcat $i.patch.gz | patch -p0 rm -f $i.patch.gz done i=Hnd_giaxyz_noinline # there's always that one. wget http://www.nwchem-sw.org/images/$i.patch.gz zcat $i.patch.gz | (cd NWints/hondo && patch -p0) rm -f $i.patch.gz # Finally, apply the libnwchem patch. zcat ../../libnwchem-6.5.patch.gz | patch -p0 cd .. bash ../build-6.5.sh # the build-6.5.sh script is at the bottom of this page. </source> The mv line is really required, since nwchem's build can fail if the path to the source directory is too long! == Compilation == For most Linux systems (but not BSD-based OSX), the -fPIC flag is required. This is such a PITA to add to nwchem's compilation that my solution is an ugly hack. Replace the real compiler with a shell script in your $HOME/bin directory, and make sure your path has $HOME/bin in front of all other directories. (for icc) <source lang="bash"> #!/bin/sh # file $HOME/bin/icc /opt/intel/bin/icc -fPIC $@ </source> (or gcc) <source lang="bash"> #!/bin/sh # file $HOME/bin/gcc /usr/bin/gcc -fPIC $@ </source> I use the following script for compiling NWChem: (on 64-bit Linux with icc) <source lang="bash"> #!/bin/bash # file build-6.5.sh export NWCHEM_TOP=$HOME/build/nwchem-6.5 export NWCHEM_TARGET=LINUX64 export NWCHEM_MODULES=all export USE_MPI=y export USE_MPIF=y export USE_MPIF4=y export MPI_LIB=/apps/openmpi/1.4.5/lib export MPI_INCLUDE=/apps/openmpi/1.4.5/include export LIBMPI="-lpthread -lmpi_f90 -lmpi_f77 -lmpi -lopen-rte -lopen-pal -lrdmacm -libverbs -lpsm_infinipath -lnuma -ldl -Wl,--export-dynamic -lnsl -lutil -lm -ldl" export ARMCI_NETWORK=OPENIB # export IB_INCLUDE <Location of Infiniband libraries>/include export MSG_COMMS=MPI export CC=icc export FCC=ifort export FOPTIMIZE="-O2 -fPIC" export FFLAGS="-O2 -fPIC" export CFLAGS="-O2 -fPIC" export MKLROOT=/apps/intel/mkl # see intel's link-line advisor for generating the next line. Use the options for single dynamic library. # (the following is for MKL 10.3.6 with icc 11.1) export BLASOPT="-i8 -I$MKLROOT/include/intel64/ilp64 -I$MKLROOT/include $MKLROOT/lib/intel64/libmkl_blas95_ilp64.a $MKLROOT/lib/intel64/libmkl_lapack95_ilp64.a -Wl,--start-group $MKLROOT/lib/intel64/libmkl_intel_ilp64.a $MKLROOT/lib/intel64/libmkl_core.a $MKLROOT/lib/intel64/libmkl_sequential.a -Wl,--end-group -lpthread -lm" # These may be helpful for compiling with CUDA, but beware - the resulting program no longer loads without cuda libraries! #export TCE_CUDA=n #export CUDA=$CUDA_HOME/bin/nvcc #export CUDA_FLAGS="-arch=sm_35" #export CUDA_INCLUDE="-I$CUDA_HOME/include" #export CUDA_LIBS="-L$CUDA_HOME/lib64 -lcudart -lcufft" # -L/usr/X11R6/lib -lGL -lGLU -lX11 -lXi -lXmu -lglut -lGLEW cd $NWCHEM_TOP/src #make realclean # These two lines let you start again (theoretically). #find . -name dependencies -exec rm {} \; -print make nwchem_config make nwchem #make -B -C ddscf # in case you just changed something in the ddscf directory make libnwchem </source> (on 64/32 OSX with gcc) to appear! == Testing == Inspecting the patch file, you will notice that the python wrapper was added into the src/python directory. It also includes a simple test (test.py), which opens libnwchem.so from its compiled location and does geometry optimization on a water molecule. To use it yourself, # cd to nwchem-6.5/src/python # export PYTHONPATH=$PWD:$PYTHONPATH # edit nwchem.py to make sure the CDLL() command has the right path to libnwchem.so (in a pinch, just move libnwchem.so to the current dir, and change the CDLL line to CDLL("libnwchem.so")) # run: python test.py # if all goes well, you should see normal nwchem output (listing basis functions, showing geometry convergence, and ending with a citation note) == Help == The patch is released without any warranty or indeed any guarantee of working at all. If you have lots of ($$$) around, shoot me an email. 542b4f8e45f548ed399746364a7e726ec3249218 265 264 2014-10-22T05:02:12Z David M. Rogers 2 /* Testing */ wikitext text/x-wiki Libnwchem is a patch to the [http://www.nwchem-sw.org/index.php/Download#Patches_for_the_26243_revision_of_NWChem_6.5 6.5 Revision of NWChem] that adds three useful features. # push_inp_string and pop_inp_string (nw_inp_from_file.F) to fake string input as input from an nwchem parameter file #* push_inp_cstring (push_inp_cstring.c) to provide a 0-terminated c-string interface to same # an nwchem_init function (libnwchem.F) to perform the start-up tasks of nwchem and return its runtime database #* a libnwchem target to the GNUMakefile (sorry, no cygwin right now) # nwchem.py, rtdb.py and related python wrappers to call nwchem's top-level functions and handle io from the rtdb #* various fixes to error handling in rtdb #* the test for a "movecs" file as proof of convergence was removed in the scf module, since the python script may change the geometry, requiring a new run of SCF despite a valid movecs file. == Obtaining == You can download the patch [http://predictivestatmech.org/libnwchem-6.5.patch here]. Next, get the nwchem sources from the link at the top of the page. To unpack and patch them, use <source lang="bash"> tar xjf Nwchem-6.5.revision26243-src.2014-09-10.tar.bz2 mv Nwchem-6.5.revision26243-src nwchem-6.5 cd nwchem-6.5/src for i in Util_md_sockets Hbar Tcenxtask Parallelmpi Makefile_gcc4x Bcast_ccsd Elpa_syncs; do wget http://www.nwchem-sw.org/images/$i.patch.gz zcat $i.patch.gz | patch -p0 rm -f $i.patch.gz done i=Hnd_giaxyz_noinline # there's always that one. wget http://www.nwchem-sw.org/images/$i.patch.gz zcat $i.patch.gz | (cd NWints/hondo && patch -p0) rm -f $i.patch.gz # Finally, apply the libnwchem patch. zcat ../../libnwchem-6.5.patch.gz | patch -p0 cd .. bash ../build-6.5.sh # the build-6.5.sh script is at the bottom of this page. </source> The mv line is really required, since nwchem's build can fail if the path to the source directory is too long! == Compilation == For most Linux systems (but not BSD-based OSX), the -fPIC flag is required. This is such a PITA to add to nwchem's compilation that my solution is an ugly hack. Replace the real compiler with a shell script in your $HOME/bin directory, and make sure your path has $HOME/bin in front of all other directories. (for icc) <source lang="bash"> #!/bin/sh # file $HOME/bin/icc /opt/intel/bin/icc -fPIC $@ </source> (or gcc) <source lang="bash"> #!/bin/sh # file $HOME/bin/gcc /usr/bin/gcc -fPIC $@ </source> I use the following script for compiling NWChem: (on 64-bit Linux with icc) <source lang="bash"> #!/bin/bash # file build-6.5.sh export NWCHEM_TOP=$HOME/build/nwchem-6.5 export NWCHEM_TARGET=LINUX64 export NWCHEM_MODULES=all export USE_MPI=y export USE_MPIF=y export USE_MPIF4=y export MPI_LIB=/apps/openmpi/1.4.5/lib export MPI_INCLUDE=/apps/openmpi/1.4.5/include export LIBMPI="-lpthread -lmpi_f90 -lmpi_f77 -lmpi -lopen-rte -lopen-pal -lrdmacm -libverbs -lpsm_infinipath -lnuma -ldl -Wl,--export-dynamic -lnsl -lutil -lm -ldl" export ARMCI_NETWORK=OPENIB # export IB_INCLUDE <Location of Infiniband libraries>/include export MSG_COMMS=MPI export CC=icc export FCC=ifort export FOPTIMIZE="-O2 -fPIC" export FFLAGS="-O2 -fPIC" export CFLAGS="-O2 -fPIC" export MKLROOT=/apps/intel/mkl # see intel's link-line advisor for generating the next line. Use the options for single dynamic library. # (the following is for MKL 10.3.6 with icc 11.1) export BLASOPT="-i8 -I$MKLROOT/include/intel64/ilp64 -I$MKLROOT/include $MKLROOT/lib/intel64/libmkl_blas95_ilp64.a $MKLROOT/lib/intel64/libmkl_lapack95_ilp64.a -Wl,--start-group $MKLROOT/lib/intel64/libmkl_intel_ilp64.a $MKLROOT/lib/intel64/libmkl_core.a $MKLROOT/lib/intel64/libmkl_sequential.a -Wl,--end-group -lpthread -lm" # These may be helpful for compiling with CUDA, but beware - the resulting program no longer loads without cuda libraries! #export TCE_CUDA=n #export CUDA=$CUDA_HOME/bin/nvcc #export CUDA_FLAGS="-arch=sm_35" #export CUDA_INCLUDE="-I$CUDA_HOME/include" #export CUDA_LIBS="-L$CUDA_HOME/lib64 -lcudart -lcufft" # -L/usr/X11R6/lib -lGL -lGLU -lX11 -lXi -lXmu -lglut -lGLEW cd $NWCHEM_TOP/src #make realclean # These two lines let you start again (theoretically). #find . -name dependencies -exec rm {} \; -print make nwchem_config make nwchem #make -B -C ddscf # in case you just changed something in the ddscf directory make libnwchem </source> (on 64/32 OSX with gcc) to appear! == Testing == Inspecting the patch file, you will notice that the python wrapper was added into the src/python directory. It also includes a simple test (test.py), which opens libnwchem.so from its compiled location and does geometry optimization on a water molecule. To use it yourself, # cd to nwchem-6.5/src/python # export PYTHONPATH=$PWD:$PYTHONPATH # edit nwchem.py to make sure the CDLL() command has the right path to libnwchem.so (in a pinch, just move libnwchem.so to the current dir, and change the CDLL line to CDLL("libnwchem.so")) # run: mkdir scratch; mkdir perm #* these two dirs are the nwchem.py default scratch and perm directories # run: python test.py # if all goes well, you should see normal nwchem output (listing basis functions, showing geometry convergence, and ending with a citation note) == Help == The patch is released without any warranty or indeed any guarantee of working at all. If you have lots of ($$$) around, shoot me an email. 3b021bebd91fbdcfa9695cdfc19d8771e4a3ae01 266 265 2014-10-22T05:26:50Z David M. Rogers 2 wikitext text/x-wiki Libnwchem is a patch to the [http://www.nwchem-sw.org/index.php/Download#Patches_for_the_26243_revision_of_NWChem_6.5 6.5 Revision of NWChem] that adds three useful features. # push_inp_string and pop_inp_string (nw_inp_from_file.F) to fake string input as input from an nwchem parameter file #* push_inp_cstring (push_inp_cstring.c) to provide a 0-terminated c-string interface to same # an nwchem_init function (libnwchem.F) to perform just the start-up tasks of nwchem.F and return its runtime database handle #* a libnwchem target to the GNUMakefile (sorry, no cygwin right now) # nwchem.py, rtdb.py and related python wrappers to call nwchem's top-level functions and handle io from the rtdb #* various fixes to error handling in rtdb Warning: I've observed some strangeness with the test for a "movecs" file during SCF. If the python script changes the geometry, but the movecs file from a previous SCF calc. is left unchanged, SCF may be skipped. This results in similar property output for (actually) different structures. == Obtaining == You can download the patch [http://predictivestatmech.org/libnwchem-6.5.patch here]. Next, get the nwchem sources from the link at the top of the page. To unpack and patch them, use <source lang="bash"> tar xjf Nwchem-6.5.revision26243-src.2014-09-10.tar.bz2 mv Nwchem-6.5.revision26243-src nwchem-6.5 cd nwchem-6.5/src for i in Util_md_sockets Hbar Tcenxtask Parallelmpi Makefile_gcc4x Bcast_ccsd Elpa_syncs; do wget http://www.nwchem-sw.org/images/$i.patch.gz zcat $i.patch.gz | patch -p0 rm -f $i.patch.gz done i=Hnd_giaxyz_noinline # there's always that one. wget http://www.nwchem-sw.org/images/$i.patch.gz zcat $i.patch.gz | (cd NWints/hondo && patch -p0) rm -f $i.patch.gz # Finally, apply the libnwchem patch. zcat ../../libnwchem-6.5.patch.gz | patch -p1 cd .. bash ../build-6.5.sh # the build-6.5.sh script is at the bottom of this page. </source> The mv line is really required, since nwchem's build can fail if the path to the path to the source directory is too long! == Compilation == For most Linux systems (but not BSD-based OSX), the -fPIC flag is required. This is such a PITA to add to nwchem's compilation that my solution is an ugly hack. Replace the real compiler with a shell script in your $HOME/bin directory, and make sure your path has $HOME/bin in front of all other directories. (for icc) <source lang="bash"> #!/bin/sh # file $HOME/bin/icc /opt/intel/bin/icc -fPIC $@ </source> (or gcc) <source lang="bash"> #!/bin/sh # file $HOME/bin/gcc /usr/bin/gcc -fPIC $@ </source> I use the following script for compiling NWChem: (on 64-bit Linux with icc) <source lang="bash"> #!/bin/bash # file build-6.5.sh export NWCHEM_TOP=$HOME/build/nwchem-6.5 export NWCHEM_TARGET=LINUX64 export NWCHEM_MODULES=all export USE_MPI=y export USE_MPIF=y export USE_MPIF4=y export MPI_LIB=/apps/openmpi/1.4.5/lib export MPI_INCLUDE=/apps/openmpi/1.4.5/include export LIBMPI="-lpthread -lmpi_f90 -lmpi_f77 -lmpi -lopen-rte -lopen-pal -lrdmacm -libverbs -lpsm_infinipath -lnuma -ldl -Wl,--export-dynamic -lnsl -lutil -lm -ldl" export ARMCI_NETWORK=OPENIB # export IB_INCLUDE <Location of Infiniband libraries>/include export MSG_COMMS=MPI export CC=icc export FCC=ifort export FOPTIMIZE="-O2 -fPIC" export FFLAGS="-O2 -fPIC" export CFLAGS="-O2 -fPIC" export MKLROOT=/apps/intel/mkl # see intel's link-line advisor for generating the next line. Use the options for single dynamic library. # (the following is for MKL 10.3.6 with icc 11.1) export BLASOPT="-i8 -I$MKLROOT/include/intel64/ilp64 -I$MKLROOT/include $MKLROOT/lib/intel64/libmkl_blas95_ilp64.a $MKLROOT/lib/intel64/libmkl_lapack95_ilp64.a -Wl,--start-group $MKLROOT/lib/intel64/libmkl_intel_ilp64.a $MKLROOT/lib/intel64/libmkl_core.a $MKLROOT/lib/intel64/libmkl_sequential.a -Wl,--end-group -lpthread -lm" # These may be helpful for compiling with CUDA, but beware - the resulting program no longer loads without cuda libraries! #export TCE_CUDA=n #export CUDA=$CUDA_HOME/bin/nvcc #export CUDA_FLAGS="-arch=sm_35" #export CUDA_INCLUDE="-I$CUDA_HOME/include" #export CUDA_LIBS="-L$CUDA_HOME/lib64 -lcudart -lcufft" # -L/usr/X11R6/lib -lGL -lGLU -lX11 -lXi -lXmu -lglut -lGLEW cd $NWCHEM_TOP/src #make realclean # These two lines let you start again (theoretically). #find . -name dependencies -exec rm {} \; -print make nwchem_config make nwchem #make -B -C ddscf # in case you just changed something in the ddscf directory make libnwchem </source> (on 64/32 OSX with gcc) to appear! == Testing == Inspecting the patch file, you will notice that the python wrapper was added into the src/python directory. It also includes a simple test (test.py), which opens libnwchem.so from its compiled location and does geometry optimization on a water molecule. To use it yourself, # cd to nwchem-6.5/src/python # export PYTHONPATH=$PWD:$PYTHONPATH # edit nwchem.py to make sure the CDLL() command has the right path to libnwchem.so (in a pinch, just move libnwchem.so to the current dir, and change the CDLL line to CDLL("libnwchem.so")) # run: mkdir scratch; mkdir perm #* these two dirs are the nwchem.py default scratch and perm directories # run: python test.py # if all goes well, you should see normal nwchem output (listing basis functions, showing geometry convergence, and ending with a citation note) == Help == The patch is released without any warranty or indeed any guarantee of working at all. If you have lots of ($$$) around, shoot me an email. 875c2f7dd540149a8dcc3c2de5db4405944d8298 267 266 2014-10-22T13:38:24Z David M. Rogers 2 /* Compilation */ wikitext text/x-wiki Libnwchem is a patch to the [http://www.nwchem-sw.org/index.php/Download#Patches_for_the_26243_revision_of_NWChem_6.5 6.5 Revision of NWChem] that adds three useful features. # push_inp_string and pop_inp_string (nw_inp_from_file.F) to fake string input as input from an nwchem parameter file #* push_inp_cstring (push_inp_cstring.c) to provide a 0-terminated c-string interface to same # an nwchem_init function (libnwchem.F) to perform just the start-up tasks of nwchem.F and return its runtime database handle #* a libnwchem target to the GNUMakefile (sorry, no cygwin right now) # nwchem.py, rtdb.py and related python wrappers to call nwchem's top-level functions and handle io from the rtdb #* various fixes to error handling in rtdb Warning: I've observed some strangeness with the test for a "movecs" file during SCF. If the python script changes the geometry, but the movecs file from a previous SCF calc. is left unchanged, SCF may be skipped. This results in similar property output for (actually) different structures. == Obtaining == You can download the patch [http://predictivestatmech.org/libnwchem-6.5.patch here]. Next, get the nwchem sources from the link at the top of the page. To unpack and patch them, use <source lang="bash"> tar xjf Nwchem-6.5.revision26243-src.2014-09-10.tar.bz2 mv Nwchem-6.5.revision26243-src nwchem-6.5 cd nwchem-6.5/src for i in Util_md_sockets Hbar Tcenxtask Parallelmpi Makefile_gcc4x Bcast_ccsd Elpa_syncs; do wget http://www.nwchem-sw.org/images/$i.patch.gz zcat $i.patch.gz | patch -p0 rm -f $i.patch.gz done i=Hnd_giaxyz_noinline # there's always that one. wget http://www.nwchem-sw.org/images/$i.patch.gz zcat $i.patch.gz | (cd NWints/hondo && patch -p0) rm -f $i.patch.gz # Finally, apply the libnwchem patch. zcat ../../libnwchem-6.5.patch.gz | patch -p1 cd .. bash ../build-6.5.sh # the build-6.5.sh script is at the bottom of this page. </source> The mv line is really required, since nwchem's build can fail if the path to the path to the source directory is too long! == Compilation == For most Linux systems (but not BSD-based OSX), the -fPIC flag is required. This is such a PITA to add to nwchem's compilation that my solution is an ugly hack. Replace the real compiler with a shell script in your $HOME/bin directory, and make sure your path has $HOME/bin in front of all other directories. (for icc) <source lang="bash"> #!/bin/sh # file $HOME/bin/icc /opt/intel/bin/icc -fPIC $@ </source> (or gcc) <source lang="bash"> #!/bin/sh # file $HOME/bin/gcc /usr/bin/gcc -fPIC $@ </source> I use the following script for compiling NWChem: (on 64-bit Linux with icc) <source lang="bash"> #!/bin/bash # file build-6.5.sh export NWCHEM_TOP=$HOME/build/nwchem-6.5 export NWCHEM_TARGET=LINUX64 export NWCHEM_MODULES=all export USE_MPI=y export USE_MPIF=y export USE_MPIF4=y export MPI_LIB=/apps/openmpi/1.4.5/lib export MPI_INCLUDE=/apps/openmpi/1.4.5/include export LIBMPI="-lpthread -lmpi_f90 -lmpi_f77 -lmpi -lopen-rte -lopen-pal -lrdmacm -libverbs -lpsm_infinipath -lnuma -ldl -Wl,--export-dynamic -lnsl -lutil -lm -ldl" export ARMCI_NETWORK=OPENIB # export IB_INCLUDE <Location of Infiniband libraries>/include export MSG_COMMS=MPI export CC=icc export FCC=ifort export FOPTIMIZE="-O2 -fPIC" export FFLAGS="-O2 -fPIC" export CFLAGS="-O2 -fPIC" export MKLROOT=/apps/intel/mkl # see intel's link-line advisor for generating the next line. Use the options for single dynamic library. # (the following is for MKL 10.3.6 with icc 11.1) export BLASOPT="-i8 -I$MKLROOT/include/intel64/ilp64 -I$MKLROOT/include $MKLROOT/lib/intel64/libmkl_blas95_ilp64.a $MKLROOT/lib/intel64/libmkl_lapack95_ilp64.a -Wl,--start-group $MKLROOT/lib/intel64/libmkl_intel_ilp64.a $MKLROOT/lib/intel64/libmkl_core.a $MKLROOT/lib/intel64/libmkl_sequential.a -Wl,--end-group -lpthread -lm" # These may be helpful for compiling with CUDA, but beware - the resulting program no longer loads without cuda libraries! #export TCE_CUDA=n #export CUDA=$CUDA_HOME/bin/nvcc #export CUDA_FLAGS="-arch=sm_35" #export CUDA_INCLUDE="-I$CUDA_HOME/include" #export CUDA_LIBS="-L$CUDA_HOME/lib64 -lcudart -lcufft" # -L/usr/X11R6/lib -lGL -lGLU -lX11 -lXi -lXmu -lglut -lGLEW cd $NWCHEM_TOP/src #make realclean # These two lines let you start again (theoretically). #find . -name dependencies -exec rm {} \; -print make nwchem_config make nwchem #make -B -C ddscf # in case you just changed something in the ddscf directory cp util/cfileprefix.fh include/ make libnwchem </source> The line: '''cp util/cfileprefix.fh include/''' is required since nwchem has a really strange way of finding dependencies that works when compiling $(MAKE) stubs.o inside nwchem's target, but doesn't work when compiling $(MAKE) stubs.o inside libnwchem's target in the ''same makefile''! (on 64/32 OSX with gcc) to appear! == Testing == Inspecting the patch file, you will notice that the python wrapper was added into the src/python directory. It also includes a simple test (test.py), which opens libnwchem.so from its compiled location and does geometry optimization on a water molecule. To use it yourself, # cd to nwchem-6.5/src/python # export PYTHONPATH=$PWD:$PYTHONPATH # edit nwchem.py to make sure the CDLL() command has the right path to libnwchem.so (in a pinch, just move libnwchem.so to the current dir, and change the CDLL line to CDLL("libnwchem.so")) # run: mkdir scratch; mkdir perm #* these two dirs are the nwchem.py default scratch and perm directories # run: python test.py # if all goes well, you should see normal nwchem output (listing basis functions, showing geometry convergence, and ending with a citation note) == Help == The patch is released without any warranty or indeed any guarantee of working at all. If you have lots of ($$$) around, shoot me an email. 958c213784c8002b1fbaa6587a7541b95a3e24e3 268 267 2014-10-22T13:39:18Z David M. Rogers 2 wikitext text/x-wiki Libnwchem is a patch to the [http://www.nwchem-sw.org/index.php/Download#Patches_for_the_26243_revision_of_NWChem_6.5 6.5 Revision of NWChem] that adds three useful features. # push_inp_string and pop_inp_string (nw_inp_from_file.F) to fake string input as input from an nwchem parameter file #* push_inp_cstring (push_inp_cstring.c) to provide a 0-terminated c-string interface to same # an nwchem_init function (libnwchem.F) to perform just the start-up tasks of nwchem.F and return its runtime database handle #* a libnwchem target to the GNUMakefile (sorry, no cygwin right now) # nwchem.py, rtdb.py and related python wrappers to call nwchem's top-level functions and handle io from the rtdb #* various fixes to error handling in rtdb Warning: I've observed some strangeness with the test for a "movecs" file during SCF. If the python script changes the geometry, but the movecs file from a previous SCF calc. is left unchanged, SCF may be skipped. This results in similar property output for (actually) different structures. == Obtaining == You can download the patch [[File:libnwchem-6.5.patch.gz|here]]. Next, get the nwchem sources from the link at the top of the page. To unpack and patch them, use <source lang="bash"> tar xjf Nwchem-6.5.revision26243-src.2014-09-10.tar.bz2 mv Nwchem-6.5.revision26243-src nwchem-6.5 cd nwchem-6.5/src for i in Util_md_sockets Hbar Tcenxtask Parallelmpi Makefile_gcc4x Bcast_ccsd Elpa_syncs; do wget http://www.nwchem-sw.org/images/$i.patch.gz zcat $i.patch.gz | patch -p0 rm -f $i.patch.gz done i=Hnd_giaxyz_noinline # there's always that one. wget http://www.nwchem-sw.org/images/$i.patch.gz zcat $i.patch.gz | (cd NWints/hondo && patch -p0) rm -f $i.patch.gz # Finally, apply the libnwchem patch. zcat ../../libnwchem-6.5.patch.gz | patch -p1 cd .. bash ../build-6.5.sh # the build-6.5.sh script is at the bottom of this page. </source> The mv line is really required, since nwchem's build can fail if the path to the path to the source directory is too long! == Compilation == For most Linux systems (but not BSD-based OSX), the -fPIC flag is required. This is such a PITA to add to nwchem's compilation that my solution is an ugly hack. Replace the real compiler with a shell script in your $HOME/bin directory, and make sure your path has $HOME/bin in front of all other directories. (for icc) <source lang="bash"> #!/bin/sh # file $HOME/bin/icc /opt/intel/bin/icc -fPIC $@ </source> (or gcc) <source lang="bash"> #!/bin/sh # file $HOME/bin/gcc /usr/bin/gcc -fPIC $@ </source> I use the following script for compiling NWChem: (on 64-bit Linux with icc) <source lang="bash"> #!/bin/bash # file build-6.5.sh export NWCHEM_TOP=$HOME/build/nwchem-6.5 export NWCHEM_TARGET=LINUX64 export NWCHEM_MODULES=all export USE_MPI=y export USE_MPIF=y export USE_MPIF4=y export MPI_LIB=/apps/openmpi/1.4.5/lib export MPI_INCLUDE=/apps/openmpi/1.4.5/include export LIBMPI="-lpthread -lmpi_f90 -lmpi_f77 -lmpi -lopen-rte -lopen-pal -lrdmacm -libverbs -lpsm_infinipath -lnuma -ldl -Wl,--export-dynamic -lnsl -lutil -lm -ldl" export ARMCI_NETWORK=OPENIB # export IB_INCLUDE <Location of Infiniband libraries>/include export MSG_COMMS=MPI export CC=icc export FCC=ifort export FOPTIMIZE="-O2 -fPIC" export FFLAGS="-O2 -fPIC" export CFLAGS="-O2 -fPIC" export MKLROOT=/apps/intel/mkl # see intel's link-line advisor for generating the next line. Use the options for single dynamic library. # (the following is for MKL 10.3.6 with icc 11.1) export BLASOPT="-i8 -I$MKLROOT/include/intel64/ilp64 -I$MKLROOT/include $MKLROOT/lib/intel64/libmkl_blas95_ilp64.a $MKLROOT/lib/intel64/libmkl_lapack95_ilp64.a -Wl,--start-group $MKLROOT/lib/intel64/libmkl_intel_ilp64.a $MKLROOT/lib/intel64/libmkl_core.a $MKLROOT/lib/intel64/libmkl_sequential.a -Wl,--end-group -lpthread -lm" # These may be helpful for compiling with CUDA, but beware - the resulting program no longer loads without cuda libraries! #export TCE_CUDA=n #export CUDA=$CUDA_HOME/bin/nvcc #export CUDA_FLAGS="-arch=sm_35" #export CUDA_INCLUDE="-I$CUDA_HOME/include" #export CUDA_LIBS="-L$CUDA_HOME/lib64 -lcudart -lcufft" # -L/usr/X11R6/lib -lGL -lGLU -lX11 -lXi -lXmu -lglut -lGLEW cd $NWCHEM_TOP/src #make realclean # These two lines let you start again (theoretically). #find . -name dependencies -exec rm {} \; -print make nwchem_config make nwchem #make -B -C ddscf # in case you just changed something in the ddscf directory cp util/cfileprefix.fh include/ make libnwchem </source> The line: '''cp util/cfileprefix.fh include/''' is required since nwchem has a really strange way of finding dependencies that works when compiling $(MAKE) stubs.o inside nwchem's target, but doesn't work when compiling $(MAKE) stubs.o inside libnwchem's target in the ''same makefile''! (on 64/32 OSX with gcc) to appear! == Testing == Inspecting the patch file, you will notice that the python wrapper was added into the src/python directory. It also includes a simple test (test.py), which opens libnwchem.so from its compiled location and does geometry optimization on a water molecule. To use it yourself, # cd to nwchem-6.5/src/python # export PYTHONPATH=$PWD:$PYTHONPATH # edit nwchem.py to make sure the CDLL() command has the right path to libnwchem.so (in a pinch, just move libnwchem.so to the current dir, and change the CDLL line to CDLL("libnwchem.so")) # run: mkdir scratch; mkdir perm #* these two dirs are the nwchem.py default scratch and perm directories # run: python test.py # if all goes well, you should see normal nwchem output (listing basis functions, showing geometry convergence, and ending with a citation note) == Help == The patch is released without any warranty or indeed any guarantee of working at all. If you have lots of ($$$) around, shoot me an email. 68d7379c721d8829fdfa46c3d0730dff71b56e68 File:Libnwchem-6.5.patch.gz 6 56 269 2014-10-22T13:40:17Z David M. Rogers 2 Patch to nwchem 6.5 for compilation as a shared library and use with python ctypes. wikitext text/x-wiki Patch to nwchem 6.5 for compilation as a shared library and use with python ctypes. f8667f972204222b84dc0cc5a70cecdb95e3e8c0 CompSciWeek9 0 57 270 2014-10-22T15:30:22Z David M. Rogers 2 Created page with "= Class 1, an in-depth look at class structure = * magic methods, __init__, etc. * class inheritance - extending something that does almost what you want ** ex. inheriting from …" wikitext text/x-wiki = Class 1, an in-depth look at class structure = * magic methods, __init__, etc. * class inheritance - extending something that does almost what you want ** ex. inheriting from dict * isinstance() function * methods and calling convention - the first argument to a class method is always the class (i.e. '''self''') * Binary operations __add__, __mul__, etc. - these have type class -> class -> class * static (immutable) vs. dynamic (mutable) ** classes are static ** instances are dynamic *** unless you only initialize and don't ever change them *** if you know it's static and __hash__ is implemented, you can use it as a key Example - wrapping a numpy array in a static class to build a cache: <source lang="python"> from numpy import * # TODO: make static! class s_ndarray: def __init__(self, x): self.x = x def __hash__(self): return hash(self.x.__repr__()) a = s_ndarray(arange(12)) # array -> float def en(x): print "Running (expensive) energy calculation." return x[0] # { s_ndarray : float } -> s_ndarray -> float def en_cached(cache, x): if x not in cache: cache[x] = en(x.x) # peel off s_ndarray and run the en function return cache[x] cache = {} x = s_ndarray(arange(12)) y = s_ndarray(ones(12)) print en_cached(cache, x) print en_cached(cache, y) print cache # these don't need to call en print en_cached(cache, y) print en_cached(cache, y) </source> = Class 2, python's ctypes = * Compiling a c code as a shared object ** the trouble with integers - always pick a fixed size! * loading with ctypes ** Declaring function types. ** Performance test Reference: [https://docs.python.org/2/library/ctypes.html] <source lang="C"> #include <stdint.h> /* Calculate the step-function discrete wavelet transformation * on the data x, placing the result in y. * * This assumes x and y are already allocated and of size n. * * x = ababab ababab * y = (a+b) (b-a) */ int32_t dwt(double *x, double *y, int32_t n) { int i; // index into x, moves from 0, ..., n-1 int a = 0; // index into y sum, moves from 0, ..., ceil n/2 int b = (n+1)/2; // index into y difference, moves from (ceil n/2)+1, ..., n-1 for(i=0; i<n-1; i+=2) { y[a] = 0.5*(x[i+1]+x[i]); y[b] = x[i+1]-x[i]; a += 1; b += 1; } // odd case, ceil n/2 = (n+1)/2 and we have an extra sum if(i == n-1) { y[a] = x[i]; } return 0; } </source> <source lang="bash"> gcc -o dwt_c.so -shared dwt.c </source> <source lang="python"> from ctypes import CDLL, c_int32, c_double import numpy as np import numpy.ctypeslib as ct import os cwd = os.path.dirname(os.path.abspath(__file__)) dw = CDLL(os.path.join(cwd, "dwt_c.so")) # Shorthand for setting function prototypes def decl_fn(a, *args): a.argtypes = args[:-1] a.restype = args[-1] def void_fn(a, *args): decl_fn(a, *(args+(None,))) def int_fn(a, *args): decl_fn(a, *(args+(c_int32,))) def dbl_fn(a, *args): decl_fn(a, *(args+(c_double,))) # Building up common, useful data types intarr = np.ctypeslib.ndpointer(dtype=np.int32, flags='C_CONTIGUOUS') dblarr = np.ctypeslib.ndpointer(dtype=np.float64, flags='C_CONTIGUOUS') decl_fn(dw.dwt, dblarr, dblarr, c_int32) def run_dwt(x): y = np.zeros(x.shape, dtype=np.float64) print dw.dwt(x.astype(np.float64), y, len(x)) return y print run_dwt(np.arange(12)) print run_dwt(np.arange(11)) </source> 6560a844b8fb5286174832272cf1c51d016bfd39 271 270 2014-10-22T15:53:11Z David M. Rogers 2 /* Class 2, python's ctypes */ wikitext text/x-wiki = Class 1, an in-depth look at class structure = * magic methods, __init__, etc. * class inheritance - extending something that does almost what you want ** ex. inheriting from dict * isinstance() function * methods and calling convention - the first argument to a class method is always the class (i.e. '''self''') * Binary operations __add__, __mul__, etc. - these have type class -> class -> class * static (immutable) vs. dynamic (mutable) ** classes are static ** instances are dynamic *** unless you only initialize and don't ever change them *** if you know it's static and __hash__ is implemented, you can use it as a key Example - wrapping a numpy array in a static class to build a cache: <source lang="python"> from numpy import * # TODO: make static! class s_ndarray: def __init__(self, x): self.x = x def __hash__(self): return hash(self.x.__repr__()) a = s_ndarray(arange(12)) # array -> float def en(x): print "Running (expensive) energy calculation." return x[0] # { s_ndarray : float } -> s_ndarray -> float def en_cached(cache, x): if x not in cache: cache[x] = en(x.x) # peel off s_ndarray and run the en function return cache[x] cache = {} x = s_ndarray(arange(12)) y = s_ndarray(ones(12)) print en_cached(cache, x) print en_cached(cache, y) print cache # these don't need to call en print en_cached(cache, y) print en_cached(cache, y) </source> = Class 2, python's ctypes = * Compiling a c code as a shared object ** the trouble with integers - always pick a fixed size! * loading with ctypes ** Declaring function types. ** Performance test Reference: [https://docs.python.org/2/library/ctypes.html Python Docs] [http://wiki.scipy.org/Cookbook/Ctypes Numpy + Ctypes Cookbook] '''dwt.c''' - run one step of a discrete wavelet transformation. <source lang="C"> #include <stdint.h> /* Calculate the step-function discrete wavelet transformation * on the data x, placing the result in y. * * This assumes x and y are already allocated and of size n. * * x = ababab ababab * y = (a+b) (b-a) */ int32_t dwt(double *x, double *y, int32_t n) { int i; // index into x, moves from 0, ..., n-1 int a = 0; // index into y sum, moves from 0, ..., ceil n/2 int b = (n+1)/2; // index into y difference, moves from (ceil n/2)+1, ..., n-1 for(i=0; i<n-1; i+=2) { y[a] = 0.5*(x[i+1]+x[i]); y[b] = x[i+1]-x[i]; a += 1; b += 1; } // odd case, ceil n/2 = (n+1)/2 and we have an extra sum if(i == n-1) { y[a] = x[i]; } return 0; } </source> Compile the C code to a shared library using gcc: <source lang="bash"> gcc -o dwt_c.so -shared dwt.c </source> Now load and run the object from python: '''dwt.py''' <source lang="python"> from ctypes import CDLL, c_int32, c_double import numpy as np import numpy.ctypeslib as ct import os cwd = os.path.dirname(os.path.abspath(__file__)) dw = CDLL(os.path.join(cwd, "dwt_c.so")) # Shorthand for setting function prototypes def decl_fn(a, *args): a.argtypes = args[:-1] a.restype = args[-1] def void_fn(a, *args): decl_fn(a, *(args+(None,))) def int_fn(a, *args): decl_fn(a, *(args+(c_int32,))) def dbl_fn(a, *args): decl_fn(a, *(args+(c_double,))) # Building up common, useful data types intarr = np.ctypeslib.ndpointer(dtype=np.int32, flags='C_CONTIGUOUS') dblarr = np.ctypeslib.ndpointer(dtype=np.float64, flags='C_CONTIGUOUS') decl_fn(dw.dwt, dblarr, dblarr, c_int32) def run_dwt(x): y = np.zeros(x.shape, dtype=np.float64) print dw.dwt(x.astype(np.float64), y, len(x)) return y print run_dwt(np.arange(12)) print run_dwt(np.arange(11)) </source> '''vis.py''' - visualize the DWT by running on image data <source lang="python"> import PIL from dwt import run_dwt, np # convert to 1-color (luminance) img = PIL.Image.open("Mitosis.png").convert("L") x = np.array(img) y = np.array(map(run_dwt, x)) img = PIL.Image.fromarray(y) img.show() </source> Here's a test image to use: [[File:Mitosis.png]] Image from [http://brookeborel.com/2011/06/02/363/ Brooke Borel]. 04fbc0e94bbdb24ea55a938b8c494fd4e4b3594c 273 271 2014-10-22T16:08:34Z David M. Rogers 2 /* Class 2, python's ctypes */ wikitext text/x-wiki = Class 1, an in-depth look at class structure = * magic methods, __init__, etc. * class inheritance - extending something that does almost what you want ** ex. inheriting from dict * isinstance() function * methods and calling convention - the first argument to a class method is always the class (i.e. '''self''') * Binary operations __add__, __mul__, etc. - these have type class -> class -> class * static (immutable) vs. dynamic (mutable) ** classes are static ** instances are dynamic *** unless you only initialize and don't ever change them *** if you know it's static and __hash__ is implemented, you can use it as a key Example - wrapping a numpy array in a static class to build a cache: <source lang="python"> from numpy import * # TODO: make static! class s_ndarray: def __init__(self, x): self.x = x def __hash__(self): return hash(self.x.__repr__()) a = s_ndarray(arange(12)) # array -> float def en(x): print "Running (expensive) energy calculation." return x[0] # { s_ndarray : float } -> s_ndarray -> float def en_cached(cache, x): if x not in cache: cache[x] = en(x.x) # peel off s_ndarray and run the en function return cache[x] cache = {} x = s_ndarray(arange(12)) y = s_ndarray(ones(12)) print en_cached(cache, x) print en_cached(cache, y) print cache # these don't need to call en print en_cached(cache, y) print en_cached(cache, y) </source> = Class 2, python's ctypes = * Compiling a c code as a shared object ** the trouble with integers - always pick a fixed size! * loading with ctypes ** Declaring function types. ** Performance test Reference: [https://docs.python.org/2/library/ctypes.html Python Docs] [http://wiki.scipy.org/Cookbook/Ctypes Numpy + Ctypes Cookbook] === '''dwt.c''' - run one step of a discrete wavelet transformation. === <source lang="C"> #include <stdint.h> /* Calculate the step-function discrete wavelet transformation * on the data x, placing the result in y. * * This assumes x and y are already allocated and of size n. * * x = ababab ababab * y = (a+b) (b-a) */ int32_t dwt(double *x, double *y, int32_t n) { int i; // index into x, moves from 0, ..., n-1 int a = 0; // index into y sum, moves from 0, ..., ceil n/2 int b = (n+1)/2; // index into y difference, moves from (ceil n/2)+1, ..., n-1 for(i=0; i<n-1; i+=2) { y[a] = 0.5*(x[i+1]+x[i]); y[b] = x[i+1]-x[i]; a += 1; b += 1; } // odd case, ceil n/2 = (n+1)/2 and we have an extra sum if(i == n-1) { y[a] = x[i]; } return 0; } </source> === Compile the C code to a shared library using gcc: === <source lang="bash"> gcc -o dwt_c.so -shared dwt.c </source> === '''dwt.py''' - load and run the object from python === <source lang="python"> from ctypes import CDLL, c_int32, c_double import numpy as np import numpy.ctypeslib as ct import os cwd = os.path.dirname(os.path.abspath(__file__)) dw = CDLL(os.path.join(cwd, "dwt_c.so")) # Shorthand for setting function prototypes def decl_fn(a, *args): a.argtypes = args[:-1] a.restype = args[-1] def void_fn(a, *args): decl_fn(a, *(args+(None,))) def int_fn(a, *args): decl_fn(a, *(args+(c_int32,))) def dbl_fn(a, *args): decl_fn(a, *(args+(c_double,))) # Building up common, useful data types intarr = np.ctypeslib.ndpointer(dtype=np.int32, flags='C_CONTIGUOUS') dblarr = np.ctypeslib.ndpointer(dtype=np.float64, flags='C_CONTIGUOUS') decl_fn(dw.dwt, dblarr, dblarr, c_int32) def run_dwt(x): y = np.zeros(x.shape, dtype=np.float64) print dw.dwt(x.astype(np.float64), y, len(x)) return y print run_dwt(np.arange(12)) print run_dwt(np.arange(11)) </source> === '''vis.py''' - visualize the DWT by running on image data === <source lang="python"> import PIL from dwt import run_dwt, np # convert to 1-color (luminance) img = PIL.Image.open("Mitosis.png").convert("L") x = np.array(img) y = np.array(map(run_dwt, x)) img = PIL.Image.fromarray(y) img.show() </source> Here's a test image to use: [[File:Mitosis.png]] Image from [http://brookeborel.com/2011/06/02/363/ Brooke Borel]. 848b27f7a44c3df76d20b4d5791944cd673c6a5e 274 273 2014-10-22T16:14:51Z David M. Rogers 2 /* vis.py - visualize the DWT by running on image data */ wikitext text/x-wiki = Class 1, an in-depth look at class structure = * magic methods, __init__, etc. * class inheritance - extending something that does almost what you want ** ex. inheriting from dict * isinstance() function * methods and calling convention - the first argument to a class method is always the class (i.e. '''self''') * Binary operations __add__, __mul__, etc. - these have type class -> class -> class * static (immutable) vs. dynamic (mutable) ** classes are static ** instances are dynamic *** unless you only initialize and don't ever change them *** if you know it's static and __hash__ is implemented, you can use it as a key Example - wrapping a numpy array in a static class to build a cache: <source lang="python"> from numpy import * # TODO: make static! class s_ndarray: def __init__(self, x): self.x = x def __hash__(self): return hash(self.x.__repr__()) a = s_ndarray(arange(12)) # array -> float def en(x): print "Running (expensive) energy calculation." return x[0] # { s_ndarray : float } -> s_ndarray -> float def en_cached(cache, x): if x not in cache: cache[x] = en(x.x) # peel off s_ndarray and run the en function return cache[x] cache = {} x = s_ndarray(arange(12)) y = s_ndarray(ones(12)) print en_cached(cache, x) print en_cached(cache, y) print cache # these don't need to call en print en_cached(cache, y) print en_cached(cache, y) </source> = Class 2, python's ctypes = * Compiling a c code as a shared object ** the trouble with integers - always pick a fixed size! * loading with ctypes ** Declaring function types. ** Performance test Reference: [https://docs.python.org/2/library/ctypes.html Python Docs] [http://wiki.scipy.org/Cookbook/Ctypes Numpy + Ctypes Cookbook] === '''dwt.c''' - run one step of a discrete wavelet transformation. === <source lang="C"> #include <stdint.h> /* Calculate the step-function discrete wavelet transformation * on the data x, placing the result in y. * * This assumes x and y are already allocated and of size n. * * x = ababab ababab * y = (a+b) (b-a) */ int32_t dwt(double *x, double *y, int32_t n) { int i; // index into x, moves from 0, ..., n-1 int a = 0; // index into y sum, moves from 0, ..., ceil n/2 int b = (n+1)/2; // index into y difference, moves from (ceil n/2)+1, ..., n-1 for(i=0; i<n-1; i+=2) { y[a] = 0.5*(x[i+1]+x[i]); y[b] = x[i+1]-x[i]; a += 1; b += 1; } // odd case, ceil n/2 = (n+1)/2 and we have an extra sum if(i == n-1) { y[a] = x[i]; } return 0; } </source> === Compile the C code to a shared library using gcc: === <source lang="bash"> gcc -o dwt_c.so -shared dwt.c </source> === '''dwt.py''' - load and run the object from python === <source lang="python"> from ctypes import CDLL, c_int32, c_double import numpy as np import numpy.ctypeslib as ct import os cwd = os.path.dirname(os.path.abspath(__file__)) dw = CDLL(os.path.join(cwd, "dwt_c.so")) # Shorthand for setting function prototypes def decl_fn(a, *args): a.argtypes = args[:-1] a.restype = args[-1] def void_fn(a, *args): decl_fn(a, *(args+(None,))) def int_fn(a, *args): decl_fn(a, *(args+(c_int32,))) def dbl_fn(a, *args): decl_fn(a, *(args+(c_double,))) # Building up common, useful data types intarr = np.ctypeslib.ndpointer(dtype=np.int32, flags='C_CONTIGUOUS') dblarr = np.ctypeslib.ndpointer(dtype=np.float64, flags='C_CONTIGUOUS') decl_fn(dw.dwt, dblarr, dblarr, c_int32) def run_dwt(x): y = np.zeros(x.shape, dtype=np.float64) print dw.dwt(x.astype(np.float64), y, len(x)) return y print run_dwt(np.arange(12)) print run_dwt(np.arange(11)) </source> === '''vis.py''' - visualize the DWT by running on image data === <source lang="python"> from PIL import Image from pylab import imshow, show from dwt import run_dwt, np # convert to 1-color (luminance) img = Image.open("Mitosis.png").convert("L") x = np.array(img) y = np.array(map(run_dwt, x)) imshow(y) show() #img = Image.fromarray(y) #img.show() </source> Here's a test image to use: [[File:Mitosis.png|300px|alt=Mitosis]] Image from [http://brookeborel.com/2011/06/02/363/ Brooke Borel]. 50f22809c337c6369aa39dc711b94abfa8a59131 File:Mitosis.png 6 58 272 2014-10-22T15:54:46Z David M. Rogers 2 Image screen-grabbed from mitosis video at http://brookeborel.com/2011/06/02/363/. wikitext text/x-wiki Image screen-grabbed from mitosis video at http://brookeborel.com/2011/06/02/363/. 8adc17ace8641ebc6c62d7ca0ee79556ce2e8356 Stdlib 0 52 275 220 2014-10-22T21:37:43Z David M. Rogers 2 wikitext text/x-wiki <source lang="haskell"> /* Stdenv v 0.4 * * To be run once, create some useful standard objects, and save * as a commit structure (for later loading into stdenv-s). * * Create some useful primitives from the base commands, * 'typeof' = λ (t:⋆) (x:t) → t -- compilation step not yet complete (and presently skipped) * 'commit' : {} -> IO(string) * 'open' : string -> {} -- retrieve a previously committed dir. * 'Prim' : string -> ? -- outputs a prim * 'Base' : string -> ⋆ -- outputs the type of a base object */ -- Test types Nat : ⋆ Z : Nat Succ : Nat → Nat -- Simple functions id = λ x → x seq = λ a b → b const = λ a b → a flip = λ f a b → f b a >>= = applyIO =<< = flip (>>=) >> = λ a b → applyIO a (const b) infixl >>= 1 infixr =<< 1 infixl >> 1 -- $ : <a,b : 'kind> -> (a -> b) -> a -> b $ : (a -> b) -> a -> b $ = fun f x -> f x infixr $ 0 IO : (a : 'kind) -> 'kind ST : (a : 'kind) (r : 'kind) -> 'kind rm := Prim =<< commit { name = "rm", ptype = type String -> IO(Nil), n=1, extn = 1, -- IO prim API = "", reduce = " #include <ast.h> #include <cli.h> Ast *reduce(prim_cb_t *cb, struct Prim *p) { struct Environ *e = (struct Environ *)cb->st; if(p->t[0]->type != TBase || p->t[0]->base->type != TString) { printf(\"rm() called on non-string\\n\"); return mkNil(); } p9remove(e, p->t[0]->base->name); return mkNil(); }", } /* More work to do: unitIO applyIO unitST applyST rm pwd ls cd open gc_stat */ -- Save current project as a commit. -- commit_proj "stdenv-0.2" unApply = Prim "1572ad8f02e44c195ee3cfff433f0fa81df75268" -- string cat ++ = Prim "04abdf66335ce0504c9e7a1707445e2f700fc185" -- string slice !% = Prim "992740f62d4ca2f2ca9f6f6cf9274d8b9626a7c2" strlen = Prim "2081afb248e480a8f6ca6220156c69d7ac938ef8" infixl ++ 4 infix !% 5 sleep = Prim "89010250203552d538a6981e396d648999f2a62d" </source> e9f35330fcf0537d45b8f4e11778233385fb01e0 276 275 2014-10-22T21:45:06Z David M. Rogers 2 wikitext text/x-wiki == The Easy Way == You can load up the whole standard environment using the builtin set_com primitive. Currently, you also have to manually add infix rules for some symbols, like so <source lang="haskell"> set_com (open "4e300a52e42a7cd95db079511be5e9d0b86b9596") infixr $ 0 infixl >> 1 infixl >>= 1 infixl >>= 1 infixr =<< 1 infixr $ 0 infixl ++ 4 infixl !% 5 -- these are for match expressions infixl // 0 infixl $$ 1 infixl @ 2 </source> If you want to extend your stdenv, you can use get_com to get the current working commit. commit =<< get_com Use caution with get_com, since storing its return value leads to a recursive object and in infinite loop during evaluation. This will be fixed in the future by dis-allowing writes to commit objects (using an O(log n) functional re-write instead). == The Hard Way == <source lang="haskell"> /* Stdenv v 0.4 * * To be run once, create some useful standard objects, and save * as a commit structure (for later loading into stdenv-s). * * Create some useful primitives from the base commands, * 'typeof' = λ (t:⋆) (x:t) → t -- compilation step not yet complete (and presently skipped) * 'commit' : {} -> IO(string) * 'open' : string -> {} -- retrieve a previously committed dir. * 'Prim' : string -> ? -- outputs a prim * 'Base' : string -> ⋆ -- outputs the type of a base object */ -- Test types Nat : ⋆ Z : Nat Succ : Nat → Nat -- Simple functions id = λ x → x seq = λ a b → b const = λ a b → a flip = λ f a b → f b a >>= = applyIO =<< = flip (>>=) >> = λ a b → applyIO a (const b) infixl >>= 1 infixr =<< 1 infixl >> 1 -- $ : <a,b : 'kind> -> (a -> b) -> a -> b $ : (a -> b) -> a -> b $ = fun f x -> f x infixr $ 0 IO : (a : 'kind) -> 'kind ST : (a : 'kind) (r : 'kind) -> 'kind rm := Prim =<< commit { name = "rm", ptype = type String -> IO(Nil), n=1, extn = 1, -- IO prim API = "", reduce = " #include <ast.h> #include <cli.h> Ast *reduce(prim_cb_t *cb, struct Prim *p) { struct Environ *e = (struct Environ *)cb->st; if(p->t[0]->type != TBase || p->t[0]->base->type != TString) { printf(\"rm() called on non-string\\n\"); return mkNil(); } p9remove(e, p->t[0]->base->name); return mkNil(); }", } /* More work to do: unitIO applyIO unitST applyST rm pwd ls cd open gc_stat */ -- Save current project as a commit. -- commit_proj "stdenv-0.2" unApply = Prim "1572ad8f02e44c195ee3cfff433f0fa81df75268" -- string cat ++ = Prim "04abdf66335ce0504c9e7a1707445e2f700fc185" -- string slice !% = Prim "992740f62d4ca2f2ca9f6f6cf9274d8b9626a7c2" strlen = Prim "2081afb248e480a8f6ca6220156c69d7ac938ef8" infixl ++ 4 infix !% 5 sleep = Prim "89010250203552d538a6981e396d648999f2a62d" </source> 81d7401972d692150c0e27263fad7da7f14fd400 277 276 2014-10-22T21:49:30Z David M. Rogers 2 /* The Easy Way */ wikitext text/x-wiki == The Easy Way == You can load up the whole standard environment using the builtin set_com primitive. One exception are IO functions, which must be explicitly asked for (because of obvious security issues). Currently, you also have to manually add infix rules for user-defined functions, like so <source lang="haskell"> set_com (open "0b21518a6bed97b38745615071c91f976c0c1a96") sleep = Prim "89010250203552d538a6981e396d648999f2a62d" infixr $ 0 infixl >> 1 infixl >>= 1 infixl >>= 1 infixr =<< 1 infixr $ 0 infixl ++ 4 infixl !% 5 -- these are for match expressions infixl // 0 infixl $$ 1 infixl @ 2 </source> If you want to extend your stdenv, you can use get_com to get the current working commit. commit =<< get_com Use caution with get_com, since storing its return value leads to a recursive object and in infinite loop during evaluation. This will be fixed in the future by dis-allowing writes to commit objects (using an O(log n) functional re-write instead). == The Hard Way == <source lang="haskell"> /* Stdenv v 0.4 * * To be run once, create some useful standard objects, and save * as a commit structure (for later loading into stdenv-s). * * Create some useful primitives from the base commands, * 'typeof' = λ (t:⋆) (x:t) → t -- compilation step not yet complete (and presently skipped) * 'commit' : {} -> IO(string) * 'open' : string -> {} -- retrieve a previously committed dir. * 'Prim' : string -> ? -- outputs a prim * 'Base' : string -> ⋆ -- outputs the type of a base object */ -- Test types Nat : ⋆ Z : Nat Succ : Nat → Nat -- Simple functions id = λ x → x seq = λ a b → b const = λ a b → a flip = λ f a b → f b a >>= = applyIO =<< = flip (>>=) >> = λ a b → applyIO a (const b) infixl >>= 1 infixr =<< 1 infixl >> 1 -- $ : <a,b : 'kind> -> (a -> b) -> a -> b $ : (a -> b) -> a -> b $ = fun f x -> f x infixr $ 0 IO : (a : 'kind) -> 'kind ST : (a : 'kind) (r : 'kind) -> 'kind rm := Prim =<< commit { name = "rm", ptype = type String -> IO(Nil), n=1, extn = 1, -- IO prim API = "", reduce = " #include <ast.h> #include <cli.h> Ast *reduce(prim_cb_t *cb, struct Prim *p) { struct Environ *e = (struct Environ *)cb->st; if(p->t[0]->type != TBase || p->t[0]->base->type != TString) { printf(\"rm() called on non-string\\n\"); return mkNil(); } p9remove(e, p->t[0]->base->name); return mkNil(); }", } /* More work to do: unitIO applyIO unitST applyST rm pwd ls cd open gc_stat */ -- Save current project as a commit. -- commit_proj "stdenv-0.2" unApply = Prim "1572ad8f02e44c195ee3cfff433f0fa81df75268" -- string cat ++ = Prim "04abdf66335ce0504c9e7a1707445e2f700fc185" -- string slice !% = Prim "992740f62d4ca2f2ca9f6f6cf9274d8b9626a7c2" strlen = Prim "2081afb248e480a8f6ca6220156c69d7ac938ef8" infixl ++ 4 infix !% 5 sleep = Prim "89010250203552d538a6981e396d648999f2a62d" </source> 1cf97bfda3b1e1e2c7c802ae2e51b25b0e3a55e4 CompSciWeek10 0 59 278 2014-10-27T19:22:55Z David M. Rogers 2 Created page with "= Class 1 = A motivating problem for vector mathematics. The following problem appears in structure building for molecular modeling. The 20 common amino acids are joined into p…" wikitext text/x-wiki = Class 1 = A motivating problem for vector mathematics. The following problem appears in structure building for molecular modeling. The 20 common amino acids are joined into polypeptides by attaching the C-terminus of one amino acid to the N-terminus of the next. Each joint has a specific orientation in 3D space (determined by the amide plane). Here, we tackle a smaller instance of this problem. You are building a series of 2D figures by joining together the edges of smaller 2D figures. At each joining point, an orientation is specified in terms of local x and y directions. When joining A and B, for example, the ending orientation of A must match the starting orientation of B. We choose to rotate and translate B to make this happen. This phrasing is partially motivated by a fun little language for composing 2D figures [http://www.cs.ox.ac.uk/geomlab/home.html]. Its solution involves important concepts for determining relative positions and orientations using vectors, and should be generally useful for any problem involving geometric relationships. The following code outlines a class structure for holding each object. Two basic functions to implement are figure visualization (vis, below) and the joining process. Before the next class, try and implement the joining operation yourself! <source lang="python"> # Holds shape class from numpy import * import pylab as plt # not used, since it's just a single array # class Pt: # position + orientation (6 numbers) # v = array([[A00, A01, t0], # [A10, A11, t1]]) # A00, A10 is local x-direction # A01, A11 is local y-direction class Shape: # lines : [ t1, t2 ] (list of lines in object), t1 : 2D vec # REDO -- lines : one giant array # pts x 2 (st/end) x 2 # # rt : Pt (right sticky point) def __init__(self, lines, rt): self.lines = lines self.rt = rt def __add__(a, b): # return r = a + b print "TODO: implement addition" # 1. determine rotation matrix that attaches # b at origin onto a.rt # 2. transform all of b's lines and # add them to a.lines -> r # 3. fix r's right endpoint # by combining a's end with b's end return r # vis : Shape -> pylab state # do visualization using pylab # Note: This is not a method inside Shape since pylab is not really related # to the properties of the Shape class. def vis(s): # loop through lines and call plt.plot() on each one. for line in s.lines: st_x, st_y = line[0] en_x, en_y = line[1] plt.plot([st_x, en_x], [st_y, en_y], 'k-', lw=2) # extra lines to represent endpoint of the shape st_x, st_y = s.rt[:,2] en_x, en_y = s.rt[:,2] + s.rt[:,0]*0.2 plt.plot([st_x, en_x], [st_y, en_y], 'r-', lw=2) # local x-dir st_x, st_y = s.rt[:,2] en_x, en_y = s.rt[:,2] + s.rt[:,1]*0.2 plt.plot([st_x, en_x], [st_y, en_y], 'b-', lw=2) # local y-dir xh = array([[0,0], [1,0]]) # line from 0,0 to 1,0 yh = array([[0,0], [0,1]]) # line from 0,0 to 0,1 triangle = Shape(array([xh*2, [[0,0], [1,1]], [[2,0], [1,1]]]), array([[ sqrt(0.5),-sqrt(0.5), 1], [ sqrt(0.5), sqrt(0.5), 1]])) square = Shape([xh, xh+array([0,1]), yh, yh+array([1,0])], array([[1,0, 1], [0,1, 1]])) #a = triangle + square # plt.plot([-1,2], [-1,2], 'w') # make the plot large enough to see vis(triangle) plt.show() </source> = Class 2 = * Linear transformations * Homogeneous coordinates * Composing linear transformations * Inverse operations, implicit solutions, and complexities = Homework - Due Wed., Nov 5 = # I have a linear transformation that maps vectors in <math>R^m</math> to vectors in <math>R^n</math>. It is represented by a matrix (an <math>n \times m</math> array). I want to specify it in terms of how it acts on a set of starting vectors (in <math>R^n</math>). How many starting vectors do I need to transform for a complete specification? Is there an easy way to choose them? # Say that I wanted to have several "sticking points" for each object. What modifications would have to be made to the Shape class? What does this mean for the __add__ operation? # I have two objects in 3D, each with a 3x3 orientation matrix, A for object A and B for object B. What is the rotation matrix for rotating elements attached to A (specified in A's coordinate frame) to match elements attached to B (specified in B's coordinate frame)? # Coordinate frames always should have the property that each vector is normalized (<math>v_i \cdot v_i = 1</math>) and orthogonal to all the others (<math>v_i\cdot v_j = 0</math>). Matrix multiplication transforms objects in the coordinate frame to objects in the global frame. What does matrix multiplication do if the "coordinate frame" has a vector that is not normalized? What if it has 2 vectors that are not orthogonal? # The following function takes points in 2D space and fits them to a line of the form y = a*x + b. Use it to write a function that takes points in 2D space and returns an orientation matrix describing the best fit direction as "x hat" and the other direction as "y hat". <source lang="python"> from numpy import * import numpy.linalg as la def fit(xy): # xy is an N x 2 array of points V = xy.copy() # 1st col is x (linear term), a V[:,1] = 1.0 # 2nd col is 1.0 (constant term), b Vy = dot(xy[:,1], V) # sum x_i y_i and sum y_i Dx = dot(transpose(V), V) # Vandermonde matrix a, b = la.solve(Dx, Vy) # solve Dx * [a,b] = Vy return a, b x = arange(12) # test the function! y = x*12 - 2.0 + random.random() - 0.5 print fit(transpose([x,y])) </source> 74b6b4b460efb3a6f863c412cafba66342609af7 279 278 2014-10-27T19:24:15Z David M. Rogers 2 /* Homework - Due Wed., Nov 5 */ wikitext text/x-wiki = Class 1 = A motivating problem for vector mathematics. The following problem appears in structure building for molecular modeling. The 20 common amino acids are joined into polypeptides by attaching the C-terminus of one amino acid to the N-terminus of the next. Each joint has a specific orientation in 3D space (determined by the amide plane). Here, we tackle a smaller instance of this problem. You are building a series of 2D figures by joining together the edges of smaller 2D figures. At each joining point, an orientation is specified in terms of local x and y directions. When joining A and B, for example, the ending orientation of A must match the starting orientation of B. We choose to rotate and translate B to make this happen. This phrasing is partially motivated by a fun little language for composing 2D figures [http://www.cs.ox.ac.uk/geomlab/home.html]. Its solution involves important concepts for determining relative positions and orientations using vectors, and should be generally useful for any problem involving geometric relationships. The following code outlines a class structure for holding each object. Two basic functions to implement are figure visualization (vis, below) and the joining process. Before the next class, try and implement the joining operation yourself! <source lang="python"> # Holds shape class from numpy import * import pylab as plt # not used, since it's just a single array # class Pt: # position + orientation (6 numbers) # v = array([[A00, A01, t0], # [A10, A11, t1]]) # A00, A10 is local x-direction # A01, A11 is local y-direction class Shape: # lines : [ t1, t2 ] (list of lines in object), t1 : 2D vec # REDO -- lines : one giant array # pts x 2 (st/end) x 2 # # rt : Pt (right sticky point) def __init__(self, lines, rt): self.lines = lines self.rt = rt def __add__(a, b): # return r = a + b print "TODO: implement addition" # 1. determine rotation matrix that attaches # b at origin onto a.rt # 2. transform all of b's lines and # add them to a.lines -> r # 3. fix r's right endpoint # by combining a's end with b's end return r # vis : Shape -> pylab state # do visualization using pylab # Note: This is not a method inside Shape since pylab is not really related # to the properties of the Shape class. def vis(s): # loop through lines and call plt.plot() on each one. for line in s.lines: st_x, st_y = line[0] en_x, en_y = line[1] plt.plot([st_x, en_x], [st_y, en_y], 'k-', lw=2) # extra lines to represent endpoint of the shape st_x, st_y = s.rt[:,2] en_x, en_y = s.rt[:,2] + s.rt[:,0]*0.2 plt.plot([st_x, en_x], [st_y, en_y], 'r-', lw=2) # local x-dir st_x, st_y = s.rt[:,2] en_x, en_y = s.rt[:,2] + s.rt[:,1]*0.2 plt.plot([st_x, en_x], [st_y, en_y], 'b-', lw=2) # local y-dir xh = array([[0,0], [1,0]]) # line from 0,0 to 1,0 yh = array([[0,0], [0,1]]) # line from 0,0 to 0,1 triangle = Shape(array([xh*2, [[0,0], [1,1]], [[2,0], [1,1]]]), array([[ sqrt(0.5),-sqrt(0.5), 1], [ sqrt(0.5), sqrt(0.5), 1]])) square = Shape([xh, xh+array([0,1]), yh, yh+array([1,0])], array([[1,0, 1], [0,1, 1]])) #a = triangle + square # plt.plot([-1,2], [-1,2], 'w') # make the plot large enough to see vis(triangle) plt.show() </source> = Class 2 = * Linear transformations * Homogeneous coordinates * Composing linear transformations * Inverse operations, implicit solutions, and complexities = Homework - Due Wed., Nov 5 = # I have a linear transformation that maps vectors in <math>R^m</math> to vectors in <math>R^n</math>. It is represented by a matrix (an <math>n \times m</math> array). I want to specify it in terms of how it acts on a set of starting vectors (in <math>R^n</math>). How many starting vectors do I need to transform for a complete specification? Is there an easy way to choose them? # Say that I wanted to have several "sticking points" for each object. What modifications would have to be made to the Shape class? What does this mean for the __add__ operation? # I have two objects in 3D, each with a 3x3 orientation matrix, A for object A and B for object B. What is the rotation matrix for rotating elements attached to A (specified in A's coordinate frame) to match elements attached to B (specified in B's coordinate frame)? # Coordinate frames always should have the property that each vector is normalized (<math>v_i \cdot v_i = 1</math>) and orthogonal to all the others (<math>v_i\cdot v_j = 0</math>). Matrix multiplication transforms objects in the coordinate frame to objects in the global frame. What does matrix multiplication do if the "coordinate frame" has a vector that is not normalized? What if it has 2 vectors that are not orthogonal? # The following function takes points in 2D space and fits them to a line of the form y = a*x + b. Use it to write a function that takes points in 2D space and returns an orientation matrix describing the best fit direction as "x hat" and the other direction as "y hat". <source lang="python"> from numpy import * import numpy.linalg as la def fit(xy): # xy is an N x 2 array of points V = xy.copy() # 1st col is x (linear term), a V[:,1] = 1.0 # 2nd col is 1.0 (constant term), b Vy = dot(xy[:,1], V) # sum x_i y_i and sum y_i Dx = dot(transpose(V), V) # Vandermonde matrix a, b = la.solve(Dx, Vy) # solve Dx * [a,b] = Vy return a, b x = arange(12) # test the function! y = x*12 - 2.0 + random.random() - 0.5 print fit(transpose([x,y])) </source> af6d84f31ea59b241b797ef2689c73462f0ce9ac 286 279 2014-11-05T23:13:07Z David M. Rogers 2 /* Homework - Due Wed., Nov 5 */ wikitext text/x-wiki = Class 1 = A motivating problem for vector mathematics. The following problem appears in structure building for molecular modeling. The 20 common amino acids are joined into polypeptides by attaching the C-terminus of one amino acid to the N-terminus of the next. Each joint has a specific orientation in 3D space (determined by the amide plane). Here, we tackle a smaller instance of this problem. You are building a series of 2D figures by joining together the edges of smaller 2D figures. At each joining point, an orientation is specified in terms of local x and y directions. When joining A and B, for example, the ending orientation of A must match the starting orientation of B. We choose to rotate and translate B to make this happen. This phrasing is partially motivated by a fun little language for composing 2D figures [http://www.cs.ox.ac.uk/geomlab/home.html]. Its solution involves important concepts for determining relative positions and orientations using vectors, and should be generally useful for any problem involving geometric relationships. The following code outlines a class structure for holding each object. Two basic functions to implement are figure visualization (vis, below) and the joining process. Before the next class, try and implement the joining operation yourself! <source lang="python"> # Holds shape class from numpy import * import pylab as plt # not used, since it's just a single array # class Pt: # position + orientation (6 numbers) # v = array([[A00, A01, t0], # [A10, A11, t1]]) # A00, A10 is local x-direction # A01, A11 is local y-direction class Shape: # lines : [ t1, t2 ] (list of lines in object), t1 : 2D vec # REDO -- lines : one giant array # pts x 2 (st/end) x 2 # # rt : Pt (right sticky point) def __init__(self, lines, rt): self.lines = lines self.rt = rt def __add__(a, b): # return r = a + b print "TODO: implement addition" # 1. determine rotation matrix that attaches # b at origin onto a.rt # 2. transform all of b's lines and # add them to a.lines -> r # 3. fix r's right endpoint # by combining a's end with b's end return r # vis : Shape -> pylab state # do visualization using pylab # Note: This is not a method inside Shape since pylab is not really related # to the properties of the Shape class. def vis(s): # loop through lines and call plt.plot() on each one. for line in s.lines: st_x, st_y = line[0] en_x, en_y = line[1] plt.plot([st_x, en_x], [st_y, en_y], 'k-', lw=2) # extra lines to represent endpoint of the shape st_x, st_y = s.rt[:,2] en_x, en_y = s.rt[:,2] + s.rt[:,0]*0.2 plt.plot([st_x, en_x], [st_y, en_y], 'r-', lw=2) # local x-dir st_x, st_y = s.rt[:,2] en_x, en_y = s.rt[:,2] + s.rt[:,1]*0.2 plt.plot([st_x, en_x], [st_y, en_y], 'b-', lw=2) # local y-dir xh = array([[0,0], [1,0]]) # line from 0,0 to 1,0 yh = array([[0,0], [0,1]]) # line from 0,0 to 0,1 triangle = Shape(array([xh*2, [[0,0], [1,1]], [[2,0], [1,1]]]), array([[ sqrt(0.5),-sqrt(0.5), 1], [ sqrt(0.5), sqrt(0.5), 1]])) square = Shape([xh, xh+array([0,1]), yh, yh+array([1,0])], array([[1,0, 1], [0,1, 1]])) #a = triangle + square # plt.plot([-1,2], [-1,2], 'w') # make the plot large enough to see vis(triangle) plt.show() </source> = Class 2 = * Linear transformations * Homogeneous coordinates * Composing linear transformations * Inverse operations, implicit solutions, and complexities = Homework - Due Wed., Nov 5 = # I have a linear transformation that maps vectors in <math>R^m</math> to vectors in <math>R^n</math>. It is represented by a matrix (an <math>n \times m</math> array). I want to specify it in terms of how it acts on a set of starting vectors (in <math>R^m</math>). How many starting vectors do I need to transform for a complete specification? Is there an easy way to choose them? # Say that I wanted to have several "sticking points" for each object. What modifications would have to be made to the Shape class? What does this mean for the __add__ operation? # I have two objects in 3D, each with a 3x3 orientation matrix, A for object A and B for object B. What is the rotation matrix for rotating elements attached to A (specified in A's coordinate frame) to match elements attached to B (specified in B's coordinate frame)? # Coordinate frames always should have the property that each vector is normalized (<math>v_i \cdot v_i = 1</math>) and orthogonal to all the others (<math>v_i\cdot v_j = 0</math>). Matrix multiplication transforms objects in the coordinate frame to objects in the global frame. What does matrix multiplication do if the "coordinate frame" has a vector that is not normalized? What if it has 2 vectors that are not orthogonal? # The following function takes points in 2D space and fits them to a line of the form y = a*x + b. Use it to write a function that takes points in 2D space and returns an orientation matrix describing the best fit direction as "x hat" and the other direction as "y hat". <source lang="python"> from numpy import * import numpy.linalg as la def fit(xy): # xy is an N x 2 array of points V = xy.copy() # 1st col is x (linear term), a V[:,1] = 1.0 # 2nd col is 1.0 (constant term), b Vy = dot(xy[:,1], V) # sum x_i y_i and sum y_i Dx = dot(transpose(V), V) # Vandermonde matrix a, b = la.solve(Dx, Vy) # solve Dx * [a,b] = Vy return a, b x = arange(12) # test the function! y = x*12 - 2.0 + random.random() - 0.5 print fit(transpose([x,y])) </source> 0645e2eee967dc9879612afd6a2f7abf20d59c14 288 286 2014-11-06T21:45:11Z David M. Rogers 2 wikitext text/x-wiki = Suggested Reading = * [https://Fmath.dartmouth.edu/~m12f10/RepresentingMatrix.pdf Linear Transformations and Their Representing Matrices] by David Webb = Class 1 = A motivating problem for vector mathematics. The following problem appears in structure building for molecular modeling. The 20 common amino acids are joined into polypeptides by attaching the C-terminus of one amino acid to the N-terminus of the next. Each joint has a specific orientation in 3D space (determined by the amide plane). Here, we tackle a smaller instance of this problem. You are building a series of 2D figures by joining together the edges of smaller 2D figures. At each joining point, an orientation is specified in terms of local x and y directions. When joining A and B, for example, the ending orientation of A must match the starting orientation of B. We choose to rotate and translate B to make this happen. This phrasing is partially motivated by a fun little language for composing 2D figures [http://www.cs.ox.ac.uk/geomlab/home.html]. Its solution involves important concepts for determining relative positions and orientations using vectors, and should be generally useful for any problem involving geometric relationships. The following code outlines a class structure for holding each object. Two basic functions to implement are figure visualization (vis, below) and the joining process. Before the next class, try and implement the joining operation yourself! <source lang="python"> # Holds shape class from numpy import * import pylab as plt # not used, since it's just a single array # class Pt: # position + orientation (6 numbers) # v = array([[A00, A01, t0], # [A10, A11, t1]]) # A00, A10 is local x-direction # A01, A11 is local y-direction class Shape: # lines : [ t1, t2 ] (list of lines in object), t1 : 2D vec # REDO -- lines : one giant array # pts x 2 (st/end) x 2 # # rt : Pt (right sticky point) def __init__(self, lines, rt): self.lines = lines self.rt = rt def __add__(a, b): # return r = a + b print "TODO: implement addition" # 1. determine rotation matrix that attaches # b at origin onto a.rt # 2. transform all of b's lines and # add them to a.lines -> r # 3. fix r's right endpoint # by combining a's end with b's end return r # vis : Shape -> pylab state # do visualization using pylab # Note: This is not a method inside Shape since pylab is not really related # to the properties of the Shape class. def vis(s): # loop through lines and call plt.plot() on each one. for line in s.lines: st_x, st_y = line[0] en_x, en_y = line[1] plt.plot([st_x, en_x], [st_y, en_y], 'k-', lw=2) # extra lines to represent endpoint of the shape st_x, st_y = s.rt[:,2] en_x, en_y = s.rt[:,2] + s.rt[:,0]*0.2 plt.plot([st_x, en_x], [st_y, en_y], 'r-', lw=2) # local x-dir st_x, st_y = s.rt[:,2] en_x, en_y = s.rt[:,2] + s.rt[:,1]*0.2 plt.plot([st_x, en_x], [st_y, en_y], 'b-', lw=2) # local y-dir xh = array([[0,0], [1,0]]) # line from 0,0 to 1,0 yh = array([[0,0], [0,1]]) # line from 0,0 to 0,1 triangle = Shape(array([xh*2, [[0,0], [1,1]], [[2,0], [1,1]]]), array([[ sqrt(0.5),-sqrt(0.5), 1], [ sqrt(0.5), sqrt(0.5), 1]])) square = Shape([xh, xh+array([0,1]), yh, yh+array([1,0])], array([[1,0, 1], [0,1, 1]])) #a = triangle + square # plt.plot([-1,2], [-1,2], 'w') # make the plot large enough to see vis(triangle) plt.show() </source> = Class 2 = * Linear transformations * Homogeneous coordinates * Composing linear transformations * Inverse operations, implicit solutions, and complexities = Homework - Due Wed., Nov 5 = # I have a linear transformation that maps vectors in <math>R^m</math> to vectors in <math>R^n</math>. It is represented by a matrix (an <math>n \times m</math> array). I want to specify it in terms of how it acts on a set of starting vectors (in <math>R^m</math>). How many starting vectors do I need to transform for a complete specification? Is there an easy way to choose them? # Say that I wanted to have several "sticking points" for each object. What modifications would have to be made to the Shape class? What does this mean for the __add__ operation? # I have two objects in 3D, each with a 3x3 orientation matrix, A for object A and B for object B. What is the rotation matrix for rotating elements attached to A (specified in A's coordinate frame) to match elements attached to B (specified in B's coordinate frame)? # Coordinate frames always should have the property that each vector is normalized (<math>v_i \cdot v_i = 1</math>) and orthogonal to all the others (<math>v_i\cdot v_j = 0</math>). Matrix multiplication transforms objects in the coordinate frame to objects in the global frame. What does matrix multiplication do if the "coordinate frame" has a vector that is not normalized? What if it has 2 vectors that are not orthogonal? # The following function takes points in 2D space and fits them to a line of the form y = a*x + b. Use it to write a function that takes points in 2D space and returns an orientation matrix describing the best fit direction as "x hat" and the other direction as "y hat". <source lang="python"> from numpy import * import numpy.linalg as la def fit(xy): # xy is an N x 2 array of points V = xy.copy() # 1st col is x (linear term), a V[:,1] = 1.0 # 2nd col is 1.0 (constant term), b Vy = dot(xy[:,1], V) # sum x_i y_i and sum y_i Dx = dot(transpose(V), V) # Vandermonde matrix a, b = la.solve(Dx, Vy) # solve Dx * [a,b] = Vy return a, b x = arange(12) # test the function! y = x*12 - 2.0 + random.random() - 0.5 print fit(transpose([x,y])) </source> d8d13a0392f1dc7ae37bae7319c6f07ee0638aa0 CompSciWeek11 0 60 280 2014-11-03T17:24:14Z David M. Rogers 2 Created page with "= Class 1 = * Tensor Manipulations - distance distributions in random point set exercise ** [http://docs.scipy.org/doc/scipy-0.14.0/reference/generated/scipy.spatial.distance.pdi…" wikitext text/x-wiki = Class 1 = * Tensor Manipulations - distance distributions in random point set exercise ** [http://docs.scipy.org/doc/scipy-0.14.0/reference/generated/scipy.spatial.distance.pdist.html pdist] ** [http://docs.scipy.org/doc/scipy-0.14.0/reference/generated/scipy.stats.histogram.html histogram] * Rodriguez' Rotation Formula - the preferred method when you ''have'' to work with an angle. * Matrix Multiplication ** Basic linear algebra operations ** Timing Strassen (see also Winograd) = Class 2 = * Implicit solutions to linear algebraic equations ** Least-squares fitting ** Repetition for point sets - project out and re-fit ** Review projection and orthogonality (see also Gram-Schmidt) ** Solution by factorization + forward / reverse substitution * Minimization the hard way - nonlinear problems [http://docs.scipy.org/doc/scipy-0.14.0/reference/optimize.html Optimize] ** Transcendental problem, 5th order polynomials, etc. ** Geodesic paths via numerical optimization b5aaed92e586756fbcdd56bc4028d9eac378ba97 281 280 2014-11-03T17:24:42Z David M. Rogers 2 /* Class 1 */ wikitext text/x-wiki = Class 1 = * Tensor Manipulations - distance distributions in random point set exercise ** [http://docs.scipy.org/doc/scipy-0.14.0/reference/generated/scipy.spatial.distance.pdist.html pdist] ** [http://docs.scipy.org/doc/scipy-0.14.0/reference/generated/scipy.stats.histogram.html histogram] * Rodrigues' Rotation Formula - the preferred method when you ''have'' to work with an angle. * Matrix Multiplication ** Basic linear algebra operations ** Timing Strassen (see also Winograd) = Class 2 = * Implicit solutions to linear algebraic equations ** Least-squares fitting ** Repetition for point sets - project out and re-fit ** Review projection and orthogonality (see also Gram-Schmidt) ** Solution by factorization + forward / reverse substitution * Minimization the hard way - nonlinear problems [http://docs.scipy.org/doc/scipy-0.14.0/reference/optimize.html Optimize] ** Transcendental problem, 5th order polynomials, etc. ** Geodesic paths via numerical optimization d47f9775a43c68eb07fd5fd395647ee7c27f6dd5 282 281 2014-11-03T19:25:59Z David M. Rogers 2 /* Class 1 */ wikitext text/x-wiki = Class 1 = * Tensor Manipulations - distance distributions in random point set exercise ** [http://docs.scipy.org/doc/scipy-0.14.0/reference/generated/scipy.spatial.distance.pdist.html pdist] ** [http://docs.scipy.org/doc/scipy-0.14.0/reference/generated/scipy.stats.histogram.html histogram] * Rodrigues' Rotation Formula - the preferred method when you ''have'' to work with an angle. * Matrix Multiplication ** Basic linear algebra operations ** Timing Strassen (see also Winograd) <source lang="python"> # Radial distribution function calculator for un-scaled distributions. # (g(r) is get_rdf() * L**3/N and goes to 1). from numpy import * # Get the unnormalized rdf in an isotropic cubic box of side length L # return unit is particles per L's length unit^3 # Note that grid methods should be used for very large N. def get_rdf(x, L, M): D2 = x - x[:,newaxis] D2 -= L*floor(D2/L+0.5) # wrap into box r2 = sqrt(sum(D2*D2, -1)) s = arange(M+1)*0.5*L/M h, _ = histogram(r2, s) h[0] -= len(x) # remove self-distances # Divide by volume (times an extra (N-1), since we counted # N*(N-1) distances, but the density scales as N) h = h.astype(float) h /= (len(x)-1) * 4*pi/3.0*(s[1:]**3 - s[:-1]**3) return h # This should give a uniform RDF of 1000 pt / L**3 (= 1 here). def test(): N = 1000 L = 10.0 x = random.random((N,3))*L print get_rdf(x, L, 20) </source> <source lang="python"> # Build rotation matrix to rotate about an arbitrary vector using the right-hand rule. # Uses Rodrigues' rotation formula (in the quaternion representation). def build_rotation(n, theta): m = sum(n*n) if(m < 1.0-1.0e-10 or m > 1.0+1.0e-10): n /= sqrt(m) trans = zeros((3,3), float) s = sin(theta) c = cos(theta) trans[0,0] = c + n[0]*n[0]*(1.0-c) # Rodrigues' Rotation Formula trans[0,1] = n[0]*n[1]*(1.0-c) - n[2]*s trans[0,2] = n[1]*s + n[0]*n[2]*(1.0-c) trans[1,0] = n[2]*s + n[0]*n[1]*(1.0-c) trans[1,1] = c + n[1]*n[1]*(1.0-c) trans[1,2] = -n[0]*s + n[1]*n[2]*(1.0-c) trans[2,0] = -n[1]*s + n[0]*n[2]*(1.0-c) trans[2,1] = n[0]*s + n[1]*n[2]*(1.0-c) trans[2,2] = c + n[2]*n[2]*(1.0-c) return trans </source> = Class 2 = * Implicit solutions to linear algebraic equations ** Least-squares fitting ** Repetition for point sets - project out and re-fit ** Review projection and orthogonality (see also Gram-Schmidt) ** Solution by factorization + forward / reverse substitution * Minimization the hard way - nonlinear problems [http://docs.scipy.org/doc/scipy-0.14.0/reference/optimize.html Optimize] ** Transcendental problem, 5th order polynomials, etc. ** Geodesic paths via numerical optimization b68c443fb78f909f9680cf644dd7eecd7cacc2e8 283 282 2014-11-03T19:28:50Z David M. Rogers 2 /* Class 1 */ wikitext text/x-wiki = Class 1 = * Tensor Manipulations - distance distributions in random point set exercise ** [http://docs.scipy.org/doc/scipy-0.14.0/reference/generated/scipy.spatial.distance.pdist.html pdist] ** [http://docs.scipy.org/doc/scipy-0.14.0/reference/generated/scipy.stats.histogram.html histogram] * Rodrigues' Rotation Formula - the preferred method when you ''have'' to work with an angle. * Matrix Multiplication ** Basic linear algebra operations ** Timing Strassen (see also Winograd) == Distribution Function Code == This illustrates dramatic simplifications that can be obtained by using tensors in numpy. <source lang="python"> # Radial distribution function calculator for un-scaled distributions. # (g(r) is get_rdf() * L**3/N and goes to 1). from numpy import * # Get the unnormalized rdf in an isotropic cubic box of side length L # return unit is particles per L's length unit^3 # Note that grid methods should be used for very large N. def get_rdf(x, L, M): D2 = x - x[:,newaxis] D2 -= L*floor(D2/L+0.5) # wrap into box r2 = sqrt(sum(D2*D2, -1)) s = arange(M+1)*0.5*L/M h, _ = histogram(r2, s) h[0] -= len(x) # remove self-distances # Divide by volume (times an extra (N-1), since we counted # N*(N-1) distances, but the density scales as N) h = h.astype(float) h /= (len(x)-1) * 4*pi/3.0*(s[1:]**3 - s[:-1]**3) return h # This should give a uniform RDF of 1000 pt / L**3 (= 1 here). def test(): N = 1000 L = 10.0 x = random.random((N,3))*L print get_rdf(x, L, 20) </source> Rodrigues' formula code. This is for completeness, so you can generate 3D rotations given in axis-angle notation. <source lang="python"> # Build rotation matrix to rotate about an arbitrary vector using the right-hand rule. # Uses Rodrigues' rotation formula (in the quaternion representation). def build_rotation(u, theta): n = u m = sum(n*n) # check that n is normalized if(m < 1.0-1.0e-10 or m > 1.0+1.0e-10): n /= sqrt(m) trans = zeros((3,3), float) s = sin(theta) c = cos(theta) trans[0,0] = c + n[0]*n[0]*(1.0-c) trans[0,1] = n[0]*n[1]*(1.0-c) - n[2]*s trans[0,2] = n[1]*s + n[0]*n[2]*(1.0-c) trans[1,0] = n[2]*s + n[0]*n[1]*(1.0-c) trans[1,1] = c + n[1]*n[1]*(1.0-c) trans[1,2] = -n[0]*s + n[1]*n[2]*(1.0-c) trans[2,0] = -n[1]*s + n[0]*n[2]*(1.0-c) trans[2,1] = n[0]*s + n[1]*n[2]*(1.0-c) trans[2,2] = c + n[2]*n[2]*(1.0-c) return trans </source> = Class 2 = * Implicit solutions to linear algebraic equations ** Least-squares fitting ** Repetition for point sets - project out and re-fit ** Review projection and orthogonality (see also Gram-Schmidt) ** Solution by factorization + forward / reverse substitution * Minimization the hard way - nonlinear problems [http://docs.scipy.org/doc/scipy-0.14.0/reference/optimize.html Optimize] ** Transcendental problem, 5th order polynomials, etc. ** Geodesic paths via numerical optimization ab987efaae0c1af5601745f8f53a62388e2fa4e5 285 283 2014-11-05T23:12:15Z David M. Rogers 2 wikitext text/x-wiki = Reading Assignment = * [http://apps.nrbook.com/empanel/index.html Numerical Recipes] Pages 37-40 * [http://calnewport.com/blog/2012/10/26/mastering-linear-algebra-in-10-days-astounding-experiments-in-ultra-learning/ Feynman Learning Technique] ** Try and identify the most challenging missing concept and explain it to someone else! * Optional Additional reference: Basis and Singular Value lectures from [http://codingthematrix.com/ codingthematrix.com] = Class 1 = * Tensor Manipulations - distance distributions in random point set exercise ** [http://docs.scipy.org/doc/scipy-0.14.0/reference/generated/scipy.spatial.distance.pdist.html pdist] ** [http://docs.scipy.org/doc/scipy-0.14.0/reference/generated/scipy.stats.histogram.html histogram] * Rodrigues' Rotation Formula - the preferred method when you ''have'' to work with an angle. * Matrix Multiplication ** Basic linear algebra operations ** Timing Strassen (see also Winograd) == Distribution Function Code == This illustrates dramatic simplifications that can be obtained by using tensors in numpy. <source lang="python"> # Radial distribution function calculator for un-scaled distributions. # (g(r) is get_rdf() * L**3/N and goes to 1). from numpy import * # Get the unnormalized rdf in an isotropic cubic box of side length L # return unit is particles per L's length unit^3 # Note that grid methods should be used for very large N. def get_rdf(x, L, M): D2 = x - x[:,newaxis] D2 -= L*floor(D2/L+0.5) # wrap into box r2 = sqrt(sum(D2*D2, -1)) s = arange(M+1)*0.5*L/M h, _ = histogram(r2, s) h[0] -= len(x) # remove self-distances # Divide by volume (times an extra (N-1), since we counted # N*(N-1) distances, but the density scales as N) h = h.astype(float) h /= (len(x)-1) * 4*pi/3.0*(s[1:]**3 - s[:-1]**3) return h # This should give a uniform RDF of 1000 pt / L**3 (= 1 here). def test(): N = 1000 L = 10.0 x = random.random((N,3))*L print get_rdf(x, L, 20) </source> Rodrigues' formula code. This is for completeness, so you can generate 3D rotations given in axis-angle notation. It is definitely not for memorization. <source lang="python"> # Build rotation matrix to rotate about an arbitrary vector using the right-hand rule. # Uses Rodrigues' rotation formula (in the quaternion representation). def build_rotation(u, theta): n = u m = sum(n*n) # check that n is normalized if(m < 1.0-1.0e-10 or m > 1.0+1.0e-10): n /= sqrt(m) trans = zeros((3,3), float) s = sin(theta) c = cos(theta) trans[0,0] = c + n[0]*n[0]*(1.0-c) trans[0,1] = n[0]*n[1]*(1.0-c) - n[2]*s trans[0,2] = n[1]*s + n[0]*n[2]*(1.0-c) trans[1,0] = n[2]*s + n[0]*n[1]*(1.0-c) trans[1,1] = c + n[1]*n[1]*(1.0-c) trans[1,2] = -n[0]*s + n[1]*n[2]*(1.0-c) trans[2,0] = -n[1]*s + n[0]*n[2]*(1.0-c) trans[2,1] = n[0]*s + n[1]*n[2]*(1.0-c) trans[2,2] = c + n[2]*n[2]*(1.0-c) return trans </source> = Class 2 = * Implicit solutions to linear algebraic equations ** Least-squares fitting ** Repetition for point sets - project out and re-fit ** Review projection and orthogonality (see also Gram-Schmidt) ** Solution by factorization + forward / reverse substitution * Minimization the hard way - nonlinear problems [http://docs.scipy.org/doc/scipy-0.14.0/reference/optimize.html Optimize] ** Transcendental problem, 5th order polynomials, etc. ** Geodesic paths via numerical optimization 93bea0309b62a8a38c285b37edf9107e8a7fdd37 Publications 0 8 284 230 2014-11-04T20:07:53Z David M. Rogers 2 wikitext text/x-wiki {| cellpadding="4" style="border: 1px solid darkgray;" |- style="border: 1px solid darkgray;" || David M. Rogers. "Real-space quadrature: a convenient, efficient representation for multipole expansions." submitted [http://arxiv.org/abs/1411.0011 arXiv:1411.0011], 2014. ([http://predictivestatmech.org/papers/real-poles.pdf Presentation]) I introduce sets of point charges that are able to simultaneously reproduce all multipole (spherical harmonic) expansions up to arbitrary order. The number of points is space-optimal. Translations are described from the usual harmonics and from Cartesian moments (dipole, quadrupole, etc.) on supersymmetric tensors to directional moments using the point weight distribution. Many applications are possible, including trivial implementation of multipoles in molecular mechanics and representing probability distributions over rotation space. |- style="border: 1px solid darkgray;" || David M. Rogers. "Silmaril, A Functional Language for Distributed Parallel Evaluation." [http://predictivestatmech.org/sil/papers/sil.pdf Submitted version] |- style="border: 1px solid darkgray;" || Mathias B. Andersen, David M. Rogers, Junyu Mai, Benjamin Schudel, Anson V. Hatch, Susan B. Rempe and Ali Mani. "Spatiotemporal pH dynamics in concentration polarization near ion-selective membranes." [http://dx.doi.org/10.1021/la5014297 Langmuir, 30(26):7902–7912, 2014] |- style="border: 1px solid darkgray;" || W. K. Chan, P. L. Lorenzi, A. Anishkin, P. Purwaha, D. M. Rogers, S. Sukharev, S.B. Rempe, and J. N. Weinstein. "The glutaminase activity of l-asparaginase is not required for anticancer activity against ASNS-negative cells." [http://dx.doi.org/10.1182/blood-2013-10-535112 Blood. 123(23):3596-606, 2014]. |- style="border: 1px solid darkgray;" || David M. Rogers, Dian Jiao, Lawrence Pratt, and Susan B. Rempe. "Structural Models and Molecular Thermodynamics of Hydration of Ions and Small Molecules" [http://dx.doi.org/10.1016/B978-0-444-59440-2.00004-1 Annu. Rep. Comp. Chem. 8:71–127, 2012.] |- style="border: 1px solid darkgray;" || David M. Rogers and Susan B. Rempe. "Irreversible Thermodynamics." [http://dx.doi.org/10.1088/1742-6596/402/1/012014 J. Phys.: Conf. Ser. 402:012014, 2012]. |- style="border: 1px solid darkgray;" || David M. Rogers, Thomas L. Beck, and Susan B. Rempe. [[Media:Dmroge_InfoNonequ2011.pdf|"An Information Theory Approach to Nonlinear, Nonequilibrium Thermodynamics."]] [http://dx.doi.org/10.1007/s10955-011-0358-9 J. Stat. Phys. 145(2):385-409, 2011] We show how the interpretation of thermodynamic states as representing system information leads naturally to thermodynamic cycles and the first and second laws of thermodynamics as well as similar formulations for nontrivial nonequilibrium problems. The logical development of the theory also leads naturally to correct indistinguishability factors in the partition function. |- style="border: 1px solid darkgray;" || Sameer Varma, David M. Rogers, Lawrence R. Pratt, and Susan B. Rempe. "Perspectives on Ion Selectivity: Design Principles for K+ Selectivity in Membrane Transport." [http://jgp.rupress.org/content/137/6/479.full J. Gen. Physiol., 137(6):479-488, 2011.] We review the development of models for understanding the physical basis of selectivity for K+ ions over Na+, its sibling only one row behind, in membrane channels and transporters. Although the problem is subtle because of the morass of competing effects, we emphasize work analyzing the systematic influence of the environment on tipping local binding site structure toward selective configurations. |- style="border: 1px solid darkgray;" || David M. Rogers and Susan B. Rempe. [http://www.ncbi.nlm.nih.gov/pmc/articles/PMC3443978/ “Probing the Thermodynamics of Competitive Ion Binding Using Minimum Energy Structures.”] [http://dx.doi.org/10.1021/jp2012864 J. Phys. Chem. B, 115(29):9116-29, 2011]. We presented an extension of the Quasi-Chemical theory for quantifying the impact of local structure on ion complexation thermodynamics. The theory can be simply represented using a set of thermodynamic cycles involving binding site structural and compositional states as reaction intermediates. |- style="border: 1px solid darkgray;" || Susan B. Rempe and David M. Rogers; et. al. “Computational and experimental platform for understanding and optimizing water flux and salt rejection in nanoporous membranes.” [http://prod.sandia.gov/techlib/access-control.cgi/2010/106735.pdf Sandia Technical Report, SAND2010-6735, 2010.] We summarize work on designing polymer coatings for salt exclusion in water transporting nanopores. In this work, I collected available molecular dynamics results for these systems and performed a novel energy efficiency analysis able to relate atomistic and experimental scales as well as identify important design goals and chemical principles for material performance. |- style="border: 1px solid darkgray;" || David M. Rogers, [http://rave.ohiolink.edu/etdc/view?acc_num=ucin1251832030 ''''Using Bayes' Theorem for Free Energy Calculations''''], 2009. We investigated the central quantity of free energies in a Bayesian context and provide estimators for solvation free energies as well as optimal potential of mean force approximations to model polymer coarse-grained dynamics from atomistic simulations. |- style="border: 1px solid darkgray;" || Zhen Zhao, David M. Rogers and Thomas L. Beck. "Polarization and Charge Transfer in the Hydration of Chloride Ions." [http://link.aip.org/link/?JCP/132/014502/1 J. Chem. Phys., 132:014502, 2010.] Dr. Zhao's ab-initio analysis of the charge distribution in water-ion clusters highlighted the importance of many-body water-water interactions and charge transfer effects in determining cluster structural and energetic properties. These are still challenging to represent in modern polarizable forcefields and have implications for anion properties at interfaces. |- style="border: 1px solid darkgray;" || David M. Rogers and Thomas L. Beck. "Quasi-Chemical and Structural Analysis of Polarizable Anion Hydration." [http://link.aip.org/link/?JCP/132/014505/1 J. Chem. Phys., 132:014505, 2010.] The role of polarizability in forcefield-based models of ions and water was examined. Utilizing some of our recent developments on quasi-chemical theory, we have been able to quantify the tightened, asymmetric nature of the ion's local solvation waters induced by increased polarizability as well as the exact effects of polarization on the solvation free energy. The results suggest some potential problems and diagnostics for such models. |- style="border: 1px solid darkgray;" || David M. Rogers and Thomas L. Beck. [http://forcesolve.sourceforge.net/ Force Solve] (Sourceforge, Chicago IL, 2008). This force matching software implements and tests coarse-graining for general molecular systems in a mere 4000 lines of code. It is able to parametrize coarse Hamiltonians from atomic trajectory data given arbitrary definitions of coarse united-atom type models as well as carry out short Langevin Dynamics simulations on the coarse scale. The program's main drawbacks are its slow speed and high memory usage due to its simplistic design, attributable to the interpreted nature of python. |- style="border: 1px solid darkgray;" || David M. Rogers and Thomas L. Beck. "Resolution and Scale Independent Nonparametric Function Matching Using a String Energy Penalized Spline Prior." 2008. [http://arxiv.org/abs/1003.4741 arXiv:1003.4741v1] (stat.ML). Fresh insight is provided into long-standing mathematical issues surrounding computational modeling of continuous functions from a few sampled data points. The present research lays the groundwork for predicting the behavior of complicated many-body systems using advanced regression techniques. |} 1df8923e31a67bb4a37a49c960a4281cf5b1d333 CompSciWeek12 0 61 287 2014-11-05T23:47:34Z David M. Rogers 2 Created page with "= Reading Assignment = * [http://web.mit.edu/18.06/www/Spring97/exam-97.html Problem Series] from MIT Linear Algebra Course = Class 1 & 2 = * Numerical Optimization * Numerical …" wikitext text/x-wiki = Reading Assignment = * [http://web.mit.edu/18.06/www/Spring97/exam-97.html Problem Series] from MIT Linear Algebra Course = Class 1 & 2 = * Numerical Optimization * Numerical Integration - complete example for particle growth statistics ** Integrating with GNU ODE <!-- * Statistical Sampling - scaling and shifting * Successive Choices = Gibbs Sampling * Random Walks --> = Homework 7 - Due Monday, November 17 = * Create two short essays by hand explaining the key concepts with equations and sketches (see Feynman Learning Technique) for: ** Rotation and translation to align axes in a 2D figure to a given endpoint. ** Gradient-following minimization of a function of N variables. * Write an exercise to test a student's ability to translate between tensordot(), subscript summation notation, and a summation using a for-loop. 0982a9c3d408a6fc72c8286160eeeb0558b333c6 291 287 2014-11-07T20:32:53Z David M. Rogers 2 /* Reading Assignment */ wikitext text/x-wiki = Reading Assignment = * [http://web.mit.edu/18.06/www/Spring97/exam-97.html Problem Series] from MIT Linear Algebra Course * [http://predictivestatmech.org/papers/pre-linalg.pdf Notes on Linear Algebra] = Class 1 & 2 = * Numerical Optimization * Numerical Integration - complete example for particle growth statistics ** Integrating with GNU ODE <!-- * Statistical Sampling - scaling and shifting * Successive Choices = Gibbs Sampling * Random Walks --> = Homework 7 - Due Monday, November 17 = * Create two short essays by hand explaining the key concepts with equations and sketches (see Feynman Learning Technique) for: ** Rotation and translation to align axes in a 2D figure to a given endpoint. ** Gradient-following minimization of a function of N variables. * Write an exercise to test a student's ability to translate between tensordot(), subscript summation notation, and a summation using a for-loop. 368afa48bce9d12ebb19b915e2e62be0883c76d8 292 291 2014-11-12T20:27:13Z David M. Rogers 2 /* Reading Assignment */ wikitext text/x-wiki = Reading Assignment = * [http://web.mit.edu/18.06/www/Spring97/exam-97.html Problem Series] from MIT Linear Algebra Course * [http://predictivestatmech.org/papers/pre-linalg.pdf Notes on Linear Algebra] * [[File:coord.pdf Lecture Notes]] on Linear Algebra and Numerical Optimization = Class 1 & 2 = * Numerical Optimization * Numerical Integration - complete example for particle growth statistics ** Integrating with GNU ODE <!-- * Statistical Sampling - scaling and shifting * Successive Choices = Gibbs Sampling * Random Walks --> = Homework 7 - Due Monday, November 17 = * Create two short essays by hand explaining the key concepts with equations and sketches (see Feynman Learning Technique) for: ** Rotation and translation to align axes in a 2D figure to a given endpoint. ** Gradient-following minimization of a function of N variables. * Write an exercise to test a student's ability to translate between tensordot(), subscript summation notation, and a summation using a for-loop. aecab5c7ba5a9436aa0a0b314a8511d16f248e87 294 292 2014-11-13T17:21:28Z David M. Rogers 2 /* Reading Assignment */ wikitext text/x-wiki = Reading Assignment = * [http://web.mit.edu/18.06/www/Spring97/exam-97.html Problem Series] from MIT Linear Algebra Course * [http://predictivestatmech.org/papers/pre-linalg.pdf Notes on Linear Algebra] * [[Media:Coord.pdf|Lecture Notes]] on Linear Algebra and Numerical Optimization = Class 1 & 2 = * Numerical Optimization * Numerical Integration - complete example for particle growth statistics ** Integrating with GNU ODE <!-- * Statistical Sampling - scaling and shifting * Successive Choices = Gibbs Sampling * Random Walks --> = Homework 7 - Due Monday, November 17 = * Create two short essays by hand explaining the key concepts with equations and sketches (see Feynman Learning Technique) for: ** Rotation and translation to align axes in a 2D figure to a given endpoint. ** Gradient-following minimization of a function of N variables. * Write an exercise to test a student's ability to translate between tensordot(), subscript summation notation, and a summation using a for-loop. 80adf401d3f8e4b6f86599ba6d561ce17d0cfe82 Predictive Chemistry:Current events 4 10 289 157 2014-11-06T22:32:42Z David M. Rogers 2 wikitext text/x-wiki * Saturday, Nov. 22 2014: USF and neighboring universities are hosting a [http://predictivestatmech.org/papers/MRI-flyer.pdf Scientific Computing Workshop] for undergraduates. Follow the instructions in the flyer to sign up by Nov. 11! * Thursday, Oct. Oct. 16: David M. Rogers presented "[http://predictivestatmech.org/papers/real-poles.pdf Real-space quadrature: A convenient, universal representation for multipole expansions]." at the Southeast Regional Meeting of the ACS in Nashville, TN. * Friday, August 29 2014: Felipe Zapata joins the group! * Monday, August 25 2014: USF Autumn Semester First Day of Classes - don't forget to sign up for [[CompSciFall2014|Introduction to Scientific Computing]]! * Monday, Aug. 18 2014: David M. Rogers presented an invited talk "pH Dynamics During Concentration Polarization," to the [http://www.pnnl.gov/computing/cm4/ CM4 Mathematics for Mesoscopic Materials Modeling Group]. * Tuesday, July 8 2014: David M. Rogers presented "What’s Holding Up Multiscale modeling?" at the Telluride, CO workshop for [http://www.telluridescience.org/meetings/workshop-details?wid=404 Ions in Aqueous Solutions and Molecular Biology]. * Friday, May 9 2014: David M. Rogers presented "Jumping from atomistic to continuum simulation of electrochemical driving at interfaces," at the 2014 Florida FAME Conference.[http://www.fame.chem.ufl.edu/computational.html] * January 29th, 2014: David M. Rogers presented "Simulating at the molecular / continuum interface," at the USF Research Computing User's Group Forum [http://www.usf.edu/it/research-computing/featured-researchers/rogersgroup.aspx]. * Monday, August 26 2013: USF Autumn Semester First Day of Classes * Friday, July 12, 2013: Argonne Center for Nanoscale Materials [http://nano.anl.gov/users/call_for_proposals.html Proposal Deadline] * Thursday, July 4, 2013: Independence Day - celebrate by supporting [https://www.eff.org/ EFF] * Thursday, April 11 2013: David M. Rogers presented "Solute Partitioning and Transport through Natural and Biomimetic Membranes," at the 2013 ACS National Meeting. == Calendars == * [http://www.registrar.usf.edu/enroll/regist/calendt.php USF Calendar] f923792244a98ec726a0c473ee9ec84aad3b9858 290 289 2014-11-06T22:33:32Z David M. Rogers 2 wikitext text/x-wiki * Saturday, Nov. 22 2014: USF and neighboring universities are hosting a [http://predictivestatmech.org/papers/MRI-flyer.pdf Scientific Computing Workshop] for undergraduates. Follow the instructions in the flyer to sign up by Nov. 11! * Thursday, Oct. 16: David M. Rogers presented "[http://predictivestatmech.org/papers/real-poles.pdf Real-space quadrature: A convenient, universal representation for multipole expansions]." at the Southeast Regional Meeting of the ACS in Nashville, TN. * Friday, Aug. 29 2014: Felipe Zapata joins the group! * Monday, Aug. 25 2014: USF Autumn Semester First Day of Classes - don't forget to sign up for [[CompSciFall2014|Introduction to Scientific Computing]]! * Monday, Aug. 18 2014: David M. Rogers presented an invited talk "pH Dynamics During Concentration Polarization," to the [http://www.pnnl.gov/computing/cm4/ CM4 Mathematics for Mesoscopic Materials Modeling Group]. * Tuesday, July 8 2014: David M. Rogers presented "What’s Holding Up Multiscale modeling?" at the Telluride, CO workshop for [http://www.telluridescience.org/meetings/workshop-details?wid=404 Ions in Aqueous Solutions and Molecular Biology]. * Friday, May 9 2014: David M. Rogers presented "Jumping from atomistic to continuum simulation of electrochemical driving at interfaces," at the 2014 Florida FAME Conference.[http://www.fame.chem.ufl.edu/computational.html] * January 29th, 2014: David M. Rogers presented "Simulating at the molecular / continuum interface," at the USF Research Computing User's Group Forum [http://www.usf.edu/it/research-computing/featured-researchers/rogersgroup.aspx]. * Monday, Aug. 26 2013: USF Autumn Semester First Day of Classes * Friday, July 12, 2013: Argonne Center for Nanoscale Materials [http://nano.anl.gov/users/call_for_proposals.html Proposal Deadline] * Thursday, July 4, 2013: Independence Day - celebrate by supporting [https://www.eff.org/ EFF] * Thursday, April 11 2013: David M. Rogers presented "Solute Partitioning and Transport through Natural and Biomimetic Membranes," at the 2013 ACS National Meeting. == Calendars == * [http://www.registrar.usf.edu/enroll/regist/calendt.php USF Calendar] 5769500a6f1604505245a1e02737f706f6aa3430 File:Coord.pdf 6 62 293 2014-11-12T20:27:59Z David M. Rogers 2 wikitext text/x-wiki da39a3ee5e6b4b0d3255bfef95601890afd80709 CompSciWeek13 0 63 295 2014-11-17T14:02:32Z David M. Rogers 2 Created page with "= Numerical Integration = * The tinkerbell attractor ** Implementations in OpenOffice Spreadsheet, GNU ODE, and Python ** Perturbed initial conditions, Lyapunov exponents, and la…" wikitext text/x-wiki = Numerical Integration = * The tinkerbell attractor ** Implementations in OpenOffice Spreadsheet, GNU ODE, and Python ** Perturbed initial conditions, Lyapunov exponents, and large deviation principles * Working well with others: text * Working with machines: binary ** inspecting binary formats with od = Basis Functions = * Constructing B-splines - tensor method * Representing the differentiation operator * Solving PDEs using the implicit method 7ae6d6ab420676b318d52411637cb6c4cc2faed1 297 295 2014-11-17T14:43:04Z David M. Rogers 2 /* Numerical Integration */ wikitext text/x-wiki = Numerical Integration = * Van der Pol Oscillator: <math>\ddot u - \mu (1-u^2) \dot u + u = 0</math> ** Implementations in OpenOffice Spreadsheet, GNU ODE, and Python ** Perturbed initial conditions, Lyapunov exponents, and large deviation principles * Working well with others: text * Working with machines: binary ** inspecting binary formats with od = Basis Functions = * Constructing B-splines - tensor method * Representing the differentiation operator * Solving PDEs using the implicit method 660d9cec13a4e9bde0f5867e27a4fb5106a4a4e7 298 297 2014-11-17T17:27:48Z David M. Rogers 2 /* Numerical Integration */ wikitext text/x-wiki = Numerical Integration = * Van der Pol Oscillator: <math>\ddot u - \mu (1-u^2) \dot u + u = 0</math> ** Implementations in OpenOffice Spreadsheet, GNU ODE, and Python ** Perturbed initial conditions, Lyapunov exponents, and large deviation principles * Working well with others: text * Working with machines: binary ** inspecting binary formats with od Example: [http://man7.org/linux/man-pages/man5/elf.5.html ELF] header od -t x1 -t c -N 8 /bin/bash Binary comes in lots of units 8 bits = 1 byte 4 bits = 1 nibble 1 byte = 1 ascii character 2 bytes = 1 short 4 bytes = 1 32-bit int = 1 float 8 bytes = 1 64-bit int = 1 64-bit address = 1 double = 1 float complex 16 bytes = 1 long double = 1 double complex Byte ordering on most modern 64-bit processors is little-endian (Intel, AMD) in base 10, this would mean the 4-digit representation of the number 123 is 3 = 0011 2 = 0010 1 = 0001 0 = 0000 The binary together would read: 0011 0010 0001 0000 Since we have to use 4 digits, but the little end (least significant byte) goes first. = Basis Functions = * Constructing B-splines - tensor method * Representing the differentiation operator * Solving PDEs using the implicit method a129a1a63fc67c101b43d9aac0922bece9439cd1 299 298 2014-11-17T17:29:41Z David M. Rogers 2 /* Numerical Integration */ wikitext text/x-wiki = Numerical Integration + Binary Output Format = * Van der Pol Oscillator: <math>\ddot u - \mu (1-u^2) \dot u + u = 0</math> ** Implementations in OpenOffice Spreadsheet, GNU ODE, and Python ** Perturbed initial conditions, Lyapunov exponents, and large deviation principles * Working well with others: text * Working with machines: binary ** This is preferable when you have lots and lots of data ** The relevant numpy methods are x.tofile("file") and x = fromfile("file") -- but save("file", x) and x = load("file") are preferred ** inspecting binary formats with od Example: [http://man7.org/linux/man-pages/man5/elf.5.html ELF] header od -t x1 -t c -N 8 /bin/bash Binary comes in lots of units 8 bits = 1 byte 4 bits = 1 nibble 1 byte = 1 ascii character 2 bytes = 1 short 4 bytes = 1 32-bit int = 1 float 8 bytes = 1 64-bit int = 1 64-bit address = 1 double = 1 float complex 16 bytes = 1 long double = 1 double complex Byte ordering on most modern 64-bit processors is little-endian (Intel, AMD) in base 10, this would mean the 4-digit representation of the number 123 is 3 = 0011 2 = 0010 1 = 0001 0 = 0000 The binary together would read: 0011 0010 0001 0000 Since we have to use 4 digits, but the little end (least significant byte) goes first. = Basis Functions = * Constructing B-splines - tensor method * Representing the differentiation operator * Solving PDEs using the implicit method 71a65d988057f139eca2514e71e35f72a2d7e5a7 300 299 2014-11-17T20:11:18Z David M. Rogers 2 /* Numerical Integration + Binary Output Format */ wikitext text/x-wiki = Numerical Integration + Binary Output Format = * Van der Pol Oscillator: <math>\ddot u - \mu (1-u^2) \dot u + u = 0</math> ** Implementations in OpenOffice Spreadsheet, GNU ODE, and Python ** Perturbed initial conditions, Lyapunov exponents, and large deviation principles * Working well with others: text * Working with machines: binary ** This is preferable when you have lots and lots of data ** The relevant numpy methods are x.tofile("file") and x = fromfile("file") -- but save("file", x) and x = load("file") are preferred ** inspecting binary formats with od Example: [http://man7.org/linux/man-pages/man5/elf.5.html ELF] header od -t x1 -t c -N 8 /bin/bash Binary comes in lots of units {| div class="wikitable" ! 8 bits ! = 1 byte |- ! 4 bits ! = 1 nibble |- ! 1 byte ! = 1 ascii character |- ! 2 bytes ! = 1 short |- ! 4 bytes ! = 1 32-bit int = 1 float |- ! 8 bytes ! = 1 64-bit int = 1 64-bit address = 1 double = 1 float complex |- ! 16 bytes ! = 1 long double = 1 double complex |} Byte ordering on most modern 64-bit processors is little-endian (Intel, AMD) in base 10, this would mean the 4-digit representation of the number 123 is 3 = 0011 2 = 0010 1 = 0001 0 = 0000 The binary together would read: 0011 0010 0001 0000 Since we have to use 4 digits, but the little end (least significant byte) goes first. = Basis Functions = * Constructing B-splines - tensor method * Representing the differentiation operator * Solving PDEs using the implicit method 9383f8167d74bc3ad77a2d06b84eae03b9cb19c2 301 300 2014-11-17T20:15:41Z David M. Rogers 2 /* Numerical Integration + Binary Output Format */ wikitext text/x-wiki = Numerical Integration + Binary Output Format = * Van der Pol Oscillator: <math>\ddot u - \mu (1-u^2) \dot u + u = 0</math> ** Implementations in OpenOffice Spreadsheet, GNU ODE, and Python ** Perturbed initial conditions, Lyapunov exponents, and large deviation principles * Working well with others: text * Working with machines: binary ** This is preferable when you have lots and lots of data ** The relevant numpy methods are x.tofile("file") and x = fromfile("file") -- but save("file", x) and x = load("file") are preferred ** inspecting binary formats with od === GNU ODE Integrator === '''vanderpol.ode''' <code lang="python"> mu = %MU u = 1.0 y = 0.0 u' = y y' = mu*(1-u*u)*y - u print t, u, y, y! every 10 from 50 step 0, 100 </code> You can do the substitution with sed and run all dynamics with: for((i=0;i<10;i++)); do sed -e "s|%MU|$i|" vanderpol.ode >vanderpol-$i.ode ode -f vanderpol-$i.ode >out-$i.dat </dev/null done === Plotting with Gnuplot === <code lang="gnuplot"> set term postscript enh color lw 3 "Times-Roman" 28 set out 'van.eps' set xlabel "u" set ylabel "y" plot 'out-0.dat' u 2:3 w l title "0", \ 'out-1.dat' u 2:3 w l title "1", \ 'out-4.dat' u 2:3 w l title "{/Symbol m} = 4" </code> Run with: gnuplot plot_van.gplot === Python Integrator === === Working with binary === Example: [http://man7.org/linux/man-pages/man5/elf.5.html ELF] header od -t x1 -t c -N 8 /bin/bash Binary comes in lots of units {| div class="wikitable" ! 8 bits ! = 1 byte |- ! 4 bits ! = 1 nibble |- ! 1 byte ! = 1 ascii character |- ! 2 bytes ! = 1 short |- ! 4 bytes ! = 1 32-bit int = 1 float |- ! 8 bytes ! = 1 64-bit int = 1 64-bit address = 1 double = 1 float complex |- ! 16 bytes ! = 1 long double = 1 double complex |} Byte ordering on most modern 64-bit processors is little-endian (Intel, AMD) in base 10, this would mean the 4-digit representation of the number 123 is 3 = 0011 2 = 0010 1 = 0001 0 = 0000 The binary together would read: 0011 0010 0001 0000 Since we have to use 4 digits, but the little end (least significant byte) goes first. = Basis Functions = * Constructing B-splines - tensor method * Representing the differentiation operator * Solving PDEs using the implicit method f08d3c238af37ebc57857719bec591838c0e319c 302 301 2014-11-17T20:15:53Z David M. Rogers 2 /* GNU ODE Integrator */ wikitext text/x-wiki = Numerical Integration + Binary Output Format = * Van der Pol Oscillator: <math>\ddot u - \mu (1-u^2) \dot u + u = 0</math> ** Implementations in OpenOffice Spreadsheet, GNU ODE, and Python ** Perturbed initial conditions, Lyapunov exponents, and large deviation principles * Working well with others: text * Working with machines: binary ** This is preferable when you have lots and lots of data ** The relevant numpy methods are x.tofile("file") and x = fromfile("file") -- but save("file", x) and x = load("file") are preferred ** inspecting binary formats with od === GNU ODE Integrator === '''vanderpol.ode''' <code lang="python"> mu = %MU u = 1.0 y = 0.0 u' = y y' = mu*(1-u*u)*y - u print t, u, y, y! every 10 from 50 step 0, 100 </code> You can do the substitution with sed and run all dynamics with: for((i=0;i<10;i++)); do sed -e "s|%MU|$i|" vanderpol.ode >vanderpol-$i.ode ode -f vanderpol-$i.ode >out-$i.dat </dev/null done === Plotting with Gnuplot === <code lang="gnuplot"> set term postscript enh color lw 3 "Times-Roman" 28 set out 'van.eps' set xlabel "u" set ylabel "y" plot 'out-0.dat' u 2:3 w l title "0", \ 'out-1.dat' u 2:3 w l title "1", \ 'out-4.dat' u 2:3 w l title "{/Symbol m} = 4" </code> Run with: gnuplot plot_van.gplot === Python Integrator === === Working with binary === Example: [http://man7.org/linux/man-pages/man5/elf.5.html ELF] header od -t x1 -t c -N 8 /bin/bash Binary comes in lots of units {| div class="wikitable" ! 8 bits ! = 1 byte |- ! 4 bits ! = 1 nibble |- ! 1 byte ! = 1 ascii character |- ! 2 bytes ! = 1 short |- ! 4 bytes ! = 1 32-bit int = 1 float |- ! 8 bytes ! = 1 64-bit int = 1 64-bit address = 1 double = 1 float complex |- ! 16 bytes ! = 1 long double = 1 double complex |} Byte ordering on most modern 64-bit processors is little-endian (Intel, AMD) in base 10, this would mean the 4-digit representation of the number 123 is 3 = 0011 2 = 0010 1 = 0001 0 = 0000 The binary together would read: 0011 0010 0001 0000 Since we have to use 4 digits, but the little end (least significant byte) goes first. = Basis Functions = * Constructing B-splines - tensor method * Representing the differentiation operator * Solving PDEs using the implicit method f53a2347e1ecb1213a15e7a0fa1dc0760f2efcc8 303 302 2014-11-17T20:16:31Z David M. Rogers 2 /* GNU ODE Integrator */ wikitext text/x-wiki = Numerical Integration + Binary Output Format = * Van der Pol Oscillator: <math>\ddot u - \mu (1-u^2) \dot u + u = 0</math> ** Implementations in OpenOffice Spreadsheet, GNU ODE, and Python ** Perturbed initial conditions, Lyapunov exponents, and large deviation principles * Working well with others: text * Working with machines: binary ** This is preferable when you have lots and lots of data ** The relevant numpy methods are x.tofile("file") and x = fromfile("file") -- but save("file", x) and x = load("file") are preferred ** inspecting binary formats with od === GNU ODE Integrator === '''vanderpol.ode''' <source lang="python"> mu = %MU u = 1.0 y = 0.0 u' = y y' = mu*(1-u*u)*y - u print t, u, y, y! every 10 from 50 step 0, 100 </source> You can do the substitution with sed and run all dynamics with: for((i=0;i<10;i++)); do sed -e "s|%MU|$i|" vanderpol.ode >vanderpol-$i.ode ode -f vanderpol-$i.ode >out-$i.dat </dev/null done === Plotting with Gnuplot === <code lang="gnuplot"> set term postscript enh color lw 3 "Times-Roman" 28 set out 'van.eps' set xlabel "u" set ylabel "y" plot 'out-0.dat' u 2:3 w l title "0", \ 'out-1.dat' u 2:3 w l title "1", \ 'out-4.dat' u 2:3 w l title "{/Symbol m} = 4" </code> Run with: gnuplot plot_van.gplot === Python Integrator === === Working with binary === Example: [http://man7.org/linux/man-pages/man5/elf.5.html ELF] header od -t x1 -t c -N 8 /bin/bash Binary comes in lots of units {| div class="wikitable" ! 8 bits ! = 1 byte |- ! 4 bits ! = 1 nibble |- ! 1 byte ! = 1 ascii character |- ! 2 bytes ! = 1 short |- ! 4 bytes ! = 1 32-bit int = 1 float |- ! 8 bytes ! = 1 64-bit int = 1 64-bit address = 1 double = 1 float complex |- ! 16 bytes ! = 1 long double = 1 double complex |} Byte ordering on most modern 64-bit processors is little-endian (Intel, AMD) in base 10, this would mean the 4-digit representation of the number 123 is 3 = 0011 2 = 0010 1 = 0001 0 = 0000 The binary together would read: 0011 0010 0001 0000 Since we have to use 4 digits, but the little end (least significant byte) goes first. = Basis Functions = * Constructing B-splines - tensor method * Representing the differentiation operator * Solving PDEs using the implicit method 99c659aa9e1891c028518dd916919ee337aab6d8 304 303 2014-11-17T20:17:00Z David M. Rogers 2 /* Plotting with Gnuplot */ wikitext text/x-wiki = Numerical Integration + Binary Output Format = * Van der Pol Oscillator: <math>\ddot u - \mu (1-u^2) \dot u + u = 0</math> ** Implementations in OpenOffice Spreadsheet, GNU ODE, and Python ** Perturbed initial conditions, Lyapunov exponents, and large deviation principles * Working well with others: text * Working with machines: binary ** This is preferable when you have lots and lots of data ** The relevant numpy methods are x.tofile("file") and x = fromfile("file") -- but save("file", x) and x = load("file") are preferred ** inspecting binary formats with od === GNU ODE Integrator === '''vanderpol.ode''' <source lang="python"> mu = %MU u = 1.0 y = 0.0 u' = y y' = mu*(1-u*u)*y - u print t, u, y, y! every 10 from 50 step 0, 100 </source> You can do the substitution with sed and run all dynamics with: for((i=0;i<10;i++)); do sed -e "s|%MU|$i|" vanderpol.ode >vanderpol-$i.ode ode -f vanderpol-$i.ode >out-$i.dat </dev/null done === Plotting with Gnuplot === <source lang="gnuplot"> set term postscript enh color lw 3 "Times-Roman" 28 set out 'van.eps' set xlabel "u" set ylabel "y" plot 'out-0.dat' u 2:3 w l title "0", \ 'out-1.dat' u 2:3 w l title "1", \ 'out-4.dat' u 2:3 w l title "{/Symbol m} = 4" </source> Run with: gnuplot plot_van.gplot === Python Integrator === === Working with binary === Example: [http://man7.org/linux/man-pages/man5/elf.5.html ELF] header od -t x1 -t c -N 8 /bin/bash Binary comes in lots of units {| div class="wikitable" ! 8 bits ! = 1 byte |- ! 4 bits ! = 1 nibble |- ! 1 byte ! = 1 ascii character |- ! 2 bytes ! = 1 short |- ! 4 bytes ! = 1 32-bit int = 1 float |- ! 8 bytes ! = 1 64-bit int = 1 64-bit address = 1 double = 1 float complex |- ! 16 bytes ! = 1 long double = 1 double complex |} Byte ordering on most modern 64-bit processors is little-endian (Intel, AMD) in base 10, this would mean the 4-digit representation of the number 123 is 3 = 0011 2 = 0010 1 = 0001 0 = 0000 The binary together would read: 0011 0010 0001 0000 Since we have to use 4 digits, but the little end (least significant byte) goes first. = Basis Functions = * Constructing B-splines - tensor method * Representing the differentiation operator * Solving PDEs using the implicit method 131f3a5deb44107126f9e2b466eb4251e7c8df8c 305 304 2014-11-17T20:18:42Z David M. Rogers 2 /* GNU ODE Integrator */ wikitext text/x-wiki = Numerical Integration + Binary Output Format = * Van der Pol Oscillator: <math>\ddot u - \mu (1-u^2) \dot u + u = 0</math> ** Implementations in OpenOffice Spreadsheet, GNU ODE, and Python ** Perturbed initial conditions, Lyapunov exponents, and large deviation principles * Working well with others: text * Working with machines: binary ** This is preferable when you have lots and lots of data ** The relevant numpy methods are x.tofile("file") and x = fromfile("file") -- but save("file", x) and x = load("file") are preferred ** inspecting binary formats with od === GNU ODE Integrator === '''vanderpol.ode''' <source lang="haskell"> mu = %MU u = 1.0 y = 0.0 u' = y y' = mu*(1-u*u)*y - u print t, u, y, y! every 10 from 50 step 0, 100 </source> You can do the substitution with sed and run all dynamics with: for((i=0;i<10;i++)); do sed -e "s|%MU|$i|" vanderpol.ode >vanderpol-$i.ode ode -f vanderpol-$i.ode >out-$i.dat </dev/null done === Plotting with Gnuplot === <source lang="gnuplot"> set term postscript enh color lw 3 "Times-Roman" 28 set out 'van.eps' set xlabel "u" set ylabel "y" plot 'out-0.dat' u 2:3 w l title "0", \ 'out-1.dat' u 2:3 w l title "1", \ 'out-4.dat' u 2:3 w l title "{/Symbol m} = 4" </source> Run with: gnuplot plot_van.gplot === Python Integrator === === Working with binary === Example: [http://man7.org/linux/man-pages/man5/elf.5.html ELF] header od -t x1 -t c -N 8 /bin/bash Binary comes in lots of units {| div class="wikitable" ! 8 bits ! = 1 byte |- ! 4 bits ! = 1 nibble |- ! 1 byte ! = 1 ascii character |- ! 2 bytes ! = 1 short |- ! 4 bytes ! = 1 32-bit int = 1 float |- ! 8 bytes ! = 1 64-bit int = 1 64-bit address = 1 double = 1 float complex |- ! 16 bytes ! = 1 long double = 1 double complex |} Byte ordering on most modern 64-bit processors is little-endian (Intel, AMD) in base 10, this would mean the 4-digit representation of the number 123 is 3 = 0011 2 = 0010 1 = 0001 0 = 0000 The binary together would read: 0011 0010 0001 0000 Since we have to use 4 digits, but the little end (least significant byte) goes first. = Basis Functions = * Constructing B-splines - tensor method * Representing the differentiation operator * Solving PDEs using the implicit method ea8ccdff9fd60dedbb6ba0bdee39020f1d3b9a6d 306 305 2014-11-18T01:18:27Z David M. Rogers 2 /* Working with binary */ wikitext text/x-wiki = Numerical Integration + Binary Output Format = * Van der Pol Oscillator: <math>\ddot u - \mu (1-u^2) \dot u + u = 0</math> ** Implementations in OpenOffice Spreadsheet, GNU ODE, and Python ** Perturbed initial conditions, Lyapunov exponents, and large deviation principles * Working well with others: text * Working with machines: binary ** This is preferable when you have lots and lots of data ** The relevant numpy methods are x.tofile("file") and x = fromfile("file") -- but save("file", x) and x = load("file") are preferred ** inspecting binary formats with od === GNU ODE Integrator === '''vanderpol.ode''' <source lang="haskell"> mu = %MU u = 1.0 y = 0.0 u' = y y' = mu*(1-u*u)*y - u print t, u, y, y! every 10 from 50 step 0, 100 </source> You can do the substitution with sed and run all dynamics with: for((i=0;i<10;i++)); do sed -e "s|%MU|$i|" vanderpol.ode >vanderpol-$i.ode ode -f vanderpol-$i.ode >out-$i.dat </dev/null done === Plotting with Gnuplot === <source lang="gnuplot"> set term postscript enh color lw 3 "Times-Roman" 28 set out 'van.eps' set xlabel "u" set ylabel "y" plot 'out-0.dat' u 2:3 w l title "0", \ 'out-1.dat' u 2:3 w l title "1", \ 'out-4.dat' u 2:3 w l title "{/Symbol m} = 4" </source> Run with: gnuplot plot_van.gplot === Python Integrator === === Working with binary === Example: [http://man7.org/linux/man-pages/man5/elf.5.html ELF] header od -t x1 -t c -N 8 /bin/bash Binary comes in lots of units {| div class="wikitable" ! 8 bits ! = 1 byte |- ! 4 bits ! = 1 nibble |- ! 1 byte ! = 1 ascii character |- ! 2 bytes ! = 1 short = 1 word |- ! 4 bytes ! = 1 32-bit int = 1 float |- ! 8 bytes ! = 1 64-bit int = 1 double = 1 float complex |- ! 16 bytes ! = 1 long double = 1 double complex |} Byte ordering on most modern 64-bit processors is little-endian (Intel, AMD). For more info, see [http://betterexplained.com/articles/understanding-big-and-little-endian-byte-order/]. In an imaginary system where base 10 numbers are encoded by 4-bit nibbles, a 4-digit representation of the number 123 is 3 = 0011 2 = 0010 1 = 0001 0 = 0000 The binary together would read: 0011 0010 0001 0000 Since we have to use 4 digits, the most significant digit is set to all zeros, and goes last. The little end (least significant byte) goes first. Notice that within the 4-bit nibbles, the least-significant bit is still on the right. So the number is encoded using this left-to right (within a digit) and bottom to top (digits within a word) order. Real binary encoding is just like the above, except that each 'digit' is a byte, so every 8 bits are in order, but the bytes are reversed. = Basis Functions = * Constructing B-splines - tensor method * Representing the differentiation operator * Solving PDEs using the implicit method d7f0085fcf35925549dfdc242c20eb36d9de1de5 310 306 2014-11-19T21:42:07Z David M. Rogers 2 /* Basis Functions */ wikitext text/x-wiki = Numerical Integration + Binary Output Format = * Van der Pol Oscillator: <math>\ddot u - \mu (1-u^2) \dot u + u = 0</math> ** Implementations in OpenOffice Spreadsheet, GNU ODE, and Python ** Perturbed initial conditions, Lyapunov exponents, and large deviation principles * Working well with others: text * Working with machines: binary ** This is preferable when you have lots and lots of data ** The relevant numpy methods are x.tofile("file") and x = fromfile("file") -- but save("file", x) and x = load("file") are preferred ** inspecting binary formats with od === GNU ODE Integrator === '''vanderpol.ode''' <source lang="haskell"> mu = %MU u = 1.0 y = 0.0 u' = y y' = mu*(1-u*u)*y - u print t, u, y, y! every 10 from 50 step 0, 100 </source> You can do the substitution with sed and run all dynamics with: for((i=0;i<10;i++)); do sed -e "s|%MU|$i|" vanderpol.ode >vanderpol-$i.ode ode -f vanderpol-$i.ode >out-$i.dat </dev/null done === Plotting with Gnuplot === <source lang="gnuplot"> set term postscript enh color lw 3 "Times-Roman" 28 set out 'van.eps' set xlabel "u" set ylabel "y" plot 'out-0.dat' u 2:3 w l title "0", \ 'out-1.dat' u 2:3 w l title "1", \ 'out-4.dat' u 2:3 w l title "{/Symbol m} = 4" </source> Run with: gnuplot plot_van.gplot === Python Integrator === === Working with binary === Example: [http://man7.org/linux/man-pages/man5/elf.5.html ELF] header od -t x1 -t c -N 8 /bin/bash Binary comes in lots of units {| div class="wikitable" ! 8 bits ! = 1 byte |- ! 4 bits ! = 1 nibble |- ! 1 byte ! = 1 ascii character |- ! 2 bytes ! = 1 short = 1 word |- ! 4 bytes ! = 1 32-bit int = 1 float |- ! 8 bytes ! = 1 64-bit int = 1 double = 1 float complex |- ! 16 bytes ! = 1 long double = 1 double complex |} Byte ordering on most modern 64-bit processors is little-endian (Intel, AMD). For more info, see [http://betterexplained.com/articles/understanding-big-and-little-endian-byte-order/]. In an imaginary system where base 10 numbers are encoded by 4-bit nibbles, a 4-digit representation of the number 123 is 3 = 0011 2 = 0010 1 = 0001 0 = 0000 The binary together would read: 0011 0010 0001 0000 Since we have to use 4 digits, the most significant digit is set to all zeros, and goes last. The little end (least significant byte) goes first. Notice that within the 4-bit nibbles, the least-significant bit is still on the right. So the number is encoded using this left-to right (within a digit) and bottom to top (digits within a word) order. Real binary encoding is just like the above, except that each 'digit' is a byte, so every 8 bits are in order, but the bytes are reversed. = Basis Functions = * Constructing B-splines - tensor method * Representing the differentiation operator * Solving PDEs using the implicit method * [[Media:Basis.pdf|Lecture Slides]] 870595067f3fce42f428b8f85d9ff22b89e19e20 CompSciWeek14-15 0 64 296 2014-11-17T14:03:06Z David M. Rogers 2 Created page with "= Installation Woes = * Python packages (ex: sympy) * GNU Autotools + make-based process (ex: FFTW) * Cmake: a developer-friendly (not user-friendly?) alternative (ex: cgal) * No…" wikitext text/x-wiki = Installation Woes = * Python packages (ex: sympy) * GNU Autotools + make-based process (ex: FFTW) * Cmake: a developer-friendly (not user-friendly?) alternative (ex: cgal) * Non-standard makes (ex: NAMD2 and NWChem) * Tinkering with open-source * The DL on Software Licenses ** Apache, BSD, GPL, Microsoft, FDL, Creative Commons ** The open-source that isn't: Canvas The single most important idea for compiling and installing new software is to remember that the installation works for the developer's environment, and it will for you, too if your environment is setup correctly. Often times this is easier said than done. # Package Dependencies (pdftk depends on libgcj) #* and versions of those packages - this is usually the worst part # Shell variables #* PATH, CFLAGS, LDFLAGS, LD_LIBRARY_PATH # Compiler version # Machine architecture = The Monte Carlo Method = * Integrals of the form: <math>\int \frac{f(x)}{g(x)} g(x) dx</math> * Computing pi * Parallelizing with MPI4Py 5b16349feb0508a85ff10f29d62fae52a8b66536 307 296 2014-11-18T01:20:25Z David M. Rogers 2 /* Installation Woes */ wikitext text/x-wiki = Installation Woes = * Python packages (ex: sympy) * GNU Autotools + make-based process (ex: FFTW) * Cmake: a developer-friendly (not user-friendly?) alternative (ex: cgal) * Non-standard makes (ex: NAMD2 and NWChem) * Tinkering with open-source * The DL on Software Licenses ** Apache, BSD, GPL, Microsoft, FDL, Creative Commons ** The open-source that isn't: Canvas The single most important idea for compiling and installing new software is to remember that the installation works for the developer's environment, and it will for you, too if your environment is setup correctly. Often times this is easier said than done. # Package Dependencies (pdftk depends on libgcj) #* and versions of those packages - this is usually the worst part # Shell variables #* PATH, CFLAGS, LDFLAGS, LD_LIBRARY_PATH # Compiler version # Machine architecture Tips: To find a package owning a file (on linux systems with rpm) rpm -qf /usr/lib64/libfftw3.so.3 To find all files associated with a package rpm -ql fftw-3.2.1-3.1.el6.x86_64 = The Monte Carlo Method = * Integrals of the form: <math>\int \frac{f(x)}{g(x)} g(x) dx</math> * Computing pi * Parallelizing with MPI4Py 378231e25fc463ca6d86339a4e251347ebd4c632 Code 0 18 308 256 2014-11-18T18:33:37Z David M. Rogers 2 /* Tutorials */ wikitext text/x-wiki == Tutorials == When learning a new language, once you've memorized the words, you need to start conversing. Unfortunately, source code is not spoken. It's a stillborn language. One of the best ways to code well is to study and modify other, good code. For code, this means reading and tweaking tutorials first, then design patterns, then large-scale projects next. * [http://matt.might.net/articles/bash-by-example Bash By Example] * [http://docs.python.org/3/tutorial/datastructures.html Data Structures in Python] * [http://www.u.arizona.edu/~erdmann/mse350/topics/basic_linear_algebra.html Linear Algebra in Numpy] * [[Code:gmxliquid|Liquid Structure With Gromacs]] Remember that it's not enough to just read them. It's actually a positive waste of time. Rather, you have to do some run-tweak-run-debug development cycles with them. == C Libraries == With the exception of the standard libraries and the [http://www.gnu.org/software/gsl/ GNU Scientific Library], there are surprisingly few of these about. Here are some generics that we've implemented and are sharing under the GPL. Robust map and red/black tree code has recently been published to [https://github.com/frobnitzem?tab=repositories github]. == Python Libraries == * [[Code:libnwchem|libnwchem]] A patch against Nwchem 6.5 to build its functionality as a shared library, along with glue code for access using python ctypes. * [[Code:networkx|Networkx]] a quick guide. === Geometric Algebra === The [http://www.predictivestatmech.org/code/galg.py Multivector] class implements geometric algebra using Python's operator overloading. It works with minimal space for any number of spatial dimensions, since it's not based on the matrix / spinor representation of Clifford algebra. Instead, it takes the basis blade approach recommended by Dorst, Fondijne, and Mann [http://www.geometricalgebra.net]. It's really just as easy as ordering all the basis vectors, and keeping track of the commutator (+/- <math>\hat 1</math>). == Templates == The real world has forms, computation has templates. Pick one up, fill in the blanks, and send it down the chute. * [[NWChem|NWChem Jobs]] * [[Code:SLURM|Slurm (USF Circe)]] * [[Code:SGE|SGE (USF Circe)]] * [[Code:text2pdf|Text conversion using text2pdf]] == Efficiencies == To chop a tree quickly, spend twice the time sharpening your axe. * [[Vimrc|vimrc files]] == Code Humor == Put this into your makefile: <source lang=bash> Clint\ Eastwood: myday echo "I feel great!" </source> e110f50e8603249a5573e2c6e842c142f5e91750 Code:gmxliquid 0 65 309 2014-11-18T19:03:27Z David M. Rogers 2 Created page with "In this tutorial, I'm assuming you already have the gromacs commands loaded. On circe at USF, this is done with: module load apps/gromacs/4.5.5 = Create an input system = Fi…" wikitext text/x-wiki In this tutorial, I'm assuming you already have the gromacs commands loaded. On circe at USF, this is done with: module load apps/gromacs/4.5.5 = Create an input system = First, we do some size calculations in the python prompt. >>> # Compute number of EtOH molecules >>> # 8 nm^3 = 8e-21 cc >>> # 0.4 % By vol. >>> # rho_EtOH = 0.78924 g / cc >>> # FW = 46 g/mol >>> >>> 8e-21*0.4*0.78924/46.0*6.022e23 33 Next, we need to generate an 8 nm<math>^3</math> box with 33 EtOH molecules genbox -box 2 2 2 -ci etoh.pdb -o box.pdb -nmol 33 nano topol.top # check for line "ETH 33" (no changes required) If the topology file and forcefields are 'there', we can create a test simulation using just these molecules. We'll do this just to check that grompp works grompp -c box.pdb -f equ.mdp -o equ.tpr Next, the complete water+EtOH mixture can be made by filling the voids with water. We'll use TIP4P here. genbox -cs tip4p -cp box.pdb -o sys.pdb Since this last command added waters, you have to update the topology file, adding "SOL 133" (or your number of waters) nano topol.top = run minimization = Molecular structures can be touchy, since contacting atoms causes large forces and 'blows up' a system. The risk of this can be reduced by minimizing the energy of initial starting systems. First, we have to create a file describing how gromacs should do the minimization. grompp -f min.mdp -c sys.pdb -o min A lot of backup files (starting with '#') accumulate, and we remove them like so: rm -f \#* mdout.mdp Now we're ready to run minimization. Since the system is small, minimization is cheap and fast - so we do it on the head node. For larger systems, this command would be put in a job-script. mdrun -s min -o min -g min -e min -c min Now we're ready to take the minimized structure and run dynamics. This first round is called equilibration, since we intend to let the system settle into a thermal equilibrium state. grompp -c min.gro -f equ.mdp -o equ.tpr To run this one, we'll use the cluster by writing down the command in a script file. That script gets sent to the cluster. No changes to equ.sh should be required. nano equ.sh sbatch equ.sh squeue -u `whoami` As the job is running you can read through the log file. less equ.log tail -f equ.log # enter Ctl-C to stop tailing Note that the energy is output at every time-step. Why is the total energy changing with time? What about the total volume? = run dynamics = Running dynamics uses the same procedure as before, but now we need to worry about how much and which output to produce. nano run.mdp # no changes required grompp -c equ.gro -f run.mdp -o run.tpr Check and start equilibration job (no changes required). nano run.sh sbatch run.sh squeue -u `whoami` Read through run.log less run.log tail -f run.log # enter Ctl-C to stop tailing Notice that the total energy remains relatively constant now, but the individual energies are still very noisy. What does this say about the shape of the molecules? = analyze dynamic data = Let's first check what happened during equilibration. Since the volume was allowed to change, we should be able to plot it vs. time: g_energy -f equ.edr -o equ.en.xvg # Select: Potential Kinetic-En. Total-Energy Volume * At what time does the potential energy stabilize? * What is the density? ** answer: (33*46 + 18*133)/Avogadro / 7.0333834916722191e-21 = 0.9236 g/mL ** These two quantities inform on the heat and volume change of mixing. ** Pure H2O (TIP4P): rho = 1.001, H ~ 11.6 kcal/mol, D = 3.9e-5 cm^2/s, eps = 52 ** Pure H2O (expt): rho = 0.9971, H = 10.5 kcal/mol, D = 2.3e-5 cm^2/s, eps = 78.4 ** (J. Chem. Phys. 123, 234505, 2005) ** Pure EtOH: rho = 0.7873, H = 10.0 kcal/mol, D = 1.0e-5 cm^2/s, eps(expt) = 23 ** (J. Phys. Chem. B 1997, 101, 78-86, J. Phys. Chem. B, 2014, 118 (34), 10156-66) Gnuplot can make this plot with plot 'equ.en.xvg' u 1:2 w l, 'equ.en.xvg' u 1:5 axis x1y2 w l The radial distribution function is a classical measure of the structuring of liquid water. The one we calculate here shows the density of molecules within spherical shells around the central molecule. g_rdf -rdf mol_com -ng 2 -f run.trr -o run.w-rdf.xvg # select Water as "reference group", select "Water", then "ETH" # re-run for ETH-ETH rdf g_rdf -rdf mol_com -ng 1 -f run.trr -o run.e-rdf.xvg gnuplot can plot these together with: plot 'run.w-rdf.xvg' u 1:2 w l, 'run.w-rdf.xvg' u 1:3 w l, 'run.e-rdf.xvg' u 1:2 w l Notice how waters stack much more closely together than EtOH? How is this related to their liquid densities? The dielectric of a liquid measures its ability to be polarized by an applied field. High dielectric materials make good capacitors. g_dipoles -f run.trr -s run.tpr -c dipcorr.xvg -corr total -P 1 <pre><nowiki> Dipole moment (Debye) --------------------- Average = 2.2234 Std. Dev. = 0.1095 Error = 0.0001 The following averages for the complete trajectory have been calculated: Total < M_x > = 7.79882 Debye Total < M_y > = -1.11977 Debye Total < M_z > = 9.49511 Debye Total < M_x^2 > = 882.516 Debye^2 Total < M_y^2 > = 1239.78 Debye^2 Total < M_z^2 > = 925.457 Debye^2 Total < |M|^2 > = 3047.75 Debye^2 Total |< M >|^2 = 152.233 Debye^2 < |M|^2 > - |< M >|^2 = 2895.52 Debye^2 Finite system Kirkwood g factor G_k = 3.52836 Infinite system Kirkwood g factor g_k = 2.37948 Epsilon = 43.1739 </nowiki></pre> Water and EtOH are constantly undergoing random collisions in solution. The net effect of this is diffusion of the two molecules. Einstein showed that this can be tracked by watching the mean squared displacement of the molecules over time. Since the distance traveled over a random walk with diffusion constant <math>D</math> has a Gaussian distribution with variance <math>2D\Delta t<math>, where <math>\Delta t</math> is the elapsed time, the mean squared displacement vs time should be a straight line with slope <math>2D</math>. Of course, over short times, this picture is only approximate, but it usually holds over longer times. g_msd -f run.trr -ngroup 2 -o run.msd.xvg <pre><nowiki> Fitting from 100 to 900 ps D[ Water] 1.4336 (+/- 0.0850) 1e-5 cm^2/s D[ ETH] 0.7312 (+/- 0.1279) 1e-5 cm^2/s </nowiki></pre> How do these compare with the literature values (above) for the pure liquids? More detail on velocity correlation: g_velacc -mol -f run.trr -o run.w-acf.xvg # Choose group 3 (Water) g_velacc -mol -f run.trr -o run.e-acf.xvg # Choose group 2 (ETH) you can compare these to some of the above references. c116bbbd563c3d2165cd7a16dfb334300d6adfaa File:Basis.pdf 6 66 311 2014-11-19T21:42:32Z David M. Rogers 2 wikitext text/x-wiki da39a3ee5e6b4b0d3255bfef95601890afd80709 CompSciWeek13 0 63 312 310 2014-11-19T21:44:12Z David M. Rogers 2 /* Numerical Integration + Binary Output Format */ wikitext text/x-wiki = Numerical Integration + Binary Output Format = * Van der Pol Oscillator: <math>\ddot u - \mu (1-u^2) \dot u + u = 0</math> ** Implementations in OpenOffice Spreadsheet, GNU ODE, and Python ** Perturbed initial conditions, Lyapunov exponents, and large deviation principles * Working well with others: text * Working with machines: binary ** This is preferable when you have lots and lots of data ** The relevant numpy methods are x.tofile("file") and x = fromfile("file") -- but save("file", x) and x = load("file") are preferred ** inspecting binary formats with od * [[Media:Integrate.pdf|Lecture Slides]] === GNU ODE Integrator === '''vanderpol.ode''' <source lang="haskell"> mu = %MU u = 1.0 y = 0.0 u' = y y' = mu*(1-u*u)*y - u print t, u, y, y! every 10 from 50 step 0, 100 </source> You can do the substitution with sed and run all dynamics with: for((i=0;i<10;i++)); do sed -e "s|%MU|$i|" vanderpol.ode >vanderpol-$i.ode ode -f vanderpol-$i.ode >out-$i.dat </dev/null done === Plotting with Gnuplot === <source lang="gnuplot"> set term postscript enh color lw 3 "Times-Roman" 28 set out 'van.eps' set xlabel "u" set ylabel "y" plot 'out-0.dat' u 2:3 w l title "0", \ 'out-1.dat' u 2:3 w l title "1", \ 'out-4.dat' u 2:3 w l title "{/Symbol m} = 4" </source> Run with: gnuplot plot_van.gplot === Python Integrator === === Working with binary === Example: [http://man7.org/linux/man-pages/man5/elf.5.html ELF] header od -t x1 -t c -N 8 /bin/bash Binary comes in lots of units {| div class="wikitable" ! 8 bits ! = 1 byte |- ! 4 bits ! = 1 nibble |- ! 1 byte ! = 1 ascii character |- ! 2 bytes ! = 1 short = 1 word |- ! 4 bytes ! = 1 32-bit int = 1 float |- ! 8 bytes ! = 1 64-bit int = 1 double = 1 float complex |- ! 16 bytes ! = 1 long double = 1 double complex |} Byte ordering on most modern 64-bit processors is little-endian (Intel, AMD). For more info, see [http://betterexplained.com/articles/understanding-big-and-little-endian-byte-order/]. In an imaginary system where base 10 numbers are encoded by 4-bit nibbles, a 4-digit representation of the number 123 is 3 = 0011 2 = 0010 1 = 0001 0 = 0000 The binary together would read: 0011 0010 0001 0000 Since we have to use 4 digits, the most significant digit is set to all zeros, and goes last. The little end (least significant byte) goes first. Notice that within the 4-bit nibbles, the least-significant bit is still on the right. So the number is encoded using this left-to right (within a digit) and bottom to top (digits within a word) order. Real binary encoding is just like the above, except that each 'digit' is a byte, so every 8 bits are in order, but the bytes are reversed. = Basis Functions = * Constructing B-splines - tensor method * Representing the differentiation operator * Solving PDEs using the implicit method * [[Media:Basis.pdf|Lecture Slides]] 3c814b9580b1681cc410b977f9441350ed89d351 File:Integrate.pdf 6 67 313 2014-11-19T21:44:40Z David M. Rogers 2 wikitext text/x-wiki da39a3ee5e6b4b0d3255bfef95601890afd80709 Code:gmxliquid 0 65 314 309 2014-11-21T15:29:25Z David M. Rogers 2 wikitext text/x-wiki In this tutorial, I'm assuming you already have the gromacs commands (grompp, mdrun, etc.) loaded. On circe at USF, this is done with: module load apps/gromacs/4.5.5 You'll also need the starting files [[Media:liq_files.tgz|here]]. = Create an input system = First, we do some size calculations in the python prompt. >>> # Compute number of EtOH molecules >>> # 8 nm^3 = 8e-21 cc >>> # 0.4 % By vol. >>> # rho_EtOH = 0.78924 g / cc >>> # FW = 46 g/mol >>> >>> 8e-21*0.4*0.78924/46.0*6.022e23 33 Next, we need to generate an 8 nm<math>^3</math> box with 33 EtOH molecules genbox -box 2 2 2 -ci etoh.pdb -o box.pdb -nmol 33 nano topol.top # check for line "ETH 33" (no changes required) If the topology file and forcefields are 'there', we can create a test simulation using just these molecules. We'll do this just to check that grompp works grompp -c box.pdb -f equ.mdp -o equ.tpr Next, the complete water+EtOH mixture can be made by filling the voids with water. We'll use TIP4P here. genbox -cs tip4p -cp box.pdb -o sys.pdb Since this last command added waters, you have to update the topology file, adding "SOL 133" (or your number of waters) nano topol.top = run minimization = Molecular structures can be touchy, since contacting atoms causes large forces and 'blows up' a system. The risk of this can be reduced by minimizing the energy of initial starting systems. First, we have to create a file describing how gromacs should do the minimization. grompp -f min.mdp -c sys.pdb -o min A lot of backup files (starting with '#') accumulate, and we remove them like so: rm -f \#* mdout.mdp Now we're ready to run minimization. Since the system is small, minimization is cheap and fast - so we do it on the head node. For larger systems, this command would be put in a job-script. mdrun -s min -o min -g min -e min -c min Now we're ready to take the minimized structure and run dynamics. This first round is called equilibration, since we intend to let the system settle into a thermal equilibrium state. grompp -c min.gro -f equ.mdp -o equ.tpr To run this one, we'll use the cluster by writing down the command in a script file. That script gets sent to the cluster. No changes to equ.sh should be required. nano equ.sh sbatch equ.sh squeue -u `whoami` As the job is running you can read through the log file. less equ.log tail -f equ.log # enter Ctl-C to stop tailing Note that the energy is output at every time-step. Why is the total energy changing with time? What about the total volume? = run dynamics = Running dynamics uses the same procedure as before, but now we need to worry about how much and which output to produce. nano run.mdp # no changes required grompp -c equ.gro -f run.mdp -o run.tpr Check and start equilibration job (no changes required). nano run.sh sbatch run.sh squeue -u `whoami` Read through run.log less run.log tail -f run.log # enter Ctl-C to stop tailing Notice that the total energy remains relatively constant now, but the individual energies are still very noisy. What does this say about the shape of the molecules? = analyze dynamic data = Let's first check what happened during equilibration. Since the volume was allowed to change, we should be able to plot it vs. time: g_energy -f equ.edr -o equ.en.xvg # Select: Potential Kinetic-En. Total-Energy Volume * At what time does the potential energy stabilize? * What is the density? ** answer: (33*46 + 18*133)/Avogadro / 7.0333834916722191e-21 = 0.9236 g/mL ** These two quantities inform on the heat and volume change of mixing. ** Pure H2O (TIP4P): rho = 1.001, H ~ 11.6 kcal/mol, D = 3.9e-5 cm^2/s, eps = 52 ** Pure H2O (expt): rho = 0.9971, H = 10.5 kcal/mol, D = 2.3e-5 cm^2/s, eps = 78.4 ** (J. Chem. Phys. 123, 234505, 2005) ** Pure EtOH: rho = 0.7873, H = 10.0 kcal/mol, D = 1.0e-5 cm^2/s, eps(expt) = 23 ** (J. Phys. Chem. B 1997, 101, 78-86, J. Phys. Chem. B, 2014, 118 (34), 10156-66) Gnuplot can make this plot with plot 'equ.en.xvg' u 1:2 w l, 'equ.en.xvg' u 1:5 axis x1y2 w l The radial distribution function is a classical measure of the structuring of liquid water. The one we calculate here shows the density of molecules within spherical shells around the central molecule. g_rdf -rdf mol_com -ng 2 -f run.trr -o run.w-rdf.xvg # select Water as "reference group", select "Water", then "ETH" # re-run for ETH-ETH rdf g_rdf -rdf mol_com -ng 1 -f run.trr -o run.e-rdf.xvg gnuplot can plot these together with: plot 'run.w-rdf.xvg' u 1:2 w l, 'run.w-rdf.xvg' u 1:3 w l, 'run.e-rdf.xvg' u 1:2 w l Notice how waters stack much more closely together than EtOH? How is this related to their liquid densities? The dielectric of a liquid measures its ability to be polarized by an applied field. High dielectric materials make good capacitors. g_dipoles -f run.trr -s run.tpr -c dipcorr.xvg -corr total -P 1 <pre><nowiki> Dipole moment (Debye) --------------------- Average = 2.2234 Std. Dev. = 0.1095 Error = 0.0001 The following averages for the complete trajectory have been calculated: Total < M_x > = 7.79882 Debye Total < M_y > = -1.11977 Debye Total < M_z > = 9.49511 Debye Total < M_x^2 > = 882.516 Debye^2 Total < M_y^2 > = 1239.78 Debye^2 Total < M_z^2 > = 925.457 Debye^2 Total < |M|^2 > = 3047.75 Debye^2 Total |< M >|^2 = 152.233 Debye^2 < |M|^2 > - |< M >|^2 = 2895.52 Debye^2 Finite system Kirkwood g factor G_k = 3.52836 Infinite system Kirkwood g factor g_k = 2.37948 Epsilon = 43.1739 </nowiki></pre> Water and EtOH are constantly undergoing random collisions in solution. The net effect of this is diffusion of the two molecules. Einstein showed that this can be tracked by watching the mean squared displacement of the molecules over time. Since the distance traveled over a random walk with diffusion constant <math>D</math> has a Gaussian distribution with variance <math>2D\Delta t<math>, where <math>\Delta t</math> is the elapsed time, the mean squared displacement vs time should be a straight line with slope <math>2D</math>. Of course, over short times, this picture is only approximate, but it usually holds over longer times. g_msd -f run.trr -ngroup 2 -o run.msd.xvg <pre><nowiki> Fitting from 100 to 900 ps D[ Water] 1.4336 (+/- 0.0850) 1e-5 cm^2/s D[ ETH] 0.7312 (+/- 0.1279) 1e-5 cm^2/s </nowiki></pre> How do these compare with the literature values (above) for the pure liquids? More detail on velocity correlation: g_velacc -mol -f run.trr -o run.w-acf.xvg # Choose group 3 (Water) g_velacc -mol -f run.trr -o run.e-acf.xvg # Choose group 2 (ETH) you can compare these to some of the above references. 4f89f2bf5332c3537939b745ef41c98725a41457 316 314 2014-11-21T15:33:18Z David M. Rogers 2 /* analyze dynamic data */ wikitext text/x-wiki In this tutorial, I'm assuming you already have the gromacs commands (grompp, mdrun, etc.) loaded. On circe at USF, this is done with: module load apps/gromacs/4.5.5 You'll also need the starting files [[Media:liq_files.tgz|here]]. = Create an input system = First, we do some size calculations in the python prompt. >>> # Compute number of EtOH molecules >>> # 8 nm^3 = 8e-21 cc >>> # 0.4 % By vol. >>> # rho_EtOH = 0.78924 g / cc >>> # FW = 46 g/mol >>> >>> 8e-21*0.4*0.78924/46.0*6.022e23 33 Next, we need to generate an 8 nm<math>^3</math> box with 33 EtOH molecules genbox -box 2 2 2 -ci etoh.pdb -o box.pdb -nmol 33 nano topol.top # check for line "ETH 33" (no changes required) If the topology file and forcefields are 'there', we can create a test simulation using just these molecules. We'll do this just to check that grompp works grompp -c box.pdb -f equ.mdp -o equ.tpr Next, the complete water+EtOH mixture can be made by filling the voids with water. We'll use TIP4P here. genbox -cs tip4p -cp box.pdb -o sys.pdb Since this last command added waters, you have to update the topology file, adding "SOL 133" (or your number of waters) nano topol.top = run minimization = Molecular structures can be touchy, since contacting atoms causes large forces and 'blows up' a system. The risk of this can be reduced by minimizing the energy of initial starting systems. First, we have to create a file describing how gromacs should do the minimization. grompp -f min.mdp -c sys.pdb -o min A lot of backup files (starting with '#') accumulate, and we remove them like so: rm -f \#* mdout.mdp Now we're ready to run minimization. Since the system is small, minimization is cheap and fast - so we do it on the head node. For larger systems, this command would be put in a job-script. mdrun -s min -o min -g min -e min -c min Now we're ready to take the minimized structure and run dynamics. This first round is called equilibration, since we intend to let the system settle into a thermal equilibrium state. grompp -c min.gro -f equ.mdp -o equ.tpr To run this one, we'll use the cluster by writing down the command in a script file. That script gets sent to the cluster. No changes to equ.sh should be required. nano equ.sh sbatch equ.sh squeue -u `whoami` As the job is running you can read through the log file. less equ.log tail -f equ.log # enter Ctl-C to stop tailing Note that the energy is output at every time-step. Why is the total energy changing with time? What about the total volume? = run dynamics = Running dynamics uses the same procedure as before, but now we need to worry about how much and which output to produce. nano run.mdp # no changes required grompp -c equ.gro -f run.mdp -o run.tpr Check and start equilibration job (no changes required). nano run.sh sbatch run.sh squeue -u `whoami` Read through run.log less run.log tail -f run.log # enter Ctl-C to stop tailing Notice that the total energy remains relatively constant now, but the individual energies are still very noisy. What does this say about the shape of the molecules? = analyze dynamic data = Let's first check what happened during equilibration. Since the volume was allowed to change, we should be able to plot it vs. time: g_energy -f equ.edr -o equ.en.xvg # Select: Potential Kinetic-En. Total-Energy Volume * At what time does the potential energy stabilize? * What is the density? ** answer: (33*46 + 18*133)/Avogadro / 7.0333834916722191e-21 = 0.9236 g/mL ** These two quantities inform on the heat and volume change of mixing. ** Pure H2O (TIP4P): rho = 1.001, H ~ 11.6 kcal/mol, D = 3.9e-5 cm^2/s, eps = 52 ** Pure H2O (expt): rho = 0.9971, H = 10.5 kcal/mol, D = 2.3e-5 cm^2/s, eps = 78.4 ** (J. Chem. Phys. 123, 234505, 2005) ** Pure EtOH: rho = 0.7873, H = 10.0 kcal/mol, D = 1.0e-5 cm^2/s, eps(expt) = 23 ** (J. Phys. Chem. B 1997, 101, 78-86, J. Phys. Chem. B, 2014, 118 (34), 10156-66) Gnuplot can make this plot with plot 'equ.en.xvg' u 1:2 w l, 'equ.en.xvg' u 1:5 axis x1y2 w l The radial distribution function is a classical measure of the structuring of liquid water. The one we calculate here shows the density of molecules within spherical shells around the central molecule. g_rdf -rdf mol_com -ng 2 -f run.trr -o run.w-rdf.xvg # select Water as "reference group", select "Water", then "ETH" # re-run for ETH-ETH rdf g_rdf -rdf mol_com -ng 1 -f run.trr -o run.e-rdf.xvg gnuplot can plot these together with: plot 'run.w-rdf.xvg' u 1:2 w l, 'run.w-rdf.xvg' u 1:3 w l, 'run.e-rdf.xvg' u 1:2 w l Notice how waters stack much more closely together than EtOH? How is this related to their liquid densities? The dielectric of a liquid measures its ability to be polarized by an applied field. High dielectric materials make good capacitors. g_dipoles -f run.trr -s run.tpr -c dipcorr.xvg -corr total -P 1 <pre><nowiki> Dipole moment (Debye) --------------------- Average = 2.2234 Std. Dev. = 0.1095 Error = 0.0001 The following averages for the complete trajectory have been calculated: Total < M_x > = 7.79882 Debye Total < M_y > = -1.11977 Debye Total < M_z > = 9.49511 Debye Total < M_x^2 > = 882.516 Debye^2 Total < M_y^2 > = 1239.78 Debye^2 Total < M_z^2 > = 925.457 Debye^2 Total < |M|^2 > = 3047.75 Debye^2 Total |< M >|^2 = 152.233 Debye^2 < |M|^2 > - |< M >|^2 = 2895.52 Debye^2 Finite system Kirkwood g factor G_k = 3.52836 Infinite system Kirkwood g factor g_k = 2.37948 Epsilon = 43.1739 </nowiki></pre> Water and EtOH are constantly undergoing random collisions in solution. The net effect of this is diffusion of the two molecules. Einstein showed that this can be tracked by watching the mean squared displacement of the molecules over time. Since the distance traveled over a random walk with diffusion constant <math>D</math> has a Gaussian distribution with variance <math>2D\Delta t</math>, where <math>\Delta t</math> is the elapsed time, the mean squared displacement vs time should be a straight line with slope <math>2D</math>. Of course, over short times, this picture is only approximate, but it usually holds over longer times. g_msd -f run.trr -ngroup 2 -o run.msd.xvg <pre><nowiki> Fitting from 100 to 900 ps D[ Water] 1.4336 (+/- 0.0850) 1e-5 cm^2/s D[ ETH] 0.7312 (+/- 0.1279) 1e-5 cm^2/s </nowiki></pre> How do these compare with the literature values (above) for the pure liquids? More detail on velocity correlation: g_velacc -mol -f run.trr -o run.w-acf.xvg # Choose group 3 (Water) g_velacc -mol -f run.trr -o run.e-acf.xvg # Choose group 2 (ETH) you can compare these to some of the above references. 8f2a2de41b7370b1476669bf6e27e98e165e6152 317 316 2014-11-22T17:48:25Z David M. Rogers 2 wikitext text/x-wiki In this tutorial, I'm assuming you already have the gromacs commands (grompp, mdrun, etc.) loaded. On circe at USF, this is done with: module load apps/gromacs/4.5.5 You'll also need the starting files [[Media:liq_files.tgz|here]]. = Create an input system = First, we do some size calculations in the python prompt. >>> # Compute number of EtOH molecules >>> # 8 nm^3 = 8e-21 cc >>> # 0.4 % By vol. >>> # rho_EtOH = 0.78924 g / cc >>> # FW = 46 g/mol >>> >>> 8e-21*0.4*0.78924/46.0*6.022e23 33 Next, we need to generate an 8 nm<math>^3</math> box with 33 EtOH molecules genbox -box 2 2 2 -ci etoh.pdb -o box.pdb -nmol 33 nano topol.top # check for line "ETH 33" (no changes required) If the topology file and forcefields are 'there', we can create a test simulation using just these molecules. We'll do this just to check that grompp works grompp -c box.pdb -f equ.mdp -o equ.tpr Next, the complete water+EtOH mixture can be made by filling the voids with water. We'll use TIP4P here. genbox -cs tip4p -cp box.pdb -o sys.pdb Since this last command added waters, you have to update the topology file, adding "SOL 133" (or your number of waters) nano topol.top = run minimization = Molecular structures can be touchy, since contacting atoms causes large forces and 'blows up' a system. The risk of this can be reduced by minimizing the energy of initial starting systems. First, we have to create a file describing how gromacs should do the minimization. grompp -f min.mdp -c sys.pdb -o min A lot of backup files (starting with '#') accumulate, and we remove them like so: rm -f \#* mdout.mdp Now we're ready to run minimization. Since the system is small, minimization is cheap and fast - so we do it on the head node. For larger systems, this command would be put in a job-script. mdrun -s min -o min -g min -e min -c min Now we're ready to take the minimized structure and run dynamics. This first round is called equilibration, since we intend to let the system settle into a thermal equilibrium state. grompp -c min.gro -f equ.mdp -o equ.tpr To run this one, we'll use the cluster by writing down the command in a script file. That script gets sent to the cluster. No changes to equ.sh should be required. nano equ.sh qsub -q devel equ.sh qstat -u `whoami` As the job is running you can read through the log file. less equ.log tail -f equ.log # enter Ctl-C to stop tailing Note that the energy is output at every time-step. Why is the total energy changing with time? What about the total volume? = run dynamics = Running dynamics uses the same procedure as before, but now we need to worry about how much and which output to produce. nano run.mdp # no changes required grompp -c equ.gro -f run.mdp -o run.tpr Check and start the job (no changes required). nano run.sh qsub -q devel run.sh qstat -u `whoami` Read through run.log less run.log tail -f run.log # enter Ctl-C to stop tailing Notice that the total energy remains relatively constant now, but the individual energies are still very noisy. What does this say about the shape of the molecules? = analyze dynamic data = Let's first check what happened during equilibration. Since the volume was allowed to change, we should be able to plot it vs. time: g_energy -f equ.edr -o equ.en.xvg # Select: Potential Kinetic-En. Total-Energy Volume * At what time does the potential energy stabilize? * What is the density? ** answer: (33*46 + 18*133)/Avogadro / 7.0333834916722191e-21 = 0.9236 g/mL ** These two quantities inform on the heat and volume change of mixing. ** Pure H2O (TIP4P): rho = 1.001, H ~ 11.6 kcal/mol, D = 3.9e-5 cm^2/s, eps = 52 ** Pure H2O (expt): rho = 0.9971, H = 10.5 kcal/mol, D = 2.3e-5 cm^2/s, eps = 78.4 ** (J. Chem. Phys. 123, 234505, 2005) ** Pure EtOH: rho = 0.7873, H = 10.0 kcal/mol, D = 1.0e-5 cm^2/s, eps(expt) = 23 ** (J. Phys. Chem. B 1997, 101, 78-86, J. Phys. Chem. B, 2014, 118 (34), 10156-66) Gnuplot can make this plot with plot 'equ.en.xvg' u 1:2 w l, 'equ.en.xvg' u 1:5 axis x1y2 w l The radial distribution function is a classical measure of the structuring of liquid water. The one we calculate here shows the density of molecules within spherical shells around the central molecule. g_rdf -rdf mol_com -ng 2 -f run.trr -o run.w-rdf.xvg # select Water as "reference group", select "Water", then "ETH" # re-run for ETH-ETH rdf g_rdf -rdf mol_com -ng 1 -f run.trr -o run.e-rdf.xvg gnuplot can plot these together with: plot 'run.w-rdf.xvg' u 1:2 w l, 'run.w-rdf.xvg' u 1:3 w l, 'run.e-rdf.xvg' u 1:2 w l Notice how waters stack much more closely together than EtOH? How is this related to their liquid densities? The dielectric of a liquid measures its ability to be polarized by an applied field. High dielectric materials make good capacitors. g_dipoles -f run.trr -s run.tpr -c dipcorr.xvg -corr total -P 1 <pre><nowiki> Dipole moment (Debye) --------------------- Average = 2.2234 Std. Dev. = 0.1095 Error = 0.0001 The following averages for the complete trajectory have been calculated: Total < M_x > = 7.79882 Debye Total < M_y > = -1.11977 Debye Total < M_z > = 9.49511 Debye Total < M_x^2 > = 882.516 Debye^2 Total < M_y^2 > = 1239.78 Debye^2 Total < M_z^2 > = 925.457 Debye^2 Total < |M|^2 > = 3047.75 Debye^2 Total |< M >|^2 = 152.233 Debye^2 < |M|^2 > - |< M >|^2 = 2895.52 Debye^2 Finite system Kirkwood g factor G_k = 3.52836 Infinite system Kirkwood g factor g_k = 2.37948 Epsilon = 43.1739 </nowiki></pre> Water and EtOH are constantly undergoing random collisions in solution. The net effect of this is diffusion of the two molecules. Einstein showed that this can be tracked by watching the mean squared displacement of the molecules over time. Since the distance traveled over a random walk with diffusion constant <math>D</math> has a Gaussian distribution with variance <math>2D\Delta t</math>, where <math>\Delta t</math> is the elapsed time, the mean squared displacement vs time should be a straight line with slope <math>2D</math>. Of course, over short times, this picture is only approximate, but it usually holds over longer times. g_msd -f run.trr -ngroup 2 -o run.msd.xvg <pre><nowiki> Fitting from 100 to 900 ps D[ Water] 1.4336 (+/- 0.0850) 1e-5 cm^2/s D[ ETH] 0.7312 (+/- 0.1279) 1e-5 cm^2/s </nowiki></pre> How do these compare with the literature values (above) for the pure liquids? More detail on velocity correlation: g_velacc -mol -f run.trr -o run.w-acf.xvg # Choose group 3 (Water) g_velacc -mol -f run.trr -o run.e-acf.xvg # Choose group 2 (ETH) you can compare these to some of the above references. a322b4c792224ab6fddec89e314a1f304f2faf67 318 317 2014-11-22T19:47:22Z David M. Rogers 2 /* analyze dynamic data */ wikitext text/x-wiki In this tutorial, I'm assuming you already have the gromacs commands (grompp, mdrun, etc.) loaded. On circe at USF, this is done with: module load apps/gromacs/4.5.5 You'll also need the starting files [[Media:liq_files.tgz|here]]. = Create an input system = First, we do some size calculations in the python prompt. >>> # Compute number of EtOH molecules >>> # 8 nm^3 = 8e-21 cc >>> # 0.4 % By vol. >>> # rho_EtOH = 0.78924 g / cc >>> # FW = 46 g/mol >>> >>> 8e-21*0.4*0.78924/46.0*6.022e23 33 Next, we need to generate an 8 nm<math>^3</math> box with 33 EtOH molecules genbox -box 2 2 2 -ci etoh.pdb -o box.pdb -nmol 33 nano topol.top # check for line "ETH 33" (no changes required) If the topology file and forcefields are 'there', we can create a test simulation using just these molecules. We'll do this just to check that grompp works grompp -c box.pdb -f equ.mdp -o equ.tpr Next, the complete water+EtOH mixture can be made by filling the voids with water. We'll use TIP4P here. genbox -cs tip4p -cp box.pdb -o sys.pdb Since this last command added waters, you have to update the topology file, adding "SOL 133" (or your number of waters) nano topol.top = run minimization = Molecular structures can be touchy, since contacting atoms causes large forces and 'blows up' a system. The risk of this can be reduced by minimizing the energy of initial starting systems. First, we have to create a file describing how gromacs should do the minimization. grompp -f min.mdp -c sys.pdb -o min A lot of backup files (starting with '#') accumulate, and we remove them like so: rm -f \#* mdout.mdp Now we're ready to run minimization. Since the system is small, minimization is cheap and fast - so we do it on the head node. For larger systems, this command would be put in a job-script. mdrun -s min -o min -g min -e min -c min Now we're ready to take the minimized structure and run dynamics. This first round is called equilibration, since we intend to let the system settle into a thermal equilibrium state. grompp -c min.gro -f equ.mdp -o equ.tpr To run this one, we'll use the cluster by writing down the command in a script file. That script gets sent to the cluster. No changes to equ.sh should be required. nano equ.sh qsub -q devel equ.sh qstat -u `whoami` As the job is running you can read through the log file. less equ.log tail -f equ.log # enter Ctl-C to stop tailing Note that the energy is output at every time-step. Why is the total energy changing with time? What about the total volume? = run dynamics = Running dynamics uses the same procedure as before, but now we need to worry about how much and which output to produce. nano run.mdp # no changes required grompp -c equ.gro -f run.mdp -o run.tpr Check and start the job (no changes required). nano run.sh qsub -q devel run.sh qstat -u `whoami` Read through run.log less run.log tail -f run.log # enter Ctl-C to stop tailing Notice that the total energy remains relatively constant now, but the individual energies are still very noisy. What does this say about the shape of the molecules? = analyze dynamic data = Let's first check what happened during equilibration. Since the volume was allowed to change, we should be able to plot it vs. time: g_energy -f equ.edr -o equ.en.xvg # Select: Potential Kinetic-En. Total-Energy Volume * At what time does the potential energy stabilize? * What is the density? ** answer: (33*46 + 18*133)/Avogadro / 7.0333834916722191e-21 = 0.9236 g/mL ** These two quantities inform on the heat and volume change of mixing. ** Pure H2O (TIP4P): rho = 1.001, H ~ 11.6 kcal/mol, D = 3.9e-5 cm^2/s, eps = 52 ** Pure H2O (expt): rho = 0.9971, H = 10.5 kcal/mol, D = 2.3e-5 cm^2/s, eps = 78.4 ** Gas-phase TIP4P energy = 0 (no self interactions in the model) ** Gas-phase OPLSAA-EtOH energy = 25 kJ/mol (<math>\pm</math>1) ** (J. Chem. Phys. 123, 234505, 2005) ** Pure EtOH: rho = 0.7873, H = 10.0 kcal/mol, D = 1.0e-5 cm^2/s, eps(expt) = 23 ** (J. Phys. Chem. B 1997, 101, 78-86, J. Phys. Chem. B, 2014, 118 (34), 10156-66) Gnuplot can make this plot with plot 'equ.en.xvg' u 1:2 w l, 'equ.en.xvg' u 1:5 axis x1y2 w l The radial distribution function is a classical measure of the structuring of liquid water. The one we calculate here shows the density of molecules within spherical shells around the central molecule. g_rdf -rdf mol_com -ng 2 -f run.trr -o run.w-rdf.xvg # select Water as "reference group", select "Water", then "ETH" # re-run for ETH-ETH rdf g_rdf -rdf mol_com -ng 1 -f run.trr -o run.e-rdf.xvg gnuplot can plot these together with: plot 'run.w-rdf.xvg' u 1:2 w l, 'run.w-rdf.xvg' u 1:3 w l, 'run.e-rdf.xvg' u 1:2 w l Notice how waters stack much more closely together than EtOH? How is this related to their liquid densities? The dielectric of a liquid measures its ability to be polarized by an applied field. High dielectric materials make good capacitors. g_dipoles -f run.trr -s run.tpr -c dipcorr.xvg -corr total -P 1 <pre><nowiki> Dipole moment (Debye) --------------------- Average = 2.2234 Std. Dev. = 0.1095 Error = 0.0001 The following averages for the complete trajectory have been calculated: Total < M_x > = 7.79882 Debye Total < M_y > = -1.11977 Debye Total < M_z > = 9.49511 Debye Total < M_x^2 > = 882.516 Debye^2 Total < M_y^2 > = 1239.78 Debye^2 Total < M_z^2 > = 925.457 Debye^2 Total < |M|^2 > = 3047.75 Debye^2 Total |< M >|^2 = 152.233 Debye^2 < |M|^2 > - |< M >|^2 = 2895.52 Debye^2 Finite system Kirkwood g factor G_k = 3.52836 Infinite system Kirkwood g factor g_k = 2.37948 Epsilon = 43.1739 </nowiki></pre> Water and EtOH are constantly undergoing random collisions in solution. The net effect of this is diffusion of the two molecules. Einstein showed that this can be tracked by watching the mean squared displacement of the molecules over time. Since the distance traveled over a random walk with diffusion constant <math>D</math> has a Gaussian distribution with variance <math>2D\Delta t</math>, where <math>\Delta t</math> is the elapsed time, the mean squared displacement vs time should be a straight line with slope <math>2D</math>. Of course, over short times, this picture is only approximate, but it usually holds over longer times. g_msd -f run.trr -ngroup 2 -o run.msd.xvg <pre><nowiki> Fitting from 100 to 900 ps D[ Water] 1.4336 (+/- 0.0850) 1e-5 cm^2/s D[ ETH] 0.7312 (+/- 0.1279) 1e-5 cm^2/s </nowiki></pre> How do these compare with the literature values (above) for the pure liquids? More detail on velocity correlation: g_velacc -mol -f run.trr -o run.w-acf.xvg # Choose group 3 (Water) g_velacc -mol -f run.trr -o run.e-acf.xvg # Choose group 2 (ETH) you can compare these to some of the above references. 6c40e821f007cb6779588d6c4e78d5857d0dfc12 File:Liq files.tgz 6 68 315 2014-11-21T15:30:18Z David M. Rogers 2 wikitext text/x-wiki da39a3ee5e6b4b0d3255bfef95601890afd80709 CompSciWeek14-15 0 64 319 307 2014-11-24T17:17:40Z David M. Rogers 2 wikitext text/x-wiki [[File:build.svg]] = Installation Woes = * Python packages (ex: sympy) * GNU Autotools + make-based process (ex: FFTW) * Cmake: a developer-friendly (not user-friendly?) alternative (ex: cgal) * Non-standard makes (ex: NAMD2 and NWChem) * Tinkering with open-source * The DL on Software Licenses ** Apache, BSD, GPL, Microsoft, FDL, Creative Commons ** The open-source that isn't: Canvas The single most important idea for compiling and installing new software is to remember that the installation works for the developer's environment, and it will for you, too if your environment is setup correctly. Often times this is easier said than done. # Package Dependencies (pdftk depends on libgcj) #* and versions of those packages - this is usually the worst part # Shell variables #* PATH, CFLAGS, LDFLAGS, LD_LIBRARY_PATH # Compiler version # Machine architecture Tips: To find a package owning a file (on linux systems with rpm) rpm -qf /usr/lib64/libfftw3.so.3 To find all files associated with a package rpm -ql fftw-3.2.1-3.1.el6.x86_64 = The Monte Carlo Method = * Integrals of the form: <math>\int \frac{f(x)}{g(x)} g(x) dx</math> * Computing pi * Parallelizing with MPI4Py 9c6f8fb6d6b0c64b3f086b0caf3c0b06c8438f01 321 319 2014-11-24T17:20:43Z David M. Rogers 2 wikitext text/x-wiki [[File:build.svg|800px]] = Installation Woes = * Python packages (ex: sympy) * GNU Autotools + make-based process (ex: FFTW) * Cmake: a developer-friendly (not user-friendly?) alternative (ex: cgal) * Non-standard makes (ex: NAMD2 and NWChem) * Tinkering with open-source * The DL on Software Licenses ** Apache, BSD, GPL, Microsoft, FDL, Creative Commons ** The open-source that isn't: Canvas The single most important idea for compiling and installing new software is to remember that the installation works for the developer's environment, and it will for you, too if your environment is setup correctly. Often times this is easier said than done. # Package Dependencies (pdftk depends on libgcj) #* and versions of those packages - this is usually the worst part # Shell variables #* PATH, CFLAGS, LDFLAGS, LD_LIBRARY_PATH # Compiler version # Machine architecture Tips: To find a package owning a file (on linux systems with rpm) rpm -qf /usr/lib64/libfftw3.so.3 To find all files associated with a package rpm -ql fftw-3.2.1-3.1.el6.x86_64 = The Monte Carlo Method = * Integrals of the form: <math>\int \frac{f(x)}{g(x)} g(x) dx</math> * Computing pi * Parallelizing with MPI4Py ec20e512760745d272b5a85f3da840fc7196b1fa 327 321 2014-11-26T20:42:58Z David M. Rogers 2 wikitext text/x-wiki [[File:build.svg|800px]] = Installation Woes = * Python packages (ex: sympy) * GNU Autotools + make-based process (ex: FFTW) * Cmake: a developer-friendly (not user-friendly?) alternative (ex: cgal) * Non-standard makes (ex: NAMD2 and NWChem) * Tinkering with open-source * The DL on Software Licenses ** Apache, BSD, GPL, Microsoft, FDL, Creative Commons ** The open-source that isn't: Canvas The single most important idea for compiling and installing new software is to remember that the installation works for the developer's environment, and it will for you, too if your environment is setup correctly. Often times this is easier said than done. # Package Dependencies (pdftk depends on libgcj) #* and versions of those packages - this is usually the worst part # Shell variables #* PATH, CFLAGS, LDFLAGS, LD_LIBRARY_PATH # Compiler version # Machine architecture Tips: To find a package owning a file (on linux systems with rpm) rpm -qf /usr/lib64/libfftw3.so.3 To find all files associated with a package rpm -ql fftw-3.2.1-3.1.el6.x86_64 = Fourier Transforms = Read through the page on [[HowTo:Fourier|Fourier transforms]]. = The Monte Carlo Method = * Integrals of the form: <math>\int \frac{f(x)}{g(x)} g(x) dx</math> * Computing pi * Parallelizing with MPI4Py f10157f3c64227335ed11009106855ac0f686590 329 327 2014-12-03T17:25:19Z David M. Rogers 2 wikitext text/x-wiki [[File:build.svg|800px]] = Installation Woes = * Python packages (ex: sympy) * GNU Autotools + make-based process (ex: FFTW) * Cmake: a developer-friendly (not user-friendly?) alternative (ex: cgal) * Non-standard makes (ex: NAMD2 and NWChem) * Tinkering with open-source * The DL on Software Licenses ** Apache, BSD, GPL, Microsoft, FDL, Creative Commons ** The open-source that isn't: Canvas The single most important idea for compiling and installing new software is to remember that the installation works for the developer's environment, and it will for you, too if your environment is setup correctly. Often times this is easier said than done. # Package Dependencies (pdftk depends on libgcj) #* and versions of those packages - this is usually the worst part # Shell variables #* PATH, CFLAGS, LDFLAGS, LD_LIBRARY_PATH # Compiler version # Machine architecture Tips: To find a package owning a file (on linux systems with rpm) rpm -qf /usr/lib64/libfftw3.so.3 To find all files associated with a package rpm -ql fftw-3.2.1-3.1.el6.x86_64 == Example 1 == Installing pdftk (developer Makefile) mkdir ~/build && cd ~\build wget https://www.pdflabs.com/tools/pdftk-the-pdf-toolkit/pdftk-2.02-src.zip Unpacking the zip file can (and often does) clobber files in your current directory, so it's always safest to unpack it in a new directory: mkdir pdftk && cd pdftk unzip pdftk-2.02-src.zip ls In this case, pdftk was nice enough to put all their files in a subfolder, so we can get rid of the temp directory. cd .. mv pdftk/pdftk-2.02-src rmdir pdftk If you read the license information, you'll note that pdftk is covered by a GPL copyright. This means you have the freedom to modify and re-distribute the source (but not to change the license). The GPL is sometimes called a 'copyleft', since it is a clever hack on copyright perpetrated by Richard Stallman, the founder of the GNU project. Make is a small language that lists the shell commands required to 'make' the 'targets'. A make target can be anything, but usually is the name of an executable file (or a file at an intermediate step) that will be built during the compilation process. Some standard options to make are make -j 8 -C $PWD install The '-j 8' flag tells make to run in parallel on 8 processors. The '-C' flag tells make what directory to run make from. Here, it's for illustration, since the default is to run in the current directory. The name 'install' is the target to build. It is not a real file, but instead just has a list of commands that copy the compiled program into the filesystem. The great thing about make is that it knows what order to make all the files in. == Example 2 == Installing fftw (autotools) A quick search turns up the main page for [http://www.fftw.org/download.html fftw], the '''Fastest Fourier Transform in the West'''. mkdir ~/build && cd ~/build wget ftp://ftp.fftw.org/pub/fftw/fftw-3.3.4.tar.gz This is a tar (tape archive) that has been gzipped (usually given the endearing name 'tarball'). You can read the contents with tar tzf fftw-3.3.4.tar.gz | less tar xzf fftw-3.3.4.tar.gz The first command lists the contents. It is really helpful to make sure that all the files in the tarball are in their own directory. Most tarballs should be packed this way. Ones that aren't will put files in your current directory, and may clobber other files you had there before. cd fftw-3.3.4 less README The second line is absolutely critical, since almost every package has some installation quirk that you won't know about until it's too late -- or until you read the instructions, either way. You'll notice this file says configure, make, make install. This means the package uses gnu autotools! Autotools are a standard set of installation scripts that follow the general install commands above. The configure part is the most important, since it gives you a chance to put in details about your own environment. In addition to reading all install instructions, you should also run ./configure --help This will give you a list of options that tell the compile process what compilers to use and where to find libraries and include files that the package may well depend on. The standard ones (CFLAGS, etc.) are shown in the graphic at the top of this page. ./configure --with-pic --enable-float --prefix=$HOME The second part of autotools is (sometimes GNU) make, covered above. make -j4 install == Example 3 == Installing gromacs (CMAKE) = Fourier Transforms = Read through the page on [[HowTo:Fourier|Fourier transforms]]. = The Monte Carlo Method = * Integrals of the form: <math>\int \frac{f(x)}{g(x)} g(x) dx</math> * Computing pi * Parallelizing with MPI4Py 6951066caf6ad62e9339649047b0b658257f58fb 330 329 2014-12-03T22:15:03Z David M. Rogers 2 /* Example 1 */ wikitext text/x-wiki [[File:build.svg|800px]] = Installation Woes = * Python packages (ex: sympy) * GNU Autotools + make-based process (ex: FFTW) * Cmake: a developer-friendly (not user-friendly?) alternative (ex: cgal) * Non-standard makes (ex: NAMD2 and NWChem) * Tinkering with open-source * The DL on Software Licenses ** Apache, BSD, GPL, Microsoft, FDL, Creative Commons ** The open-source that isn't: Canvas The single most important idea for compiling and installing new software is to remember that the installation works for the developer's environment, and it will for you, too if your environment is setup correctly. Often times this is easier said than done. # Package Dependencies (pdftk depends on libgcj) #* and versions of those packages - this is usually the worst part # Shell variables #* PATH, CFLAGS, LDFLAGS, LD_LIBRARY_PATH # Compiler version # Machine architecture Tips: To find a package owning a file (on linux systems with rpm) rpm -qf /usr/lib64/libfftw3.so.3 To find all files associated with a package rpm -ql fftw-3.2.1-3.1.el6.x86_64 == Example 1 == Installing pdftk (developer Makefile) mkdir ~/build && cd ~/build wget https://www.pdflabs.com/tools/pdftk-the-pdf-toolkit/pdftk-2.02-src.zip Unpacking the zip file can (and often does) clobber files in your current directory, so it's always safest to unpack it in a new directory: mkdir pdftk && cd pdftk unzip ../pdftk-2.02-src.zip ls In this case, pdftk was nice enough to put all their files in a subfolder, so we can get rid of the temp directory. cd .. mv pdftk/pdftk-2.02-src . rmdir pdftk If you read the license information, you'll note that pdftk is covered by a GPL copyright. This means you have the freedom to modify and re-distribute the source (but not to change the license). The GPL is sometimes called a 'copyleft', since it is a clever hack on copyright perpetrated by Richard Stallman, the founder of the GNU project. Make is a small language that lists the shell commands required to 'make' the 'targets'. A make target can be anything, but usually is the name of an executable file (or a file at an intermediate step) that will be built during the compilation process. Pdftk has installation instructions on its website, which outline a make-based process commonly seen for development on small projects. pdftk is large-ish because the pdf file format can do a lot, but the build process is small because it is based on java. Some standard options to make are make -f Makefile.Redhat -j 8 -C $PWD install The '-j 8' flag tells make to run in parallel on 8 processors. The '-C' flag tells make what directory to run make from. Here, it's for illustration, since the default is to run in the current directory. The name 'install' is the target to build. It is not a real file, but instead just has a list of commands that copy the compiled program into the filesystem. The great thing about make is that it knows what order to make all the files in. In this instance, make will build the executable, '''pdftk''', but will not install it - since it tries to copy it into /usr/local/bin. You should read '''Makefile.Redhat''' to find the '''install''' target. You'll notice that it's not there, but at the bottom the Makefile includes '''Makefile.Base'''. Looking at that file, you will find the install target. It is run with a single line that installs (carefully copies) pdftk from the current directory into /usr/local/bin. make install will work if you change /usr/local/bin to $(HOME)/bin. You may also consider installing the manpage (pdftk.1 from the main pdftk directory). cd .. cp pdftk.1 $HOME/share/man/man1 export MANPATH=$MANPATH:$HOME/share/man == Example 2 == Installing fftw (autotools) A quick search turns up the main page for [http://www.fftw.org/download.html fftw], the '''Fastest Fourier Transform in the West'''. mkdir ~/build && cd ~/build wget ftp://ftp.fftw.org/pub/fftw/fftw-3.3.4.tar.gz This is a tar (tape archive) that has been gzipped (usually given the endearing name 'tarball'). You can read the contents with tar tzf fftw-3.3.4.tar.gz | less tar xzf fftw-3.3.4.tar.gz The first command lists the contents. It is really helpful to make sure that all the files in the tarball are in their own directory. Most tarballs should be packed this way. Ones that aren't will put files in your current directory, and may clobber other files you had there before. cd fftw-3.3.4 less README The second line is absolutely critical, since almost every package has some installation quirk that you won't know about until it's too late -- or until you read the instructions, either way. You'll notice this file says configure, make, make install. This means the package uses gnu autotools! Autotools are a standard set of installation scripts that follow the general install commands above. The configure part is the most important, since it gives you a chance to put in details about your own environment. In addition to reading all install instructions, you should also run ./configure --help This will give you a list of options that tell the compile process what compilers to use and where to find libraries and include files that the package may well depend on. The standard ones (CFLAGS, etc.) are shown in the graphic at the top of this page. ./configure --with-pic --enable-float --prefix=$HOME The second part of autotools is (sometimes GNU) make, covered above. make -j4 install == Example 3 == Installing gromacs (CMAKE) = Fourier Transforms = Read through the page on [[HowTo:Fourier|Fourier transforms]]. = The Monte Carlo Method = * Integrals of the form: <math>\int \frac{f(x)}{g(x)} g(x) dx</math> * Computing pi * Parallelizing with MPI4Py a23e0d0080f5b9832b8d7d0946ff955dcdcf4581 331 330 2014-12-03T22:37:56Z David M. Rogers 2 /* Example 3 */ wikitext text/x-wiki [[File:build.svg|800px]] = Installation Woes = * Python packages (ex: sympy) * GNU Autotools + make-based process (ex: FFTW) * Cmake: a developer-friendly (not user-friendly?) alternative (ex: cgal) * Non-standard makes (ex: NAMD2 and NWChem) * Tinkering with open-source * The DL on Software Licenses ** Apache, BSD, GPL, Microsoft, FDL, Creative Commons ** The open-source that isn't: Canvas The single most important idea for compiling and installing new software is to remember that the installation works for the developer's environment, and it will for you, too if your environment is setup correctly. Often times this is easier said than done. # Package Dependencies (pdftk depends on libgcj) #* and versions of those packages - this is usually the worst part # Shell variables #* PATH, CFLAGS, LDFLAGS, LD_LIBRARY_PATH # Compiler version # Machine architecture Tips: To find a package owning a file (on linux systems with rpm) rpm -qf /usr/lib64/libfftw3.so.3 To find all files associated with a package rpm -ql fftw-3.2.1-3.1.el6.x86_64 == Example 1 == Installing pdftk (developer Makefile) mkdir ~/build && cd ~/build wget https://www.pdflabs.com/tools/pdftk-the-pdf-toolkit/pdftk-2.02-src.zip Unpacking the zip file can (and often does) clobber files in your current directory, so it's always safest to unpack it in a new directory: mkdir pdftk && cd pdftk unzip ../pdftk-2.02-src.zip ls In this case, pdftk was nice enough to put all their files in a subfolder, so we can get rid of the temp directory. cd .. mv pdftk/pdftk-2.02-src . rmdir pdftk If you read the license information, you'll note that pdftk is covered by a GPL copyright. This means you have the freedom to modify and re-distribute the source (but not to change the license). The GPL is sometimes called a 'copyleft', since it is a clever hack on copyright perpetrated by Richard Stallman, the founder of the GNU project. Make is a small language that lists the shell commands required to 'make' the 'targets'. A make target can be anything, but usually is the name of an executable file (or a file at an intermediate step) that will be built during the compilation process. Pdftk has installation instructions on its website, which outline a make-based process commonly seen for development on small projects. pdftk is large-ish because the pdf file format can do a lot, but the build process is small because it is based on java. Some standard options to make are make -f Makefile.Redhat -j 8 -C $PWD install The '-j 8' flag tells make to run in parallel on 8 processors. The '-C' flag tells make what directory to run make from. Here, it's for illustration, since the default is to run in the current directory. The name 'install' is the target to build. It is not a real file, but instead just has a list of commands that copy the compiled program into the filesystem. The great thing about make is that it knows what order to make all the files in. In this instance, make will build the executable, '''pdftk''', but will not install it - since it tries to copy it into /usr/local/bin. You should read '''Makefile.Redhat''' to find the '''install''' target. You'll notice that it's not there, but at the bottom the Makefile includes '''Makefile.Base'''. Looking at that file, you will find the install target. It is run with a single line that installs (carefully copies) pdftk from the current directory into /usr/local/bin. make install will work if you change /usr/local/bin to $(HOME)/bin. You may also consider installing the manpage (pdftk.1 from the main pdftk directory). cd .. cp pdftk.1 $HOME/share/man/man1 export MANPATH=$MANPATH:$HOME/share/man == Example 2 == Installing fftw (autotools) A quick search turns up the main page for [http://www.fftw.org/download.html fftw], the '''Fastest Fourier Transform in the West'''. mkdir ~/build && cd ~/build wget ftp://ftp.fftw.org/pub/fftw/fftw-3.3.4.tar.gz This is a tar (tape archive) that has been gzipped (usually given the endearing name 'tarball'). You can read the contents with tar tzf fftw-3.3.4.tar.gz | less tar xzf fftw-3.3.4.tar.gz The first command lists the contents. It is really helpful to make sure that all the files in the tarball are in their own directory. Most tarballs should be packed this way. Ones that aren't will put files in your current directory, and may clobber other files you had there before. cd fftw-3.3.4 less README The second line is absolutely critical, since almost every package has some installation quirk that you won't know about until it's too late -- or until you read the instructions, either way. You'll notice this file says configure, make, make install. This means the package uses gnu autotools! Autotools are a standard set of installation scripts that follow the general install commands above. The configure part is the most important, since it gives you a chance to put in details about your own environment. In addition to reading all install instructions, you should also run ./configure --help This will give you a list of options that tell the compile process what compilers to use and where to find libraries and include files that the package may well depend on. The standard ones (CFLAGS, etc.) are shown in the graphic at the top of this page. ./configure --with-pic --enable-float --prefix=$HOME The second part of autotools is (sometimes GNU) make, covered above. make -j4 install == Example 3 == Installing gromacs (CMAKE). The latest versions of gromacs use cmake - a new build tool created to replace autotools (configure). cmake uses two main files for its work: CMakeLists.txt CMakeCache.txt CMakeLists.txt is written by the package developers to control the build process. It typically introduces a list of required packages, calls some functions to test whether they are on the system and how to get to them (the configure process), and then lists a set of build targets. Unlike the make process, editing this file is unwise, since it mostly contains information on dependencies (which break the package if you change them). Sadly, cmake abstracts away all the good environment variables, getting rid of your ability to directly tweak the build process. Instead, you have a perplexing array of variables that can offer more control over the process. This comes at the expense of usually not knowing how or what variables need to be changed when you have a problem. Hopefully the developers left some documentation to clear up this point. Gromacs is good at this, and lets you know the major variables to change - one influencing the location of the fftw library and the other influencing whether or not to compile with MPI. To install gromacs, download and unpack the source as before. I'm working with gromacs-5.0-beta2 now, but you may find a different version when you read this. Next make sure your environment variables reference the compiler you intend to use. We have a module on rcslurm for the intel compiler, module load compilers/intel/2013sp1_cluster_xe Then generate CMakeCache.txt with the command cmake . This makes the cache file, which is the perplexing list of build variables referenced above. In a large project, running cmake . may produce CMakeCache.txt files in several sub-directories as well. find . -name CMakeCache.txt If you're unlucky, cmake will end with a version mismatch error, in which case you have to go out and get the latest version of cmake. We have a few on the rcslurm cluster, which you can load with, e.g. module load apps/cmake/2.8.12.2 There's also an interactive way to look at the most important variables used during cmake's build. It's ccmake . This will come up with a list, analogous to ./configure --help with autotools. If all goes well with the cmake process, you can proceed with the usual make process make -j8 make test make install A word of warning is in order. Gromacs is highly optimized, and uses information specific to the machine it is compiled on. Rcslurm has different hardware (amd vs intel processors) on the head node than the cluster nodes -- leading to an "Illegal instruction" error when you compile on one and run on the other. To get around this, you have to compile on a node rm -f CMakeCache.txt srun --ntasks-per-node 8 -N 1 --pty /bin/bash cmake . make -j8 make install With gromacs, you will want to compile an MPI version for the cluster and a non-mpi version for the head node (to create run-files and do simple analysis). Once you figure out the relevant cmake variables, you can save them as a build script. I've started doing this for all my builds, since it helps me keep track of what I've tried. The relevant one is here: <source lang="bash"> module load compilers/intel/2013sp1_cluster_xe mpi/openmpi/1.6.1 apps/cmake/2.8.12.2 cmake -DCMAKE_INSTALL_PREFIX=/shares/rogers \ -DFFTW_INCLUDE_DIR=/shares/rogers/include \ -DFFTW_LIBRARY=/shares/rogers/lib \ -DGMX_MPI=ON \ . make -j8 make install </source> = Fourier Transforms = Read through the page on [[HowTo:Fourier|Fourier transforms]]. = The Monte Carlo Method = * Integrals of the form: <math>\int \frac{f(x)}{g(x)} g(x) dx</math> * Computing pi * Parallelizing with MPI4Py d4ed64bc1a74f790b6fc6257130587fffb31a8c7 332 331 2014-12-03T23:19:34Z David M. Rogers 2 /* The Monte Carlo Method */ wikitext text/x-wiki [[File:build.svg|800px]] = Installation Woes = * Python packages (ex: sympy) * GNU Autotools + make-based process (ex: FFTW) * Cmake: a developer-friendly (not user-friendly?) alternative (ex: cgal) * Non-standard makes (ex: NAMD2 and NWChem) * Tinkering with open-source * The DL on Software Licenses ** Apache, BSD, GPL, Microsoft, FDL, Creative Commons ** The open-source that isn't: Canvas The single most important idea for compiling and installing new software is to remember that the installation works for the developer's environment, and it will for you, too if your environment is setup correctly. Often times this is easier said than done. # Package Dependencies (pdftk depends on libgcj) #* and versions of those packages - this is usually the worst part # Shell variables #* PATH, CFLAGS, LDFLAGS, LD_LIBRARY_PATH # Compiler version # Machine architecture Tips: To find a package owning a file (on linux systems with rpm) rpm -qf /usr/lib64/libfftw3.so.3 To find all files associated with a package rpm -ql fftw-3.2.1-3.1.el6.x86_64 == Example 1 == Installing pdftk (developer Makefile) mkdir ~/build && cd ~/build wget https://www.pdflabs.com/tools/pdftk-the-pdf-toolkit/pdftk-2.02-src.zip Unpacking the zip file can (and often does) clobber files in your current directory, so it's always safest to unpack it in a new directory: mkdir pdftk && cd pdftk unzip ../pdftk-2.02-src.zip ls In this case, pdftk was nice enough to put all their files in a subfolder, so we can get rid of the temp directory. cd .. mv pdftk/pdftk-2.02-src . rmdir pdftk If you read the license information, you'll note that pdftk is covered by a GPL copyright. This means you have the freedom to modify and re-distribute the source (but not to change the license). The GPL is sometimes called a 'copyleft', since it is a clever hack on copyright perpetrated by Richard Stallman, the founder of the GNU project. Make is a small language that lists the shell commands required to 'make' the 'targets'. A make target can be anything, but usually is the name of an executable file (or a file at an intermediate step) that will be built during the compilation process. Pdftk has installation instructions on its website, which outline a make-based process commonly seen for development on small projects. pdftk is large-ish because the pdf file format can do a lot, but the build process is small because it is based on java. Some standard options to make are make -f Makefile.Redhat -j 8 -C $PWD install The '-j 8' flag tells make to run in parallel on 8 processors. The '-C' flag tells make what directory to run make from. Here, it's for illustration, since the default is to run in the current directory. The name 'install' is the target to build. It is not a real file, but instead just has a list of commands that copy the compiled program into the filesystem. The great thing about make is that it knows what order to make all the files in. In this instance, make will build the executable, '''pdftk''', but will not install it - since it tries to copy it into /usr/local/bin. You should read '''Makefile.Redhat''' to find the '''install''' target. You'll notice that it's not there, but at the bottom the Makefile includes '''Makefile.Base'''. Looking at that file, you will find the install target. It is run with a single line that installs (carefully copies) pdftk from the current directory into /usr/local/bin. make install will work if you change /usr/local/bin to $(HOME)/bin. You may also consider installing the manpage (pdftk.1 from the main pdftk directory). cd .. cp pdftk.1 $HOME/share/man/man1 export MANPATH=$MANPATH:$HOME/share/man == Example 2 == Installing fftw (autotools) A quick search turns up the main page for [http://www.fftw.org/download.html fftw], the '''Fastest Fourier Transform in the West'''. mkdir ~/build && cd ~/build wget ftp://ftp.fftw.org/pub/fftw/fftw-3.3.4.tar.gz This is a tar (tape archive) that has been gzipped (usually given the endearing name 'tarball'). You can read the contents with tar tzf fftw-3.3.4.tar.gz | less tar xzf fftw-3.3.4.tar.gz The first command lists the contents. It is really helpful to make sure that all the files in the tarball are in their own directory. Most tarballs should be packed this way. Ones that aren't will put files in your current directory, and may clobber other files you had there before. cd fftw-3.3.4 less README The second line is absolutely critical, since almost every package has some installation quirk that you won't know about until it's too late -- or until you read the instructions, either way. You'll notice this file says configure, make, make install. This means the package uses gnu autotools! Autotools are a standard set of installation scripts that follow the general install commands above. The configure part is the most important, since it gives you a chance to put in details about your own environment. In addition to reading all install instructions, you should also run ./configure --help This will give you a list of options that tell the compile process what compilers to use and where to find libraries and include files that the package may well depend on. The standard ones (CFLAGS, etc.) are shown in the graphic at the top of this page. ./configure --with-pic --enable-float --prefix=$HOME The second part of autotools is (sometimes GNU) make, covered above. make -j4 install == Example 3 == Installing gromacs (CMAKE). The latest versions of gromacs use cmake - a new build tool created to replace autotools (configure). cmake uses two main files for its work: CMakeLists.txt CMakeCache.txt CMakeLists.txt is written by the package developers to control the build process. It typically introduces a list of required packages, calls some functions to test whether they are on the system and how to get to them (the configure process), and then lists a set of build targets. Unlike the make process, editing this file is unwise, since it mostly contains information on dependencies (which break the package if you change them). Sadly, cmake abstracts away all the good environment variables, getting rid of your ability to directly tweak the build process. Instead, you have a perplexing array of variables that can offer more control over the process. This comes at the expense of usually not knowing how or what variables need to be changed when you have a problem. Hopefully the developers left some documentation to clear up this point. Gromacs is good at this, and lets you know the major variables to change - one influencing the location of the fftw library and the other influencing whether or not to compile with MPI. To install gromacs, download and unpack the source as before. I'm working with gromacs-5.0-beta2 now, but you may find a different version when you read this. Next make sure your environment variables reference the compiler you intend to use. We have a module on rcslurm for the intel compiler, module load compilers/intel/2013sp1_cluster_xe Then generate CMakeCache.txt with the command cmake . This makes the cache file, which is the perplexing list of build variables referenced above. In a large project, running cmake . may produce CMakeCache.txt files in several sub-directories as well. find . -name CMakeCache.txt If you're unlucky, cmake will end with a version mismatch error, in which case you have to go out and get the latest version of cmake. We have a few on the rcslurm cluster, which you can load with, e.g. module load apps/cmake/2.8.12.2 There's also an interactive way to look at the most important variables used during cmake's build. It's ccmake . This will come up with a list, analogous to ./configure --help with autotools. If all goes well with the cmake process, you can proceed with the usual make process make -j8 make test make install A word of warning is in order. Gromacs is highly optimized, and uses information specific to the machine it is compiled on. Rcslurm has different hardware (amd vs intel processors) on the head node than the cluster nodes -- leading to an "Illegal instruction" error when you compile on one and run on the other. To get around this, you have to compile on a node rm -f CMakeCache.txt srun --ntasks-per-node 8 -N 1 --pty /bin/bash cmake . make -j8 make install With gromacs, you will want to compile an MPI version for the cluster and a non-mpi version for the head node (to create run-files and do simple analysis). Once you figure out the relevant cmake variables, you can save them as a build script. I've started doing this for all my builds, since it helps me keep track of what I've tried. The relevant one is here: <source lang="bash"> module load compilers/intel/2013sp1_cluster_xe mpi/openmpi/1.6.1 apps/cmake/2.8.12.2 cmake -DCMAKE_INSTALL_PREFIX=/shares/rogers \ -DFFTW_INCLUDE_DIR=/shares/rogers/include \ -DFFTW_LIBRARY=/shares/rogers/lib \ -DGMX_MPI=ON \ . make -j8 make install </source> = Fourier Transforms = Read through the page on [[HowTo:Fourier|Fourier transforms]]. = The Monte Carlo Method = * Integrals of the form: <math>\int \frac{f(x)}{g(x)} g(x) dx</math> * Computing pi * Parallelizing with MPI4Py Complicated integrals are common in the hard sciences. Most of these have analytical solutions or good approximations (see [mathworld.com] and the NIST Digital Library of Mathematical Functions ([http://dlmf.nist.gov/ DLMF])). Unfortunately, sometimes there is no analytical solution. The next best thing is to use quadrature. This is just summing the function computed at a specific set of points times a specific set of weights. Some background and the relevant scipy functions are [http://docs.scipy.org/doc/scipy-0.14.0/reference/generated/scipy.integrate.quad.html here]. There is also a great page of points and weights on [http://people.sc.fsu.edu/~jburkardt/datasets/quadrature_rules/quadrature_rules.html John Burkardt's page at FSU]. For integrals over high-dimensional spaces, and for those closely connected to probability distributions, the next next best thing is to use the Monte Carlo Method. This writes the integral <math>\int \frac{f(x)}{g(x)} g(x) dx</math> as <math>\int \frac{f(x)}{g(x)} g(x) dx = \lim_{N\to\infty} \frac{1}{N} \sum_i \frac{f(x_i)}{g(x_i)}</math> where the points <math>x_i</math> are generated from a probability distribution, <math>P(x_i) = g(x_i)</math> Common probability distributions are the Gaussian, <math>P(x) = (2\pi \sigma^2)^{-1/2} \exp{-\frac{(x-\mu)^2}{2\sigma^2}}</math> and the uniform distribution <math>P(x) = 1/L, x \in (0,L)</math> (among others). With that introduction, we can now approximate the value of <math>\pi</math> as the result of <math>\pi/4 = \int_0^1\int_0^1 (x^2 + y^1 < 1) \; dx\; dy </math> The function is one when the point x,y is inside the circle and zero otherwise. Physically, we are randomly tossing a point on the unit square and adding 1 to a total if it also happens to fall within the upper right quadrant of the unit circle. The code is dead simple: <source lang="python"> from numpy.random import random I = 0 for i in xrange(10000): x = random() y = random() I += x*x + y*y < 1.0 print float(I)*4e-4 </source> Numpy's random() function draws samples from the interval <math>(0,1)</math> with equal probability. Notice that it does not give pi exactly. It converges to pi in the limit of a large number of samples. Parallelizing this one is easy, since each processor can run a series of Monte Carlo trials, and the only communication between the processors is averaging the final results. If we ignore that last step for now, we can run the program in parallel without any changes just by saving it to a file, say '''calc_pi.py''' and running it with mpirun mpirun -np 8 calc_pi.py Running may require that you save that command to a sh file, sandwiched between batch queue commands and run with, e.g. '''sbatch run.sh'''. You'll notice that all 8 programs independently run all the commands. This is how MPI works - all processors run the same source program. You can get each processor to do something different by using MPI library calls. <source lang="python"> from mpi4py import MPI comm=MPI.COMM_WORLD size=comm.size rank=comm.rank # This is a unique number for each process name=MPI.Get_processor_name() if rank == 0: print "Tap dancing" elif rank == 1: print "Shopping @ store" elif rank == 2: print "Cooking roast beef" else: print "Staying home" s = comm.allreduce(rank, op=MPI.SUM) if rank == 0: print "Cumulative Node Number Sum = %d"%(s) </source> The last line calls MPI's allreduce, which combines values from all nodes and sends the result to all nodes. In this case the sum of all ranks is computed (which should be size(size-1)/2). Pairing the above script with the last one (and summing the Monte Carlo trials) gives an MPI program for estimating the value of pi. 7f536b44cdee14aaf6e2a8d340f159d808753b77 333 332 2014-12-03T23:20:03Z David M. Rogers 2 /* The Monte Carlo Method */ wikitext text/x-wiki [[File:build.svg|800px]] = Installation Woes = * Python packages (ex: sympy) * GNU Autotools + make-based process (ex: FFTW) * Cmake: a developer-friendly (not user-friendly?) alternative (ex: cgal) * Non-standard makes (ex: NAMD2 and NWChem) * Tinkering with open-source * The DL on Software Licenses ** Apache, BSD, GPL, Microsoft, FDL, Creative Commons ** The open-source that isn't: Canvas The single most important idea for compiling and installing new software is to remember that the installation works for the developer's environment, and it will for you, too if your environment is setup correctly. Often times this is easier said than done. # Package Dependencies (pdftk depends on libgcj) #* and versions of those packages - this is usually the worst part # Shell variables #* PATH, CFLAGS, LDFLAGS, LD_LIBRARY_PATH # Compiler version # Machine architecture Tips: To find a package owning a file (on linux systems with rpm) rpm -qf /usr/lib64/libfftw3.so.3 To find all files associated with a package rpm -ql fftw-3.2.1-3.1.el6.x86_64 == Example 1 == Installing pdftk (developer Makefile) mkdir ~/build && cd ~/build wget https://www.pdflabs.com/tools/pdftk-the-pdf-toolkit/pdftk-2.02-src.zip Unpacking the zip file can (and often does) clobber files in your current directory, so it's always safest to unpack it in a new directory: mkdir pdftk && cd pdftk unzip ../pdftk-2.02-src.zip ls In this case, pdftk was nice enough to put all their files in a subfolder, so we can get rid of the temp directory. cd .. mv pdftk/pdftk-2.02-src . rmdir pdftk If you read the license information, you'll note that pdftk is covered by a GPL copyright. This means you have the freedom to modify and re-distribute the source (but not to change the license). The GPL is sometimes called a 'copyleft', since it is a clever hack on copyright perpetrated by Richard Stallman, the founder of the GNU project. Make is a small language that lists the shell commands required to 'make' the 'targets'. A make target can be anything, but usually is the name of an executable file (or a file at an intermediate step) that will be built during the compilation process. Pdftk has installation instructions on its website, which outline a make-based process commonly seen for development on small projects. pdftk is large-ish because the pdf file format can do a lot, but the build process is small because it is based on java. Some standard options to make are make -f Makefile.Redhat -j 8 -C $PWD install The '-j 8' flag tells make to run in parallel on 8 processors. The '-C' flag tells make what directory to run make from. Here, it's for illustration, since the default is to run in the current directory. The name 'install' is the target to build. It is not a real file, but instead just has a list of commands that copy the compiled program into the filesystem. The great thing about make is that it knows what order to make all the files in. In this instance, make will build the executable, '''pdftk''', but will not install it - since it tries to copy it into /usr/local/bin. You should read '''Makefile.Redhat''' to find the '''install''' target. You'll notice that it's not there, but at the bottom the Makefile includes '''Makefile.Base'''. Looking at that file, you will find the install target. It is run with a single line that installs (carefully copies) pdftk from the current directory into /usr/local/bin. make install will work if you change /usr/local/bin to $(HOME)/bin. You may also consider installing the manpage (pdftk.1 from the main pdftk directory). cd .. cp pdftk.1 $HOME/share/man/man1 export MANPATH=$MANPATH:$HOME/share/man == Example 2 == Installing fftw (autotools) A quick search turns up the main page for [http://www.fftw.org/download.html fftw], the '''Fastest Fourier Transform in the West'''. mkdir ~/build && cd ~/build wget ftp://ftp.fftw.org/pub/fftw/fftw-3.3.4.tar.gz This is a tar (tape archive) that has been gzipped (usually given the endearing name 'tarball'). You can read the contents with tar tzf fftw-3.3.4.tar.gz | less tar xzf fftw-3.3.4.tar.gz The first command lists the contents. It is really helpful to make sure that all the files in the tarball are in their own directory. Most tarballs should be packed this way. Ones that aren't will put files in your current directory, and may clobber other files you had there before. cd fftw-3.3.4 less README The second line is absolutely critical, since almost every package has some installation quirk that you won't know about until it's too late -- or until you read the instructions, either way. You'll notice this file says configure, make, make install. This means the package uses gnu autotools! Autotools are a standard set of installation scripts that follow the general install commands above. The configure part is the most important, since it gives you a chance to put in details about your own environment. In addition to reading all install instructions, you should also run ./configure --help This will give you a list of options that tell the compile process what compilers to use and where to find libraries and include files that the package may well depend on. The standard ones (CFLAGS, etc.) are shown in the graphic at the top of this page. ./configure --with-pic --enable-float --prefix=$HOME The second part of autotools is (sometimes GNU) make, covered above. make -j4 install == Example 3 == Installing gromacs (CMAKE). The latest versions of gromacs use cmake - a new build tool created to replace autotools (configure). cmake uses two main files for its work: CMakeLists.txt CMakeCache.txt CMakeLists.txt is written by the package developers to control the build process. It typically introduces a list of required packages, calls some functions to test whether they are on the system and how to get to them (the configure process), and then lists a set of build targets. Unlike the make process, editing this file is unwise, since it mostly contains information on dependencies (which break the package if you change them). Sadly, cmake abstracts away all the good environment variables, getting rid of your ability to directly tweak the build process. Instead, you have a perplexing array of variables that can offer more control over the process. This comes at the expense of usually not knowing how or what variables need to be changed when you have a problem. Hopefully the developers left some documentation to clear up this point. Gromacs is good at this, and lets you know the major variables to change - one influencing the location of the fftw library and the other influencing whether or not to compile with MPI. To install gromacs, download and unpack the source as before. I'm working with gromacs-5.0-beta2 now, but you may find a different version when you read this. Next make sure your environment variables reference the compiler you intend to use. We have a module on rcslurm for the intel compiler, module load compilers/intel/2013sp1_cluster_xe Then generate CMakeCache.txt with the command cmake . This makes the cache file, which is the perplexing list of build variables referenced above. In a large project, running cmake . may produce CMakeCache.txt files in several sub-directories as well. find . -name CMakeCache.txt If you're unlucky, cmake will end with a version mismatch error, in which case you have to go out and get the latest version of cmake. We have a few on the rcslurm cluster, which you can load with, e.g. module load apps/cmake/2.8.12.2 There's also an interactive way to look at the most important variables used during cmake's build. It's ccmake . This will come up with a list, analogous to ./configure --help with autotools. If all goes well with the cmake process, you can proceed with the usual make process make -j8 make test make install A word of warning is in order. Gromacs is highly optimized, and uses information specific to the machine it is compiled on. Rcslurm has different hardware (amd vs intel processors) on the head node than the cluster nodes -- leading to an "Illegal instruction" error when you compile on one and run on the other. To get around this, you have to compile on a node rm -f CMakeCache.txt srun --ntasks-per-node 8 -N 1 --pty /bin/bash cmake . make -j8 make install With gromacs, you will want to compile an MPI version for the cluster and a non-mpi version for the head node (to create run-files and do simple analysis). Once you figure out the relevant cmake variables, you can save them as a build script. I've started doing this for all my builds, since it helps me keep track of what I've tried. The relevant one is here: <source lang="bash"> module load compilers/intel/2013sp1_cluster_xe mpi/openmpi/1.6.1 apps/cmake/2.8.12.2 cmake -DCMAKE_INSTALL_PREFIX=/shares/rogers \ -DFFTW_INCLUDE_DIR=/shares/rogers/include \ -DFFTW_LIBRARY=/shares/rogers/lib \ -DGMX_MPI=ON \ . make -j8 make install </source> = Fourier Transforms = Read through the page on [[HowTo:Fourier|Fourier transforms]]. = The Monte Carlo Method = * Integrals of the form: <math>\int \frac{f(x)}{g(x)} g(x) dx</math> * Computing pi * Parallelizing with MPI4Py Complicated integrals are common in the hard sciences. Most of these have analytical solutions or good approximations (see [http://mathworld.com] and the NIST Digital Library of Mathematical Functions ([http://dlmf.nist.gov/ DLMF])). Unfortunately, sometimes there is no analytical solution. The next best thing is to use quadrature. This is just summing the function computed at a specific set of points times a specific set of weights. Some background and the relevant scipy functions are [http://docs.scipy.org/doc/scipy-0.14.0/reference/generated/scipy.integrate.quad.html here]. There is also a great page of points and weights on [http://people.sc.fsu.edu/~jburkardt/datasets/quadrature_rules/quadrature_rules.html John Burkardt's page at FSU]. For integrals over high-dimensional spaces, and for those closely connected to probability distributions, the next next best thing is to use the Monte Carlo Method. This writes the integral <math>\int \frac{f(x)}{g(x)} g(x) dx</math> as <math>\int \frac{f(x)}{g(x)} g(x) dx = \lim_{N\to\infty} \frac{1}{N} \sum_i \frac{f(x_i)}{g(x_i)}</math> where the points <math>x_i</math> are generated from a probability distribution, <math>P(x_i) = g(x_i)</math> Common probability distributions are the Gaussian, <math>P(x) = (2\pi \sigma^2)^{-1/2} \exp{-\frac{(x-\mu)^2}{2\sigma^2}}</math> and the uniform distribution <math>P(x) = 1/L, x \in (0,L)</math> (among others). With that introduction, we can now approximate the value of <math>\pi</math> as the result of <math>\pi/4 = \int_0^1\int_0^1 (x^2 + y^1 < 1) \; dx\; dy </math> The function is one when the point x,y is inside the circle and zero otherwise. Physically, we are randomly tossing a point on the unit square and adding 1 to a total if it also happens to fall within the upper right quadrant of the unit circle. The code is dead simple: <source lang="python"> from numpy.random import random I = 0 for i in xrange(10000): x = random() y = random() I += x*x + y*y < 1.0 print float(I)*4e-4 </source> Numpy's random() function draws samples from the interval <math>(0,1)</math> with equal probability. Notice that it does not give pi exactly. It converges to pi in the limit of a large number of samples. Parallelizing this one is easy, since each processor can run a series of Monte Carlo trials, and the only communication between the processors is averaging the final results. If we ignore that last step for now, we can run the program in parallel without any changes just by saving it to a file, say '''calc_pi.py''' and running it with mpirun mpirun -np 8 calc_pi.py Running may require that you save that command to a sh file, sandwiched between batch queue commands and run with, e.g. '''sbatch run.sh'''. You'll notice that all 8 programs independently run all the commands. This is how MPI works - all processors run the same source program. You can get each processor to do something different by using MPI library calls. <source lang="python"> from mpi4py import MPI comm=MPI.COMM_WORLD size=comm.size rank=comm.rank # This is a unique number for each process name=MPI.Get_processor_name() if rank == 0: print "Tap dancing" elif rank == 1: print "Shopping @ store" elif rank == 2: print "Cooking roast beef" else: print "Staying home" s = comm.allreduce(rank, op=MPI.SUM) if rank == 0: print "Cumulative Node Number Sum = %d"%(s) </source> The last line calls MPI's allreduce, which combines values from all nodes and sends the result to all nodes. In this case the sum of all ranks is computed (which should be size(size-1)/2). Pairing the above script with the last one (and summing the Monte Carlo trials) gives an MPI program for estimating the value of pi. 19fbe5de51f0001d9883504e1df262ed957f3f84 334 333 2014-12-03T23:20:45Z David M. Rogers 2 /* The Monte Carlo Method */ wikitext text/x-wiki [[File:build.svg|800px]] = Installation Woes = * Python packages (ex: sympy) * GNU Autotools + make-based process (ex: FFTW) * Cmake: a developer-friendly (not user-friendly?) alternative (ex: cgal) * Non-standard makes (ex: NAMD2 and NWChem) * Tinkering with open-source * The DL on Software Licenses ** Apache, BSD, GPL, Microsoft, FDL, Creative Commons ** The open-source that isn't: Canvas The single most important idea for compiling and installing new software is to remember that the installation works for the developer's environment, and it will for you, too if your environment is setup correctly. Often times this is easier said than done. # Package Dependencies (pdftk depends on libgcj) #* and versions of those packages - this is usually the worst part # Shell variables #* PATH, CFLAGS, LDFLAGS, LD_LIBRARY_PATH # Compiler version # Machine architecture Tips: To find a package owning a file (on linux systems with rpm) rpm -qf /usr/lib64/libfftw3.so.3 To find all files associated with a package rpm -ql fftw-3.2.1-3.1.el6.x86_64 == Example 1 == Installing pdftk (developer Makefile) mkdir ~/build && cd ~/build wget https://www.pdflabs.com/tools/pdftk-the-pdf-toolkit/pdftk-2.02-src.zip Unpacking the zip file can (and often does) clobber files in your current directory, so it's always safest to unpack it in a new directory: mkdir pdftk && cd pdftk unzip ../pdftk-2.02-src.zip ls In this case, pdftk was nice enough to put all their files in a subfolder, so we can get rid of the temp directory. cd .. mv pdftk/pdftk-2.02-src . rmdir pdftk If you read the license information, you'll note that pdftk is covered by a GPL copyright. This means you have the freedom to modify and re-distribute the source (but not to change the license). The GPL is sometimes called a 'copyleft', since it is a clever hack on copyright perpetrated by Richard Stallman, the founder of the GNU project. Make is a small language that lists the shell commands required to 'make' the 'targets'. A make target can be anything, but usually is the name of an executable file (or a file at an intermediate step) that will be built during the compilation process. Pdftk has installation instructions on its website, which outline a make-based process commonly seen for development on small projects. pdftk is large-ish because the pdf file format can do a lot, but the build process is small because it is based on java. Some standard options to make are make -f Makefile.Redhat -j 8 -C $PWD install The '-j 8' flag tells make to run in parallel on 8 processors. The '-C' flag tells make what directory to run make from. Here, it's for illustration, since the default is to run in the current directory. The name 'install' is the target to build. It is not a real file, but instead just has a list of commands that copy the compiled program into the filesystem. The great thing about make is that it knows what order to make all the files in. In this instance, make will build the executable, '''pdftk''', but will not install it - since it tries to copy it into /usr/local/bin. You should read '''Makefile.Redhat''' to find the '''install''' target. You'll notice that it's not there, but at the bottom the Makefile includes '''Makefile.Base'''. Looking at that file, you will find the install target. It is run with a single line that installs (carefully copies) pdftk from the current directory into /usr/local/bin. make install will work if you change /usr/local/bin to $(HOME)/bin. You may also consider installing the manpage (pdftk.1 from the main pdftk directory). cd .. cp pdftk.1 $HOME/share/man/man1 export MANPATH=$MANPATH:$HOME/share/man == Example 2 == Installing fftw (autotools) A quick search turns up the main page for [http://www.fftw.org/download.html fftw], the '''Fastest Fourier Transform in the West'''. mkdir ~/build && cd ~/build wget ftp://ftp.fftw.org/pub/fftw/fftw-3.3.4.tar.gz This is a tar (tape archive) that has been gzipped (usually given the endearing name 'tarball'). You can read the contents with tar tzf fftw-3.3.4.tar.gz | less tar xzf fftw-3.3.4.tar.gz The first command lists the contents. It is really helpful to make sure that all the files in the tarball are in their own directory. Most tarballs should be packed this way. Ones that aren't will put files in your current directory, and may clobber other files you had there before. cd fftw-3.3.4 less README The second line is absolutely critical, since almost every package has some installation quirk that you won't know about until it's too late -- or until you read the instructions, either way. You'll notice this file says configure, make, make install. This means the package uses gnu autotools! Autotools are a standard set of installation scripts that follow the general install commands above. The configure part is the most important, since it gives you a chance to put in details about your own environment. In addition to reading all install instructions, you should also run ./configure --help This will give you a list of options that tell the compile process what compilers to use and where to find libraries and include files that the package may well depend on. The standard ones (CFLAGS, etc.) are shown in the graphic at the top of this page. ./configure --with-pic --enable-float --prefix=$HOME The second part of autotools is (sometimes GNU) make, covered above. make -j4 install == Example 3 == Installing gromacs (CMAKE). The latest versions of gromacs use cmake - a new build tool created to replace autotools (configure). cmake uses two main files for its work: CMakeLists.txt CMakeCache.txt CMakeLists.txt is written by the package developers to control the build process. It typically introduces a list of required packages, calls some functions to test whether they are on the system and how to get to them (the configure process), and then lists a set of build targets. Unlike the make process, editing this file is unwise, since it mostly contains information on dependencies (which break the package if you change them). Sadly, cmake abstracts away all the good environment variables, getting rid of your ability to directly tweak the build process. Instead, you have a perplexing array of variables that can offer more control over the process. This comes at the expense of usually not knowing how or what variables need to be changed when you have a problem. Hopefully the developers left some documentation to clear up this point. Gromacs is good at this, and lets you know the major variables to change - one influencing the location of the fftw library and the other influencing whether or not to compile with MPI. To install gromacs, download and unpack the source as before. I'm working with gromacs-5.0-beta2 now, but you may find a different version when you read this. Next make sure your environment variables reference the compiler you intend to use. We have a module on rcslurm for the intel compiler, module load compilers/intel/2013sp1_cluster_xe Then generate CMakeCache.txt with the command cmake . This makes the cache file, which is the perplexing list of build variables referenced above. In a large project, running cmake . may produce CMakeCache.txt files in several sub-directories as well. find . -name CMakeCache.txt If you're unlucky, cmake will end with a version mismatch error, in which case you have to go out and get the latest version of cmake. We have a few on the rcslurm cluster, which you can load with, e.g. module load apps/cmake/2.8.12.2 There's also an interactive way to look at the most important variables used during cmake's build. It's ccmake . This will come up with a list, analogous to ./configure --help with autotools. If all goes well with the cmake process, you can proceed with the usual make process make -j8 make test make install A word of warning is in order. Gromacs is highly optimized, and uses information specific to the machine it is compiled on. Rcslurm has different hardware (amd vs intel processors) on the head node than the cluster nodes -- leading to an "Illegal instruction" error when you compile on one and run on the other. To get around this, you have to compile on a node rm -f CMakeCache.txt srun --ntasks-per-node 8 -N 1 --pty /bin/bash cmake . make -j8 make install With gromacs, you will want to compile an MPI version for the cluster and a non-mpi version for the head node (to create run-files and do simple analysis). Once you figure out the relevant cmake variables, you can save them as a build script. I've started doing this for all my builds, since it helps me keep track of what I've tried. The relevant one is here: <source lang="bash"> module load compilers/intel/2013sp1_cluster_xe mpi/openmpi/1.6.1 apps/cmake/2.8.12.2 cmake -DCMAKE_INSTALL_PREFIX=/shares/rogers \ -DFFTW_INCLUDE_DIR=/shares/rogers/include \ -DFFTW_LIBRARY=/shares/rogers/lib \ -DGMX_MPI=ON \ . make -j8 make install </source> = Fourier Transforms = Read through the page on [[HowTo:Fourier|Fourier transforms]]. = The Monte Carlo Method = * Integrals of the form: <math>\int \frac{f(x)}{g(x)} g(x) dx</math> * Computing pi * Parallelizing with MPI4Py Complicated integrals are common in the hard sciences. Most of these have analytical solutions or good approximations (see [http://mathworld.com] and the NIST Digital Library of Mathematical Functions ([http://dlmf.nist.gov/ DLMF])). Unfortunately, sometimes there is no analytical solution. The next best thing is to use quadrature. This is just summing the function computed at a specific set of points times a specific set of weights. Some background and the relevant scipy functions are [http://docs.scipy.org/doc/scipy-0.14.0/reference/generated/scipy.integrate.quad.html here]. There is also a great page of points and weights on [http://people.sc.fsu.edu/~jburkardt/datasets/quadrature_rules/quadrature_rules.html John Burkardt's page at FSU]. For integrals over high-dimensional spaces, and for those closely connected to probability distributions, the next next best thing is to use the Monte Carlo Method. This writes the integral <math>\int f(x) dx</math> as <math>\int \frac{f(x)}{g(x)} g(x) dx = \lim_{N\to\infty} \frac{1}{N} \sum_i \frac{f(x_i)}{g(x_i)}</math> where the points <math>x_i</math> are generated from a probability distribution, <math>P(x_i) = g(x_i)</math> Common probability distributions are the Gaussian, <math>P(x) = (2\pi \sigma^2)^{-1/2} \exp{-\frac{(x-\mu)^2}{2\sigma^2}}</math> and the uniform distribution <math>P(x) = 1/L, x \in (0,L)</math> (among others). With that introduction, we can now approximate the value of <math>\pi</math> as the result of <math>\pi/4 = \int_0^1\int_0^1 (x^2 + y^1 < 1) \; dx\; dy </math> The function is one when the point x,y is inside the circle and zero otherwise. Physically, we are randomly tossing a point on the unit square and adding 1 to a total if it also happens to fall within the upper right quadrant of the unit circle. The code is dead simple: <source lang="python"> from numpy.random import random I = 0 for i in xrange(10000): x = random() y = random() I += x*x + y*y < 1.0 print float(I)*4e-4 </source> Numpy's random() function draws samples from the interval <math>(0,1)</math> with equal probability. Notice that it does not give pi exactly. It converges to pi in the limit of a large number of samples. Parallelizing this one is easy, since each processor can run a series of Monte Carlo trials, and the only communication between the processors is averaging the final results. If we ignore that last step for now, we can run the program in parallel without any changes just by saving it to a file, say '''calc_pi.py''' and running it with mpirun mpirun -np 8 calc_pi.py Running may require that you save that command to a sh file, sandwiched between batch queue commands and run with, e.g. '''sbatch run.sh'''. You'll notice that all 8 programs independently run all the commands. This is how MPI works - all processors run the same source program. You can get each processor to do something different by using MPI library calls. <source lang="python"> from mpi4py import MPI comm=MPI.COMM_WORLD size=comm.size rank=comm.rank # This is a unique number for each process name=MPI.Get_processor_name() if rank == 0: print "Tap dancing" elif rank == 1: print "Shopping @ store" elif rank == 2: print "Cooking roast beef" else: print "Staying home" s = comm.allreduce(rank, op=MPI.SUM) if rank == 0: print "Cumulative Node Number Sum = %d"%(s) </source> The last line calls MPI's allreduce, which combines values from all nodes and sends the result to all nodes. In this case the sum of all ranks is computed (which should be size(size-1)/2). Pairing the above script with the last one (and summing the Monte Carlo trials) gives an MPI program for estimating the value of pi. 28527ec5d0a68840fddbc1a912ff03a0bd50304e 335 334 2014-12-03T23:25:40Z David M. Rogers 2 /* The Monte Carlo Method */ wikitext text/x-wiki [[File:build.svg|800px]] = Installation Woes = * Python packages (ex: sympy) * GNU Autotools + make-based process (ex: FFTW) * Cmake: a developer-friendly (not user-friendly?) alternative (ex: cgal) * Non-standard makes (ex: NAMD2 and NWChem) * Tinkering with open-source * The DL on Software Licenses ** Apache, BSD, GPL, Microsoft, FDL, Creative Commons ** The open-source that isn't: Canvas The single most important idea for compiling and installing new software is to remember that the installation works for the developer's environment, and it will for you, too if your environment is setup correctly. Often times this is easier said than done. # Package Dependencies (pdftk depends on libgcj) #* and versions of those packages - this is usually the worst part # Shell variables #* PATH, CFLAGS, LDFLAGS, LD_LIBRARY_PATH # Compiler version # Machine architecture Tips: To find a package owning a file (on linux systems with rpm) rpm -qf /usr/lib64/libfftw3.so.3 To find all files associated with a package rpm -ql fftw-3.2.1-3.1.el6.x86_64 == Example 1 == Installing pdftk (developer Makefile) mkdir ~/build && cd ~/build wget https://www.pdflabs.com/tools/pdftk-the-pdf-toolkit/pdftk-2.02-src.zip Unpacking the zip file can (and often does) clobber files in your current directory, so it's always safest to unpack it in a new directory: mkdir pdftk && cd pdftk unzip ../pdftk-2.02-src.zip ls In this case, pdftk was nice enough to put all their files in a subfolder, so we can get rid of the temp directory. cd .. mv pdftk/pdftk-2.02-src . rmdir pdftk If you read the license information, you'll note that pdftk is covered by a GPL copyright. This means you have the freedom to modify and re-distribute the source (but not to change the license). The GPL is sometimes called a 'copyleft', since it is a clever hack on copyright perpetrated by Richard Stallman, the founder of the GNU project. Make is a small language that lists the shell commands required to 'make' the 'targets'. A make target can be anything, but usually is the name of an executable file (or a file at an intermediate step) that will be built during the compilation process. Pdftk has installation instructions on its website, which outline a make-based process commonly seen for development on small projects. pdftk is large-ish because the pdf file format can do a lot, but the build process is small because it is based on java. Some standard options to make are make -f Makefile.Redhat -j 8 -C $PWD install The '-j 8' flag tells make to run in parallel on 8 processors. The '-C' flag tells make what directory to run make from. Here, it's for illustration, since the default is to run in the current directory. The name 'install' is the target to build. It is not a real file, but instead just has a list of commands that copy the compiled program into the filesystem. The great thing about make is that it knows what order to make all the files in. In this instance, make will build the executable, '''pdftk''', but will not install it - since it tries to copy it into /usr/local/bin. You should read '''Makefile.Redhat''' to find the '''install''' target. You'll notice that it's not there, but at the bottom the Makefile includes '''Makefile.Base'''. Looking at that file, you will find the install target. It is run with a single line that installs (carefully copies) pdftk from the current directory into /usr/local/bin. make install will work if you change /usr/local/bin to $(HOME)/bin. You may also consider installing the manpage (pdftk.1 from the main pdftk directory). cd .. cp pdftk.1 $HOME/share/man/man1 export MANPATH=$MANPATH:$HOME/share/man == Example 2 == Installing fftw (autotools) A quick search turns up the main page for [http://www.fftw.org/download.html fftw], the '''Fastest Fourier Transform in the West'''. mkdir ~/build && cd ~/build wget ftp://ftp.fftw.org/pub/fftw/fftw-3.3.4.tar.gz This is a tar (tape archive) that has been gzipped (usually given the endearing name 'tarball'). You can read the contents with tar tzf fftw-3.3.4.tar.gz | less tar xzf fftw-3.3.4.tar.gz The first command lists the contents. It is really helpful to make sure that all the files in the tarball are in their own directory. Most tarballs should be packed this way. Ones that aren't will put files in your current directory, and may clobber other files you had there before. cd fftw-3.3.4 less README The second line is absolutely critical, since almost every package has some installation quirk that you won't know about until it's too late -- or until you read the instructions, either way. You'll notice this file says configure, make, make install. This means the package uses gnu autotools! Autotools are a standard set of installation scripts that follow the general install commands above. The configure part is the most important, since it gives you a chance to put in details about your own environment. In addition to reading all install instructions, you should also run ./configure --help This will give you a list of options that tell the compile process what compilers to use and where to find libraries and include files that the package may well depend on. The standard ones (CFLAGS, etc.) are shown in the graphic at the top of this page. ./configure --with-pic --enable-float --prefix=$HOME The second part of autotools is (sometimes GNU) make, covered above. make -j4 install == Example 3 == Installing gromacs (CMAKE). The latest versions of gromacs use cmake - a new build tool created to replace autotools (configure). cmake uses two main files for its work: CMakeLists.txt CMakeCache.txt CMakeLists.txt is written by the package developers to control the build process. It typically introduces a list of required packages, calls some functions to test whether they are on the system and how to get to them (the configure process), and then lists a set of build targets. Unlike the make process, editing this file is unwise, since it mostly contains information on dependencies (which break the package if you change them). Sadly, cmake abstracts away all the good environment variables, getting rid of your ability to directly tweak the build process. Instead, you have a perplexing array of variables that can offer more control over the process. This comes at the expense of usually not knowing how or what variables need to be changed when you have a problem. Hopefully the developers left some documentation to clear up this point. Gromacs is good at this, and lets you know the major variables to change - one influencing the location of the fftw library and the other influencing whether or not to compile with MPI. To install gromacs, download and unpack the source as before. I'm working with gromacs-5.0-beta2 now, but you may find a different version when you read this. Next make sure your environment variables reference the compiler you intend to use. We have a module on rcslurm for the intel compiler, module load compilers/intel/2013sp1_cluster_xe Then generate CMakeCache.txt with the command cmake . This makes the cache file, which is the perplexing list of build variables referenced above. In a large project, running cmake . may produce CMakeCache.txt files in several sub-directories as well. find . -name CMakeCache.txt If you're unlucky, cmake will end with a version mismatch error, in which case you have to go out and get the latest version of cmake. We have a few on the rcslurm cluster, which you can load with, e.g. module load apps/cmake/2.8.12.2 There's also an interactive way to look at the most important variables used during cmake's build. It's ccmake . This will come up with a list, analogous to ./configure --help with autotools. If all goes well with the cmake process, you can proceed with the usual make process make -j8 make test make install A word of warning is in order. Gromacs is highly optimized, and uses information specific to the machine it is compiled on. Rcslurm has different hardware (amd vs intel processors) on the head node than the cluster nodes -- leading to an "Illegal instruction" error when you compile on one and run on the other. To get around this, you have to compile on a node rm -f CMakeCache.txt srun --ntasks-per-node 8 -N 1 --pty /bin/bash cmake . make -j8 make install With gromacs, you will want to compile an MPI version for the cluster and a non-mpi version for the head node (to create run-files and do simple analysis). Once you figure out the relevant cmake variables, you can save them as a build script. I've started doing this for all my builds, since it helps me keep track of what I've tried. The relevant one is here: <source lang="bash"> module load compilers/intel/2013sp1_cluster_xe mpi/openmpi/1.6.1 apps/cmake/2.8.12.2 cmake -DCMAKE_INSTALL_PREFIX=/shares/rogers \ -DFFTW_INCLUDE_DIR=/shares/rogers/include \ -DFFTW_LIBRARY=/shares/rogers/lib \ -DGMX_MPI=ON \ . make -j8 make install </source> = Fourier Transforms = Read through the page on [[HowTo:Fourier|Fourier transforms]]. = The Monte Carlo Method = * Integrals of the form: <math>\int \frac{f(x)}{g(x)} g(x) dx</math> * Computing pi * Parallelizing with MPI4Py Complicated integrals are common in the hard sciences. Most of these have analytical solutions or good approximations (see [http://mathworld.com] and the NIST Digital Library of Mathematical Functions ([http://dlmf.nist.gov/ DLMF])). Unfortunately, sometimes there is no analytical solution. The next best thing is to use quadrature. This is just summing the function computed at a specific set of points times a specific set of weights. Some background and the relevant scipy functions are [http://docs.scipy.org/doc/scipy-0.14.0/reference/generated/scipy.integrate.quad.html here]. There is also a great page of points and weights on [http://people.sc.fsu.edu/~jburkardt/datasets/quadrature_rules/quadrature_rules.html John Burkardt's page at FSU]. For integrals over high-dimensional spaces, and for those closely connected to probability distributions, the next next best thing is to use the Monte Carlo Method. This writes the integral <math>\int f(x) dx</math> as <math>\int \frac{f(x)}{g(x)} g(x) dx = \lim_{N\to\infty} \frac{1}{N} \sum_i \frac{f(x_i)}{g(x_i)}</math> where the points <math>x_i</math> are generated from a probability distribution, <math>P(x_i) = g(x_i)</math> Common probability distributions are the Gaussian, <math>P(x) = (2\pi \sigma^2)^{-1/2} \exp{-\frac{(x-\mu)^2}{2\sigma^2}}</math> and the uniform distribution <math>P(x) = 1/L, x \in (0,L)</math> (among others). With that introduction, we can now approximate the value of <math>\pi</math> as the result of <math>\pi/4 = \int_0^1\int_0^1 (x^2 + y^1 < 1) \; dx\; dy </math> The function is one when the point x,y is inside the circle and zero otherwise. Physically, we are randomly tossing a point on the unit square and adding 1 to a total if it also happens to fall within the upper right quadrant of the unit circle. The code is dead simple: <source lang="python"> from numpy.random import random I = 0 for i in xrange(10000): x = random() y = random() I += x*x + y*y < 1.0 print float(I)*4e-4 </source> Numpy's random() function draws samples from the interval <math>(0,1)</math> with equal probability. Notice that it does not give pi exactly. It converges to pi in the limit of a large number of samples. Parallelizing this one is easy, since each processor can run a series of Monte Carlo trials, and the only communication between the processors is averaging the final results. If we ignore that last step for now, we can run the program in parallel without any changes just by saving it to a file, say '''calc_pi.py''' and running it with mpirun mpirun -np 4 `which python` calc_pi.py Running may require that you save that command to a sh file, sandwiched between batch queue commands and run with, e.g. '''sbatch run.sh'''. You'll notice that all 8 programs independently run all the commands. Although all the print commands eventually find their way back to your terminal, they don't arrive at the same time (one of the most well-known perils of parallel programming). This is how MPI works - all processors run the same source program. You can get each processor to do something different by using MPI library calls. <source lang="python"> from mpi4py import MPI comm=MPI.COMM_WORLD size=comm.size rank=comm.rank # This is a unique number for each process name=MPI.Get_processor_name() if rank == 0: print "Tap dancing" elif rank == 1: print "Shopping @ store" elif rank == 2: print "Cooking roast beef" else: print "Staying home" s = comm.allreduce(rank, op=MPI.SUM) if rank == 0: print "Cumulative Node Number Sum = %d"%(s) </source> The last line calls MPI's allreduce, which combines values from all nodes and sends the result to all nodes. In this case the sum of all ranks is computed (which should be size(size-1)/2). Pairing the above script with the last one (and summing the Monte Carlo trials) gives an MPI program for estimating the value of pi. 9ec60bc312c248cea7db43abd0c62b7e5ea7a6e2 File:Build.svg 6 69 320 2014-11-24T17:18:10Z David M. Rogers 2 wikitext text/x-wiki da39a3ee5e6b4b0d3255bfef95601890afd80709 HowTo 0 13 322 116 2014-11-26T16:40:38Z David M. Rogers 2 wikitext text/x-wiki I'm constantly finding that life is like a bunch of little projects, sandwiching a few much larger projects. Here's some free advice for the little projects. * [[HowTo:CleanUpUbuntu|Clean Up Ubuntu 12]] * [[HowTo:VirtualMachine|Build a virtual machine]] * [[HowTo:GNUOSX|Setup Mac OSX for Linux Development and GNU Programs]] * [http://flurdy.com/docs/postfix/ Setup Postfix] * [http://pllab.is.ocha.ac.jp/~asai/cw2011tutorial/ Work With Delimited Continuations] * [[HowTo:ScreenCast|ScreenCast]] * [[HowTo:AndroidPhoto|Archive Photos From the Android]] * [[HowTo:PGP|Set up a client/server protocol using TLS and GNU-PGP authentication]] * [[HowTo:Fourier|Fourier Transform in Python]] 5c64e595809e1fd3d6b5bdd598c2159c77941a68 351 322 2015-07-24T17:20:34Z David M. Rogers 2 wikitext text/x-wiki I'm constantly finding that life is like a bunch of little projects, sandwiching a few much larger projects. Here's some free advice for the little projects. * [[HowTo:CleanUpUbuntu|Clean Up Ubuntu 12]] * [[HowTo:VirtualMachine|Build a virtual machine]] * [[HowTo:GNUOSX|Setup Mac OSX for Linux Development and GNU Programs]] * [http://flurdy.com/docs/postfix/ Setup Postfix] * [http://pllab.is.ocha.ac.jp/~asai/cw2011tutorial/ Work With Delimited Continuations] * [[HowTo:ScreenCast|ScreenCast]] * [[HowTo:AndroidPhoto|Archive Photos From the Android]] * [[HowTo:PGP|Set up a client/server protocol using TLS and GNU-PGP authentication]] * [[HowTo:Fourier|Fourier Transform in Python]] * [[HowTo:Unlock|Take Control of Your Smartphone]] a921deeabb8b78df044fdd938bcc68264f6df46b HowTo:Fourier 0 70 323 2014-11-26T17:32:36Z David M. Rogers 2 Created page with "The Fourier transform is such a useful fundamental tool, it deserves its own howto (as opposed to a simple [[Code]]). The Fourier transform is a transformation of a function int…" wikitext text/x-wiki The Fourier transform is such a useful fundamental tool, it deserves its own howto (as opposed to a simple [[Code]]). The Fourier transform is a transformation of a function into another function. The transformation can (in almost all cases) be reversed. Before getting started, a few analogies are helpful. Sound comes from acoustic pressure waves -- so you hear middle C when your ear feels a time-varying pressure at precisely 261.6 Hz (1 Hz = 1 cycle per second). The pressure signal would be <math>P(t) = cos(2 \pi (261.6 t))</math> -- so that 1/261.6 second goes in a complete cycle, from 0 to <math>2\pi</math> radians. Fourier transforming that signal gives a function that is zero everywhere except for <math>k = 261.6</math> -- a delta function. The transform of a pure sin or cos wave is always a delta function -- peaked at one particular frequency. If you shift the phase of the sin or cos wave (say by <math>\Delta t</math>, this shows up in Fourier space as a phase factor, <math>\exp(2\pi i\Delta t)</math>, which does not change the magnitude. Light comes from electromagnetic waves. In parking lots, you can usually see the grungy yellow/orange color of 589.29 nm light from cheap high-pressure sodium lights. This is because your eye is experiencing a time-varying electric field at a frequency of <math>3\cdot 10^17 nm/s / 589.29 nm \simeq 510 THz</math>. 73b7ee443d7d89dd05252bf83a408563fbb8263a 324 323 2014-11-26T19:57:30Z David M. Rogers 2 wikitext text/x-wiki The Fourier transform is such a useful fundamental tool, it deserves its own howto (as opposed to a simple [[Code]]). The Fourier transform is a transformation of a function into another function. The transformation can (in almost all cases) be reversed. = Analogies = Before getting started, a few analogies are helpful. Sound comes from acoustic pressure waves -- so you hear middle C when your ear feels a time-varying pressure at precisely 261.6 Hz (1 Hz = 1 cycle per second). The pressure signal would be <math>P(t) \propto cos(2 \pi (261.6 t))</math> -- so that 1/261.6 second goes in a complete cycle, from 0 to <math>2\pi</math> radians. Fourier transforming that signal gives a function that is zero everywhere except for <math>k = 261.6</math> -- a delta function. The transform of a pure sin or cos wave is always a delta function -- peaked at one particular frequency. If you shift the phase of the sin or cos wave (say by <math>\Delta \theta = 2 \pi (261.6 \Delta t)</math>) this shows up in Fourier space as a phase factor, <math>\exp(i\Delta \theta)</math>, which does not change the magnitude. Light comes from electromagnetic waves. In parking lots, you can usually see the grungy yellow/orange color of 589.29 nm light from cheap high-pressure sodium lights. This is because your eye is experiencing a time-varying electric field at a frequency of <math>3\cdot 10^{17}</math> nm/s / 589.29 nm <math>\simeq</math> 510 THz. = Definition = The Fourier transform of <math>f(x)</math> is defined as <math> F(k) = \int_{-\infty}^\infty f(x) e^{-2\pi i k x} \; dx </math> You can immediately see why the Fourier transform of a pure wave, <math>f(x) = e^{2\pi i s x}</math>, is centered on <math>k = s</math>. All the other test frequencies, <math>k</math>, create oscillatory integrands, <math> e^{2\pi i (s - k) x} </math> so the integral always cancels, unless <math>s = k</math>, where it shoots to infinity (<math>F(k) = \delta(k-s)</math>). The Fourier transform `picks up' all these pure frequencies. You can see this by noting the transform of a bunch of pure waves, <math> g(x) = \sum_j a_j e^{2\pi i k_j x} </math> which is a sum over all the pure frequencies, <math>G(k) = \sum_j a_j \delta(k-k_j) </math> The reverse of the Fourier transform is just another Fourier transform. This time, the direction of oscillation has to change, though: <math> f(x) = \int_{-\infty}^\infty F(k) e^{2\pi i k x} \; dk </math> For visually understanding the Fourier transform, it's helpful to plot both sides of a table of transforms. We already showed that the transform of a wave is a delta function, and vice-versa. This means the transform of a constant is a delta function centered at zero. As another example, the transform of a Gaussian function is another Gaussian function. == Other Definitions == Note that there are other definitions of the Fourier transform. These are all related to the above, by scaling <math>k \to \nu/a</math>, so <math> F_a(\nu) = \int_{-\infty}^\infty f(x) e^{-\frac{2\pi}{a} i\nu x} \; dx </math> and <math> f(x) = |a^{-1}| \int_{-\infty}^\infty F_a(\nu) e^{\frac{2\pi}{a} i\nu x} \; d\nu </math> Common variations are <math>a = -1</math> and <math>a = \pm 2\pi</math>. Note that these formulas aren't applicable for imaginary <math>a</math>. If you do that, you'll end up translating the Fourier theory into its equivalent -- analytic continuations of Laplace transforms and their inverse via Bromwich contours. = Discrete Version = The discrete Fourier transform is one limit of the continuous one, where the integral is replaced by the sum. Before introducing this, however, it's helpful to introduce the Fourier transform on a circle. <math> F_L(k) = \int_0^L f(x) e^{-2\pi i k x / L} \; dx </math> The integral runs over 0 to L, at which point the function is considered to be periodic -- i.e. <math>f(0) = f(L)</math>. This definition is consistent with the `other definitions' above, for <math>a = L</math>. Now, because the function is periodic, the test functions should be also. This means we only need to collect the values of <math>F_L(k)</math> at integer values of <math>k = n = 0, \pm 1, \ldots</math> -- those for which the test functions are periodic. Conversely, given a finite set of frequency values, we can make good approximations of the function using the inverse Fourier transform, <math> f(x) \simeq \sum_{n=-M/2}^{M/2} a_n e^{2\pi i n x / L} </math> Now we have a computational way to represent the Fourier transform -- a set of coefficients, <math>\{a_n\}_{-M/2}^{M/2}</math>. Each coefficient belongs to a basis function -- called a `plane-wave' basis in physics because of its oscillation as <math>x</math> varies along the direction of travel of the wave. To complete the picture, let's introduce a set of <math>M</math> equally spaced sampling points, <math>x_m/L = m / M</math>. The inverse Fourier transform at these points is then a polynomial, <math>f(x_m) \simeq \sum_{n=0}^{M} a_n \omega^{nm} </math> where <math>\omega = e^{2\pi i/M}</math>. Moreover, given the set <math>f(x_m) = b_m</math>, the inverse of the inverse is <math>a_n \simeq \frac{1}{M}\sum_{m=0}^{M} b_m \omega^{-nm} </math> These last two are the discrete Fourier transform. They are polynomials in the <math>M^{th}</math> roots of unity, <math>\omega</math>. = Efficient DFT = There are efficient ways of computing the discrete Fourier transform. They derive from noting that <math>\omega^{n+M/2} = \omega^{-n}</math> (for even <math>M</math>). 95b9a2172fea8be5ab3508bbf7a351b15991d55a 325 324 2014-11-26T19:58:16Z David M. Rogers 2 /* Discrete Version */ wikitext text/x-wiki The Fourier transform is such a useful fundamental tool, it deserves its own howto (as opposed to a simple [[Code]]). The Fourier transform is a transformation of a function into another function. The transformation can (in almost all cases) be reversed. = Analogies = Before getting started, a few analogies are helpful. Sound comes from acoustic pressure waves -- so you hear middle C when your ear feels a time-varying pressure at precisely 261.6 Hz (1 Hz = 1 cycle per second). The pressure signal would be <math>P(t) \propto cos(2 \pi (261.6 t))</math> -- so that 1/261.6 second goes in a complete cycle, from 0 to <math>2\pi</math> radians. Fourier transforming that signal gives a function that is zero everywhere except for <math>k = 261.6</math> -- a delta function. The transform of a pure sin or cos wave is always a delta function -- peaked at one particular frequency. If you shift the phase of the sin or cos wave (say by <math>\Delta \theta = 2 \pi (261.6 \Delta t)</math>) this shows up in Fourier space as a phase factor, <math>\exp(i\Delta \theta)</math>, which does not change the magnitude. Light comes from electromagnetic waves. In parking lots, you can usually see the grungy yellow/orange color of 589.29 nm light from cheap high-pressure sodium lights. This is because your eye is experiencing a time-varying electric field at a frequency of <math>3\cdot 10^{17}</math> nm/s / 589.29 nm <math>\simeq</math> 510 THz. = Definition = The Fourier transform of <math>f(x)</math> is defined as <math> F(k) = \int_{-\infty}^\infty f(x) e^{-2\pi i k x} \; dx </math> You can immediately see why the Fourier transform of a pure wave, <math>f(x) = e^{2\pi i s x}</math>, is centered on <math>k = s</math>. All the other test frequencies, <math>k</math>, create oscillatory integrands, <math> e^{2\pi i (s - k) x} </math> so the integral always cancels, unless <math>s = k</math>, where it shoots to infinity (<math>F(k) = \delta(k-s)</math>). The Fourier transform `picks up' all these pure frequencies. You can see this by noting the transform of a bunch of pure waves, <math> g(x) = \sum_j a_j e^{2\pi i k_j x} </math> which is a sum over all the pure frequencies, <math>G(k) = \sum_j a_j \delta(k-k_j) </math> The reverse of the Fourier transform is just another Fourier transform. This time, the direction of oscillation has to change, though: <math> f(x) = \int_{-\infty}^\infty F(k) e^{2\pi i k x} \; dk </math> For visually understanding the Fourier transform, it's helpful to plot both sides of a table of transforms. We already showed that the transform of a wave is a delta function, and vice-versa. This means the transform of a constant is a delta function centered at zero. As another example, the transform of a Gaussian function is another Gaussian function. == Other Definitions == Note that there are other definitions of the Fourier transform. These are all related to the above, by scaling <math>k \to \nu/a</math>, so <math> F_a(\nu) = \int_{-\infty}^\infty f(x) e^{-\frac{2\pi}{a} i\nu x} \; dx </math> and <math> f(x) = |a^{-1}| \int_{-\infty}^\infty F_a(\nu) e^{\frac{2\pi}{a} i\nu x} \; d\nu </math> Common variations are <math>a = -1</math> and <math>a = \pm 2\pi</math>. Note that these formulas aren't applicable for imaginary <math>a</math>. If you do that, you'll end up translating the Fourier theory into its equivalent -- analytic continuations of Laplace transforms and their inverse via Bromwich contours. = Discrete Version = The discrete Fourier transform is one limit of the continuous one, where the integral is replaced by the sum. Before introducing this, however, it's helpful to introduce the Fourier transform on a circle. <math> F_L(k) = \int_0^L f(x) e^{-2\pi i k x / L} \; dx </math> The integral runs over 0 to L, at which point the function is considered to be periodic -- i.e. <math>f(0) = f(L)</math>. This definition is consistent with the `other definitions' above, for <math>a = L</math>. Now, because the function is periodic, the test functions should be also. This means we only need to collect the values of <math>F_L(k)</math> at integer values of <math>k = n = 0, \pm 1, \ldots</math> -- those for which the test functions are periodic. Conversely, given a finite set of frequency values, we can make good approximations of the function using the inverse Fourier transform, <math> f(x) \simeq \sum_{n=-M/2}^{M/2} a_n e^{2\pi i n x / L} </math> Now we have a computational way to represent the Fourier transform -- a set of coefficients, <math>\{a_n\}_{-M/2}^{M/2}</math>. Each coefficient belongs to a basis function -- called a `plane-wave' basis in physics because of its oscillation as <math>x</math> varies along the direction of travel of the wave. To complete the picture, let's introduce a set of <math>M</math> equally spaced sampling points, <math>x_m/L = m / M</math>. The inverse Fourier transform at these points is then a polynomial, <math>f(x_m) \simeq \sum_{n=0}^{M} a_n \omega^{nm} </math> where <math>\omega = e^{2\pi i/M}</math>. Moreover, given the set <math>f(x_m) = b_m</math>, the inverse of the inverse is <math>a_n = \frac{1}{M}\sum_{m=0}^{M} b_m \omega^{-nm} </math> These last two are the discrete Fourier transform. They are polynomials in the <math>M^{th}</math> roots of unity, <math>\omega</math>. = Efficient DFT = There are efficient ways of computing the discrete Fourier transform. They derive from noting that <math>\omega^{n+M/2} = \omega^{-n}</math> (for even <math>M</math>). 240a6eace46665243f44ad9f22c9d83e0c1fa697 326 325 2014-11-26T20:41:51Z David M. Rogers 2 wikitext text/x-wiki The Fourier transform is such a useful fundamental tool, it deserves its own howto (as opposed to a simple [[Code]]). The Fourier transform is a transformation of a function into another function. The transformation can (in almost all cases) be reversed. = Analogies = Before getting started, a few analogies are helpful. Sound comes from acoustic pressure waves -- so you hear middle C when your ear feels a time-varying pressure at precisely 261.6 Hz (1 Hz = 1 cycle per second). The pressure signal would be <math>P(t) \propto cos(2 \pi (261.6 t))</math> -- so that 1/261.6 second goes in a complete cycle, from 0 to <math>2\pi</math> radians. Fourier transforming that signal gives a function that is zero everywhere except for <math>k = 261.6</math> -- a delta function. The transform of a pure sin or cos wave is always a delta function -- peaked at one particular frequency. If you shift the phase of the sin or cos wave (say by <math>\Delta \theta = 2 \pi (261.6 \Delta t)</math>) this shows up in Fourier space as a phase factor, <math>\exp(i\Delta \theta)</math>, which does not change the magnitude. Light comes from electromagnetic waves. In parking lots, you can usually see the grungy yellow/orange color of 589.29 nm light from cheap high-pressure sodium lights. This is because your eye is experiencing a time-varying electric field at a frequency of <math>3\cdot 10^{17}</math> nm/s / 589.29 nm <math>\simeq</math> 510 THz. = Definition = The Fourier transform of <math>f(x)</math> is defined as <math> F(k) = \int_{-\infty}^\infty f(x) e^{-2\pi i k x} \; dx </math> You can immediately see why the Fourier transform of a pure wave, <math>f(x) = e^{2\pi i s x}</math>, is centered on <math>k = s</math>. All the other test frequencies, <math>k</math>, create oscillatory integrands, <math> e^{2\pi i (s - k) x} </math> so the integral always cancels, unless <math>s = k</math>, where it shoots to infinity (<math>F(k) = \delta(k-s)</math>). The Fourier transform `picks up' all these pure frequencies. You can see this by noting the transform of a bunch of pure waves, <math> g(x) = \sum_j a_j e^{2\pi i k_j x} </math> which is a sum over all the pure frequencies, <math>G(k) = \sum_j a_j \delta(k-k_j) </math> The reverse of the Fourier transform is just another Fourier transform. This time, the direction of oscillation has to change, though: <math> f(x) = \int_{-\infty}^\infty F(k) e^{2\pi i k x} \; dk </math> For visually understanding the Fourier transform, it's helpful to plot both sides of a table of transforms. We already showed that the transform of a wave is a delta function, and vice-versa. This means the transform of a constant is a delta function centered at zero. As another example, the transform of a Gaussian function is another Gaussian function. == Other Definitions == Note that there are other definitions of the Fourier transform. These are all related to the above, by scaling <math>k \to \nu/a</math>, so <math> F_a(\nu) = \int_{-\infty}^\infty f(x) e^{-\frac{2\pi}{a} i\nu x} \; dx </math> and <math> f(x) = |a^{-1}| \int_{-\infty}^\infty F_a(\nu) e^{\frac{2\pi}{a} i\nu x} \; d\nu </math> Common variations are <math>a = -1</math> and <math>a = \pm 2\pi</math>. Note that these formulas aren't applicable for imaginary <math>a</math>. If you do that, you'll end up translating the Fourier theory into its equivalent -- analytic continuations of Laplace transforms and their inverse via Bromwich contours. = Discrete Version = The discrete Fourier transform is one limit of the continuous one, where the integral is replaced by the sum. Before introducing this, however, it's helpful to introduce the Fourier transform on a circle. <math> F_L(k) = \int_0^L f(x) e^{-2\pi i k x / L} \; dx </math> The integral runs over 0 to L, at which point the function is considered to be periodic -- i.e. <math>f(0) = f(L)</math>. This definition is consistent with the `other definitions' above, for <math>a = L</math>. Now, because the function is periodic, the test functions should be also. This means we only need to collect the values of <math>F_L(k)</math> at integer values of <math>k = n = 0, \pm 1, \ldots</math> -- those for which the test functions are periodic. Conversely, given a finite set of frequency values, we can make good approximations of the function using the inverse Fourier transform, <math> f(x) \simeq \sum_{n=-M/2}^{M/2} a_n e^{2\pi i n x / L} </math> Now we have a computational way to represent the Fourier transform -- a set of coefficients, <math>\{a_n\}_{-M/2}^{M/2}</math>. Each coefficient belongs to a basis function -- called a `plane-wave' basis in physics because of its oscillation as <math>x</math> varies along the direction of travel of the wave. To complete the picture, let's introduce a set of <math>M</math> equally spaced sampling points, <math>x_m/L = m / M</math>. The inverse Fourier transform at these points is then a polynomial, <math>f(x_m) \simeq \sum_{n=0}^{M-1} a_n \omega^{nm} </math> where <math>\omega = e^{2\pi i/M}</math>. Moreover, given the set <math>f(x_m) = b_m</math>, the inverse of the inverse is <math>a_n = \frac{1}{M}\sum_{m=0}^{M-1} b_m \omega^{-nm} </math> These last two are the discrete Fourier transform. They are polynomials in the <math>M^{th}</math> roots of unity, <math>\omega</math>. For one last caveat, note that the scaling by <math>1/M</math> is not done at all in the fftw library, whereas it is done on the ''reverse'' transform in the numpy library (fft.ifft). = Efficient DFT = There are efficient ways of computing the discrete Fourier transform. They derive from noting that <math>\omega^{n+M/2} = \omega^{-n}</math> (for even <math>M</math>). = Wiener–Khinchin Theorem = Remember that shifting a function <math>f(x) \to f(x-y)</math> in real space translates to multiplying by a phase factor in Fourier space? This makes it really easy to compute integrals of the form: <math>(f*g)(x) = \int_0^L f(x-y) g(y) \; dy </math> in Fourier space. They are called convolutions, and represent for example, the correlation between <math>f</math> and <math>g</math> at 2 points separated by the distance <math>x</math>, or the probability distribution of the sum of 2 numbers -- one drawn from <math>f</math> and the other from <math>g</math>, or the matrix multiplication between Circulant matrices. The first interpretation leads to the Wiener–Khinchin Theorem, which states that the power spectrum (in Fourier space) is the transform of the autocorrelation function (in real space). Computing the convolution at points <math>x_M</math> looks at first like it will take <math>O(M^2)</math> time, since the integral becomes a discrete dot product and we have <math>M</math> of them to compute. For 3D data, this is prohibitively expensive. In Fourier-land, the convolution is a direct product, and takes only <math>M</math> operations! We'll derive it in the discrete case by Fourier transforming the result, <math>f*g</math>, <math>FG(n) = \frac{1}{M}\sum_{m=0}^{M-1}\sum_{j=0}^{M-1} f(x_{m-j})g(x_j) \omega^{-nm} </math> Since <math>f</math> is periodic, we can shift <math>m \to m+j</math> and the sum still runs over <math>m=-j,\ldots,M-j-1</math>, which is the same as <math>0,\ldots,M-1</math>. <math>FG(n) = \frac{1}{M}\sum_{m=0}^{M-1}\sum_{j=0}^{M-1} f(x_m)g(x_j) \omega^{-nm}\omega^{-nj} = M F(n) G(n) </math> Because the product takes <math>M</math> operations, the Fourier transformations of <math>f,g,FG</math> are the time-limiting steps in this process. Nevertheless, we've reduced <math>M^2</math> operations to <math>M + 3 M \log M</math> operations. Notice how the starting formula looks a lot like matrix multiplication with <math>f_{mj} = f(x_m-x_j)</math>? This type of matrix multiplication is one of the major computational uses of the Fourier transform. = FFT-ing with Numpy = Finally, some code. You can verify the particular definition of the DFT used by numpy by, what else, Fourier transforming a delta function: <source lang="python"> from numpy import * x = zeros(16) x[1] = 1.0 y = fft.fft(x) print y print exp(-2j*pi/16.0) # omega print exp(-2j*pi*arange(16)/16.0) </source> You should also double-check that the inverse, '''fft.ifft''', works as advertised. Note that this means it must divide by <math>M=16</math> here. Now for some thought-provoking questions: # What is the special significance of the zero-frequency component, '''y[0]'''? # What is the relationship between the transform at frequencies <math>k</math> and <math>M-k</math>? ## How does this relationship depend on functions that are real vs. contain some imaginary numbers? # What special property does the transform have if the function is even (<math>f(x) = f(L-x)</math>)? ## Construct an even function numerically and test this out. ## ... if the function is odd (<math>f(x) = -f(L-x)</math>)? # Why does it make sense to look at the magnitude ('''y.real**2+y.imag**2''') and the phase ('''arctan2(y.imag,y.real)''') of the Fourier transform separately? efa611b56257953337bbfa69ff64f4efdbe7c76f Courses 0 16 328 208 2014-11-26T20:43:22Z David M. Rogers 2 /* Tutorials */ wikitext text/x-wiki Here's a list of courses with useful online materials: == Courses == * [[GradQuantumFall2013| USF Graduate Quantum Mechanics I]] * [[GradQuantumSpring2014| USF Graduate Quantum Mechanics II]] * [[CompSciFall2014|Introduction to Scientific Computing]] * [http://lambda-the-ultimate.org/classic/Courses.html Functional Programming] == Lecture Series == * [http://www.esqc.org/lectures European Summer School in Quantum Chemistry] == Tutorials == * [[HowTo:Fourier|Fourier transforms]] * [http://www.mathematica-journal.com/2012/02/evaluation-of-gaussian-molecular-integrals Evaluating Matrix Elements] * [http://www.haskell.org/tutorial/ Haskell] * [http://monads.haskell.cz/html/index.html Monads] * [http://www.yosefk.com/blog/my-history-with-forth-stack-machines.html The Forth Language] == Reference Material == * [http://dft.sandia.gov/Quest/DFT_codes.html List of DFT Codes] * [http://docs.python.org/3/tutorial/ Python Tutorial] * [http://www.nwchem-sw.org/index.php/Release62:NWChem_Documentation NWChem Documentation] * [http://www.ebi.ac.uk/pdbe-srv/pdbechem/ PDB Ligand Structures] 892735be686f798666be5da0a5b3c657a06b5cbf Code 0 18 336 308 2015-02-23T15:30:21Z David M. Rogers 2 wikitext text/x-wiki == Tutorials == When learning a new language, once you've memorized the words, you need to start conversing. Unfortunately, source code is not spoken. It's a stillborn language. One of the best ways to code well is to study and modify other, good code. For code, this means reading and tweaking tutorials first, then design patterns, then large-scale projects next. * [http://matt.might.net/articles/bash-by-example Bash By Example] * [http://docs.python.org/3/tutorial/datastructures.html Data Structures in Python] * [http://www.u.arizona.edu/~erdmann/mse350/topics/basic_linear_algebra.html Linear Algebra in Numpy] * [[Code:gmxliquid|Liquid Structure With Gromacs]] Remember that it's not enough to just read them. It's actually a positive waste of time. Rather, you have to do some run-tweak-run-debug development cycles with them. == Publication-related Code == * [[Code:realpole]] Real-space quadrature implementation of multipole electrostatics. == C Libraries == With the exception of the standard libraries and the [http://www.gnu.org/software/gsl/ GNU Scientific Library], there are surprisingly few of these about. Here are some generics that we've implemented and are sharing under the GPL. Robust map and red/black tree code has recently been published to [https://github.com/frobnitzem?tab=repositories github]. == Python Libraries == * [[Code:libnwchem|libnwchem]] A patch against Nwchem 6.5 to build its functionality as a shared library, along with glue code for access using python ctypes. * [[Code:networkx|Networkx]] a quick guide. === Geometric Algebra === The [http://www.predictivestatmech.org/code/galg.py Multivector] class implements geometric algebra using Python's operator overloading. It works with minimal space for any number of spatial dimensions, since it's not based on the matrix / spinor representation of Clifford algebra. Instead, it takes the basis blade approach recommended by Dorst, Fondijne, and Mann [http://www.geometricalgebra.net]. It's really just as easy as ordering all the basis vectors, and keeping track of the commutator (+/- <math>\hat 1</math>). == Templates == The real world has forms, computation has templates. Pick one up, fill in the blanks, and send it down the chute. * [[NWChem|NWChem Jobs]] * [[Code:SLURM|Slurm (USF Circe)]] * [[Code:SGE|SGE (USF Circe)]] * [[Code:text2pdf|Text conversion using text2pdf]] == Efficiencies == To chop a tree quickly, spend twice the time sharpening your axe. * [[Vimrc|vimrc files]] == Code Humor == Put this into your makefile: <source lang=bash> Clint\ Eastwood: myday echo "I feel great!" </source> cabf502f677a23b6a15bab4727a164ad6800cec4 344 336 2015-06-18T13:38:38Z David M. Rogers 2 wikitext text/x-wiki This page contains a list of codes we've found useful for scientific HPC from a developer's perspective. To use existing codes, check out [[Best Practices]]. == Tutorials == When learning a new language, once you've memorized the words, you need to start conversing. Unfortunately, source code is not spoken. It's a stillborn language. One of the best ways to code well is to study and modify other, good code. For code, this means reading and tweaking tutorials first, then design patterns, then large-scale projects next. * [http://matt.might.net/articles/bash-by-example Bash By Example] * [http://docs.python.org/3/tutorial/datastructures.html Data Structures in Python] * [http://www.u.arizona.edu/~erdmann/mse350/topics/basic_linear_algebra.html Linear Algebra in Numpy] * [[Code:gmxliquid|Liquid Structure With Gromacs]] Remember that it's not enough to just read them. It's actually a positive waste of time. Rather, you have to do some run-tweak-run-debug development cycles with them. == Publication-related Code == * [[Code:realpole]] Real-space quadrature implementation of multipole electrostatics. == C Libraries == With the exception of the standard libraries and the [http://www.gnu.org/software/gsl/ GNU Scientific Library], there are surprisingly few of these about. Here are some generics that we've implemented and are sharing under the GPL. Robust map and red/black tree code has recently been published to [https://github.com/frobnitzem?tab=repositories github]. == Python Libraries == * [[Code:libnwchem|libnwchem]] A patch against Nwchem 6.5 to build its functionality as a shared library, along with glue code for access using python ctypes. * [[Code:networkx|Networkx]] a quick guide. === Geometric Algebra === The [http://www.predictivestatmech.org/code/galg.py Multivector] class implements geometric algebra using Python's operator overloading. It works with minimal space for any number of spatial dimensions, since it's not based on the matrix / spinor representation of Clifford algebra. Instead, it takes the basis blade approach recommended by Dorst, Fondijne, and Mann [http://www.geometricalgebra.net]. It's really just as easy as ordering all the basis vectors, and keeping track of the commutator (+/- <math>\hat 1</math>). == Templates == The real world has forms, computation has templates. Pick one up, fill in the blanks, and send it down the chute. * [[NWChem|NWChem Jobs]] * [[Code:SLURM|Slurm (USF Circe)]] * [[Code:SGE|SGE (USF Circe)]] * [[Code:text2pdf|Text conversion using text2pdf]] == Efficiencies == To chop a tree quickly, spend twice the time sharpening your axe. * [[Vimrc|vimrc files]] == Code Humor == Put this into your makefile: <source lang=bash> Clint\ Eastwood: myday echo "I feel great!" </source> 0d7737996d78dc1f9326b6ece7692bb74fe6102b Code:realpole 0 71 337 2015-02-23T18:16:03Z David M. Rogers 2 Created page with "This page contains code related to the JCP article, "Real-space quadrature: A convenient, efficient representation for multipole expansions" To use the code, you will also need …" wikitext text/x-wiki This page contains code related to the JCP article, "Real-space quadrature: A convenient, efficient representation for multipole expansions" To use the code, you will also need a set of spherical quadrature rules. These were originally from [http://people.sc.fsu.edu/~jburkardt/data/data.html], but are included in the package below for ease of use. The code can all be downloaded from [https://github.com/frobnitzem/realpole]: git clone https://github.com/frobnitzem/realpole It contains several python modules: == integral.py == Integral.py defines the Lebedev class, instantiated by providing a polynomial order, e.g. <source lang="python"> L = Lebedev(11) </source> it holds quadrature points and weights for polynomials up to (and including) the degree specified. Note that all odd polynomials integrate to zero, so Lebedev(10) = Lebedev(11). The class can integrate a function of a vector by evaluating the function and summing. L.integrate(lambda x: x[0]*x[0]) will numerically integrate <math>x^2</math> over the sphere. Note that this class needs the quadrature rules in the '''rules/''' subdirectory. Here is its rule loading code: <source lang="python"> cwd = os.path.dirname(os.path.abspath(__file__)) def read_rule(K): r = read_matrix("%s/rules/lebedev_%03d.txt"%(cwd,K)) </source> Integral also contains the '''e2poly''' function, which generates Legendre polynomials. === Tests === The test() function in Integral.py runs through the set of all monomials and tests the numerical against the analytical integral. Be sure to use this if you change the quadrature rules. == Poisson.py == The module Poisson.py provides the Poisson class, responsible for working with moment expansions. Notice that its first task is to load up the quadrature rules for polynomials up to order 2*(K-1)+1: <source lang="python"> self.L = Lebedev(2*(K-1)+1) </source> This is because it represents simultaneously all spherical harmonics of order 0, 1, ..., K-1. Integrating products therefore requires rules capable of integrating twice the order of the highest polynomial. The +1 is because all the rules are odd. At the heart of this class is the moment-generating method, <source lang="python"> # Calculate the polynomials in series: # sum_k q_k L_n(x_k, x_i) [d=1] # sum_k q_k L_n(x_i, x_k) [d=-1] def mom(self, q, x, d=1): # Hi Mom! if d == -1: for P in e2poly(self.L.x, x, self.K, -1): yield dot(P, q) else: for P in e2poly(x, self.L.x, self.K, -1): yield dot(q, P) </source> This is used to find the effective surface charges (weights) in the high-level interface, <source lang="python"> # If d = 1 (forward), # return {w} such that sum q_a*L_n(x_a,y) = sum w_i*L_n(x_i,y) # for all K moments L_0, ..., L_{K-1} # # If d = -1 (reverse), # return {w} such that sum q_a*L_n(x,y_a) = sum w_i*L_n(x,y_i) # for all K moments L_0, ..., L_{K-1} # # -- scales as O(K * len(x) * N) def solve_moments(self, q,x,R,d=1): </source> The code also contains ishift and oshift functions implementing the inner and outer shift operations. See the function description (and usage in mom_t.py) for their documentation. === Tests === The function test(R) will generate a random distribution of point charges and run the following tests: * '''rep_err''' Check that the moment fitting problem was solved by comparing quadrature-fitted vs. exact moments. This test should give a numerical zero. * '''pot_err''' Check the error of representing point charges by their quadrature representation. This test should give decreasing error as the expansion order increases. * '''outer_shift''' Check the error of the outer -> outer shift operation. * '''inner_shift''' Check the error of the inner -> inner shift operation. * '''io_shift''' Check the error of the outer -> inner shift operation. These last three tests should give error that decreases as the expansion order increases. The files '''mom.py''' and '''mom_t.py''' were used to generate the error plots (Figures 2 and 3) in the paper. These are just expanded versions of the tests above. == fmm.py == This is a very basic implementation of the fast multipole method (not used in the paper). It needs some reorganization to make it simpler to experiment with options that tune the error and scaling. At this point, the testing is preliminary and has an error dominated by the size of the interaction list. I would welcome code contributions or suggestions for integrating with PyFMM here! 61b8d0f7f3b0c309a15fadcfeef726f109481ff3 Predictive Chemistry:Current events 4 10 338 290 2015-03-07T16:08:39Z David M. Rogers 2 wikitext text/x-wiki * Wednesday, Mar. 4, 2015: David M. Rogers presented "[http://meetings.aps.org/Meeting/MAR15/Session/M44.9 Thermodynamics of Maximum Transition Entropy for Quantum Assemblies]." at the APS March Meeting in San Antonio, TX. * Saturday, Nov. 22 2014: USF and neighboring universities are hosting a [http://predictivestatmech.org/papers/MRI-flyer.pdf Scientific Computing Workshop] for undergraduates. Follow the instructions in the flyer to sign up by Nov. 11! * Thursday, Oct. 16: David M. Rogers presented "[http://predictivestatmech.org/papers/real-poles.pdf Real-space quadrature: A convenient, universal representation for multipole expansions]." at the Southeast Regional Meeting of the ACS in Nashville, TN. * Friday, Aug. 29 2014: Felipe Zapata joins the group! * Monday, Aug. 25 2014: USF Autumn Semester First Day of Classes - don't forget to sign up for [[CompSciFall2014|Introduction to Scientific Computing]]! * Monday, Aug. 18 2014: David M. Rogers presented an invited talk "pH Dynamics During Concentration Polarization," to the [http://www.pnnl.gov/computing/cm4/ CM4 Mathematics for Mesoscopic Materials Modeling Group]. * Tuesday, July 8 2014: David M. Rogers presented "What’s Holding Up Multiscale modeling?" at the Telluride, CO workshop for [http://www.telluridescience.org/meetings/workshop-details?wid=404 Ions in Aqueous Solutions and Molecular Biology]. * Friday, May 9 2014: David M. Rogers presented "Jumping from atomistic to continuum simulation of electrochemical driving at interfaces," at the 2014 Florida FAME Conference.[http://www.fame.chem.ufl.edu/computational.html] * January 29th, 2014: David M. Rogers presented "Simulating at the molecular / continuum interface," at the USF Research Computing User's Group Forum [http://www.usf.edu/it/research-computing/featured-researchers/rogersgroup.aspx]. * Monday, Aug. 26 2013: USF Autumn Semester First Day of Classes * Friday, July 12, 2013: Argonne Center for Nanoscale Materials [http://nano.anl.gov/users/call_for_proposals.html Proposal Deadline] * Thursday, July 4, 2013: Independence Day - celebrate by supporting [https://www.eff.org/ EFF] * Thursday, April 11 2013: David M. Rogers presented "Solute Partitioning and Transport through Natural and Biomimetic Membranes," at the 2013 ACS National Meeting. == Calendars == * [http://www.registrar.usf.edu/enroll/regist/calendt.php USF Calendar] 61fdc23ab5ea6b137090c1ddbb24f075d24c6aec 348 338 2015-07-13T18:47:41Z David M. Rogers 2 wikitext text/x-wiki * July 27-30, 2015 Travel to DOE Comp. Sci. Graduate Fellowship Program Review in Arlington, VA. * Wednesday, May 13, 2015: David M. Rogers presented "Spatiotemporal Concentration-Polarization Induced pH Changes at Ion-Selective Membranes." at the [https://www.cbdstconference.com/agenda Chemical and Biological Defense Sci. & Tech. conference] in St. Louis, MO. * Friday, May 8, 2015: David M. Rogers presented "Where do Quanta Come From?" at the Florida ACS Meeting and Exhibition ([http://fame2015.fl-acs.org/ataglance.html FAME]). * Wednesday, Mar. 4, 2015: David M. Rogers presented "[http://meetings.aps.org/Meeting/MAR15/Session/M44.9 Thermodynamics of Maximum Transition Entropy for Quantum Assemblies]." at the APS March Meeting in San Antonio, TX. * Saturday, Nov. 22 2014: USF and neighboring universities are hosting a [http://predictivestatmech.org/papers/MRI-flyer.pdf Scientific Computing Workshop] for undergraduates. Follow the instructions in the flyer to sign up by Nov. 11! * Thursday, Oct. 16: David M. Rogers presented "[http://predictivestatmech.org/papers/real-poles.pdf Real-space quadrature: A convenient, universal representation for multipole expansions]." at the Southeast Regional Meeting of the ACS in Nashville, TN. * Friday, Aug. 29 2014: Felipe Zapata joins the group! * Monday, Aug. 25 2014: USF Autumn Semester First Day of Classes - don't forget to sign up for [[CompSciFall2014|Introduction to Scientific Computing]]! * Monday, Aug. 18 2014: David M. Rogers presented an invited talk "pH Dynamics During Concentration Polarization," to the [http://www.pnnl.gov/computing/cm4/ CM4 Mathematics for Mesoscopic Materials Modeling Group]. * Tuesday, July 8 2014: David M. Rogers presented "What’s Holding Up Multiscale modeling?" at the Telluride, CO workshop for [http://www.telluridescience.org/meetings/workshop-details?wid=404 Ions in Aqueous Solutions and Molecular Biology]. * Friday, May 9 2014: David M. Rogers presented "Jumping from atomistic to continuum simulation of electrochemical driving at interfaces," at the 2014 Florida FAME Conference.[http://www.fame.chem.ufl.edu/computational.html] * January 29th, 2014: David M. Rogers presented "Simulating at the molecular / continuum interface," at the USF Research Computing User's Group Forum [http://www.usf.edu/it/research-computing/featured-researchers/rogersgroup.aspx]. * Monday, Aug. 26 2013: USF Autumn Semester First Day of Classes * Friday, July 12, 2013: Argonne Center for Nanoscale Materials [http://nano.anl.gov/users/call_for_proposals.html Proposal Deadline] * Thursday, July 4, 2013: Independence Day - celebrate by supporting [https://www.eff.org/ EFF] * Thursday, April 11 2013: David M. Rogers presented "Solute Partitioning and Transport through Natural and Biomimetic Membranes," at the 2013 ACS National Meeting. == Calendars == * [http://www.registrar.usf.edu/enroll/regist/calendt.php USF Calendar] 28784864e41814502c3e1d3732cc5108d9e19aa4 349 348 2015-07-13T18:51:33Z David M. Rogers 2 wikitext text/x-wiki * July 27-30, 2015 Travel to DOE Comp. Sci. Graduate Fellowship Program Review in Arlington, VA. * June, 2015: JCTC Publishes our [http://pubs.acs.org/doi/abs/10.1021/acs.jctc.5b00357 article] on "Dispersion- and Exchange-Corrected Density Functional Theory for Sodium Ion Hydration" * Wednesday, May 13, 2015: David M. Rogers presented "Spatiotemporal Concentration-Polarization Induced pH Changes at Ion-Selective Membranes." at the [https://www.cbdstconference.com/agenda Chemical and Biological Defense Sci. & Tech. conference] in St. Louis, MO. * Friday, May 8, 2015: David M. Rogers presented "Where do Quanta Come From?" at the Florida ACS Meeting and Exhibition ([http://fame2015.fl-acs.org/ataglance.html FAME]). * April, 2015: [http://scitation.aip.org/content/aip/journal/jcp/142/7/10.1063/1.4907404 Real-Space Quadrature paper] was published as a cover article by JCP. * Wednesday, Mar. 4, 2015: David M. Rogers presented "[http://meetings.aps.org/Meeting/MAR15/Session/M44.9 Thermodynamics of Maximum Transition Entropy for Quantum Assemblies]." at the APS March Meeting in San Antonio, TX. * Saturday, Nov. 22 2014: USF and neighboring universities are hosting a [http://predictivestatmech.org/papers/MRI-flyer.pdf Scientific Computing Workshop] for undergraduates. Follow the instructions in the flyer to sign up by Nov. 11! * Thursday, Oct. 16: David M. Rogers presented "[http://predictivestatmech.org/papers/real-poles.pdf Real-space quadrature: A convenient, universal representation for multipole expansions]." at the Southeast Regional Meeting of the ACS in Nashville, TN. * Friday, Aug. 29 2014: Felipe Zapata joins the group! * Monday, Aug. 25 2014: USF Autumn Semester First Day of Classes - don't forget to sign up for [[CompSciFall2014|Introduction to Scientific Computing]]! * Monday, Aug. 18 2014: David M. Rogers presented an invited talk "pH Dynamics During Concentration Polarization," to the [http://www.pnnl.gov/computing/cm4/ CM4 Mathematics for Mesoscopic Materials Modeling Group]. * Tuesday, July 8 2014: David M. Rogers presented "What’s Holding Up Multiscale modeling?" at the Telluride, CO workshop for [http://www.telluridescience.org/meetings/workshop-details?wid=404 Ions in Aqueous Solutions and Molecular Biology]. * Friday, May 9 2014: David M. Rogers presented "Jumping from atomistic to continuum simulation of electrochemical driving at interfaces," at the 2014 Florida FAME Conference.[http://www.fame.chem.ufl.edu/computational.html] * January 29th, 2014: David M. Rogers presented "Simulating at the molecular / continuum interface," at the USF Research Computing User's Group Forum [http://www.usf.edu/it/research-computing/featured-researchers/rogersgroup.aspx]. * Monday, Aug. 26 2013: USF Autumn Semester First Day of Classes * Friday, July 12, 2013: Argonne Center for Nanoscale Materials [http://nano.anl.gov/users/call_for_proposals.html Proposal Deadline] * Thursday, July 4, 2013: Independence Day - celebrate by supporting [https://www.eff.org/ EFF] * Thursday, April 11 2013: David M. Rogers presented "Solute Partitioning and Transport through Natural and Biomimetic Membranes," at the 2013 ACS National Meeting. == Calendars == * [http://www.registrar.usf.edu/enroll/regist/calendt.php USF Calendar] 7b156262635020f55bb9c59760e1db57df88eb23 Publications 0 8 339 284 2015-03-07T16:28:19Z David M. Rogers 2 wikitext text/x-wiki {| cellpadding="4" style="border: 1px solid darkgray;" |- style="border: 1px solid darkgray;" || David M. Rogers. "Real-space quadrature: a convenient, efficient representation for multipole expansions." submitted [http://dx.doi.org/10.1063/1.4907404 J. Chem. Phys. 142:074101, 2015]. ([http://predictivestatmech.org/papers/real-poles.pdf Presentation]) I introduce sets of point charges that are able to simultaneously reproduce all multipole (spherical harmonic) expansions up to arbitrary order. The number of points is space-optimal. Translations are described from the usual harmonics and from Cartesian moments (dipole, quadrupole, etc.) on supersymmetric tensors to directional moments using the point weight distribution. Many applications are possible, including trivial implementation of multipoles in molecular mechanics and representing probability distributions over rotation space. |- style="border: 1px solid darkgray;" || Yaqin Fu, Binsong Li, Ying-Bing Jiang, Darren R. Dunphy, Andy Tsai, Siu-Yue Tam, Hongyou Fan, Hongxia Zhan, David Rogers, Susan Rempe, Plamen Atanassov, Joseph L. Cecchi, and C. Jeffrey Brinker "Atomic Layer Deposition of L-Alanine Polypeptide" [http://pubs.acs.org/doi/abs/10.1021/ja5043403 JACS 136(45):15821–4, 2014.] We carried out blocked peptide synthesis by vapor-depositing Boc-L-alanine to create a uniform thin film of polypeptides grown on a silica substrate activated by aminopropyltrimethoxysilane. |- style="border: 1px solid darkgray;" || David M. Rogers. "Silmaril, A Functional Language for Distributed Parallel Evaluation." [http://predictivestatmech.org/sil/papers/sil.pdf Submitted version] |- style="border: 1px solid darkgray;" || Mathias B. Andersen, David M. Rogers, Junyu Mai, Benjamin Schudel, Anson V. Hatch, Susan B. Rempe and Ali Mani. "Spatiotemporal pH dynamics in concentration polarization near ion-selective membranes." [http://dx.doi.org/10.1021/la5014297 Langmuir, 30(26):7902–7912, 2014] |- style="border: 1px solid darkgray;" || W. K. Chan, P. L. Lorenzi, A. Anishkin, P. Purwaha, D. M. Rogers, S. Sukharev, S.B. Rempe, and J. N. Weinstein. "The glutaminase activity of l-asparaginase is not required for anticancer activity against ASNS-negative cells." [http://dx.doi.org/10.1182/blood-2013-10-535112 Blood. 123(23):3596-606, 2014]. |- style="border: 1px solid darkgray;" || David M. Rogers, Dian Jiao, Lawrence Pratt, and Susan B. Rempe. "Structural Models and Molecular Thermodynamics of Hydration of Ions and Small Molecules" [http://dx.doi.org/10.1016/B978-0-444-59440-2.00004-1 Annu. Rep. Comp. Chem. 8:71–127, 2012.] |- style="border: 1px solid darkgray;" || David M. Rogers and Susan B. Rempe. "Irreversible Thermodynamics." [http://dx.doi.org/10.1088/1742-6596/402/1/012014 J. Phys.: Conf. Ser. 402:012014, 2012]. |- style="border: 1px solid darkgray;" || David M. Rogers, Thomas L. Beck, and Susan B. Rempe. [[Media:Dmroge_InfoNonequ2011.pdf|"An Information Theory Approach to Nonlinear, Nonequilibrium Thermodynamics."]] [http://dx.doi.org/10.1007/s10955-011-0358-9 J. Stat. Phys. 145(2):385-409, 2011] We show how the interpretation of thermodynamic states as representing system information leads naturally to thermodynamic cycles and the first and second laws of thermodynamics as well as similar formulations for nontrivial nonequilibrium problems. The logical development of the theory also leads naturally to correct indistinguishability factors in the partition function. |- style="border: 1px solid darkgray;" || Sameer Varma, David M. Rogers, Lawrence R. Pratt, and Susan B. Rempe. "Perspectives on Ion Selectivity: Design Principles for K+ Selectivity in Membrane Transport." [http://jgp.rupress.org/content/137/6/479.full J. Gen. Physiol., 137(6):479-488, 2011.] We review the development of models for understanding the physical basis of selectivity for K+ ions over Na+, its sibling only one row behind, in membrane channels and transporters. Although the problem is subtle because of the morass of competing effects, we emphasize work analyzing the systematic influence of the environment on tipping local binding site structure toward selective configurations. |- style="border: 1px solid darkgray;" || David M. Rogers and Susan B. Rempe. [http://www.ncbi.nlm.nih.gov/pmc/articles/PMC3443978/ “Probing the Thermodynamics of Competitive Ion Binding Using Minimum Energy Structures.”] [http://dx.doi.org/10.1021/jp2012864 J. Phys. Chem. B, 115(29):9116-29, 2011]. We presented an extension of the Quasi-Chemical theory for quantifying the impact of local structure on ion complexation thermodynamics. The theory can be simply represented using a set of thermodynamic cycles involving binding site structural and compositional states as reaction intermediates. |- style="border: 1px solid darkgray;" || Susan B. Rempe and David M. Rogers; et. al. “Computational and experimental platform for understanding and optimizing water flux and salt rejection in nanoporous membranes.” [http://prod.sandia.gov/techlib/access-control.cgi/2010/106735.pdf Sandia Technical Report, SAND2010-6735, 2010.] We summarize work on designing polymer coatings for salt exclusion in water transporting nanopores. In this work, I collected available molecular dynamics results for these systems and performed a novel energy efficiency analysis able to relate atomistic and experimental scales as well as identify important design goals and chemical principles for material performance. |- style="border: 1px solid darkgray;" || David M. Rogers, [http://rave.ohiolink.edu/etdc/view?acc_num=ucin1251832030 ''''Using Bayes' Theorem for Free Energy Calculations''''], 2009. We investigated the central quantity of free energies in a Bayesian context and provide estimators for solvation free energies as well as optimal potential of mean force approximations to model polymer coarse-grained dynamics from atomistic simulations. |- style="border: 1px solid darkgray;" || Zhen Zhao, David M. Rogers and Thomas L. Beck. "Polarization and Charge Transfer in the Hydration of Chloride Ions." [http://link.aip.org/link/?JCP/132/014502/1 J. Chem. Phys., 132:014502, 2010.] Dr. Zhao's ab-initio analysis of the charge distribution in water-ion clusters highlighted the importance of many-body water-water interactions and charge transfer effects in determining cluster structural and energetic properties. These are still challenging to represent in modern polarizable forcefields and have implications for anion properties at interfaces. |- style="border: 1px solid darkgray;" || David M. Rogers and Thomas L. Beck. "Quasi-Chemical and Structural Analysis of Polarizable Anion Hydration." [http://link.aip.org/link/?JCP/132/014505/1 J. Chem. Phys., 132:014505, 2010.] The role of polarizability in forcefield-based models of ions and water was examined. Utilizing some of our recent developments on quasi-chemical theory, we have been able to quantify the tightened, asymmetric nature of the ion's local solvation waters induced by increased polarizability as well as the exact effects of polarization on the solvation free energy. The results suggest some potential problems and diagnostics for such models. |- style="border: 1px solid darkgray;" || David M. Rogers and Thomas L. Beck. [http://forcesolve.sourceforge.net/ Force Solve] (Sourceforge, Chicago IL, 2008). This force matching software implements and tests coarse-graining for general molecular systems in a mere 4000 lines of code. It is able to parametrize coarse Hamiltonians from atomic trajectory data given arbitrary definitions of coarse united-atom type models as well as carry out short Langevin Dynamics simulations on the coarse scale. The program's main drawbacks are its slow speed and high memory usage due to its simplistic design, attributable to the interpreted nature of python. |- style="border: 1px solid darkgray;" || David M. Rogers and Thomas L. Beck. "Resolution and Scale Independent Nonparametric Function Matching Using a String Energy Penalized Spline Prior." 2008. [http://arxiv.org/abs/1003.4741 arXiv:1003.4741v1] (stat.ML). Fresh insight is provided into long-standing mathematical issues surrounding computational modeling of continuous functions from a few sampled data points. The present research lays the groundwork for predicting the behavior of complicated many-body systems using advanced regression techniques. |} b2de098e31250225ee3e589cc91ad8486617bbce 340 339 2015-03-07T16:29:32Z David M. Rogers 2 wikitext text/x-wiki {| cellpadding="4" style="border: 1px solid darkgray;" |- style="border: 1px solid darkgray;" || David M. Rogers. "Real-space quadrature: a convenient, efficient representation for multipole expansions." [http://dx.doi.org/10.1063/1.4907404 J. Chem. Phys. 142:074101, 2015]. ([http://predictivestatmech.org/papers/real-poles.pdf Presentation]) I introduce sets of point charges that are able to simultaneously reproduce all multipole (spherical harmonic) expansions up to arbitrary order. The number of points is space-optimal. Translations are described from the usual harmonics and from Cartesian moments (dipole, quadrupole, etc.) on supersymmetric tensors to directional moments using the point weight distribution. Many applications are possible, including trivial implementation of multipoles in molecular mechanics and representing probability distributions over rotation space. |- style="border: 1px solid darkgray;" || Yaqin Fu, Binsong Li, Ying-Bing Jiang, Darren R. Dunphy, Andy Tsai, Siu-Yue Tam, Hongyou Fan, Hongxia Zhan, David Rogers, Susan Rempe, Plamen Atanassov, Joseph L. Cecchi, and C. Jeffrey Brinker "Atomic Layer Deposition of L-Alanine Polypeptide" [http://pubs.acs.org/doi/abs/10.1021/ja5043403 JACS 136(45):15821–4, 2014.] We carried out blocked peptide synthesis by vapor-depositing Boc-L-alanine to create a uniform thin film of polypeptides grown on a silica substrate activated by aminopropyltrimethoxysilane. |- style="border: 1px solid darkgray;" || David M. Rogers. "Silmaril, A Functional Language for Distributed Parallel Evaluation." [http://predictivestatmech.org/sil/papers/sil.pdf Submitted version] |- style="border: 1px solid darkgray;" || Mathias B. Andersen, David M. Rogers, Junyu Mai, Benjamin Schudel, Anson V. Hatch, Susan B. Rempe and Ali Mani. "Spatiotemporal pH dynamics in concentration polarization near ion-selective membranes." [http://dx.doi.org/10.1021/la5014297 Langmuir, 30(26):7902–7912, 2014] |- style="border: 1px solid darkgray;" || W. K. Chan, P. L. Lorenzi, A. Anishkin, P. Purwaha, D. M. Rogers, S. Sukharev, S.B. Rempe, and J. N. Weinstein. "The glutaminase activity of l-asparaginase is not required for anticancer activity against ASNS-negative cells." [http://dx.doi.org/10.1182/blood-2013-10-535112 Blood. 123(23):3596-606, 2014]. |- style="border: 1px solid darkgray;" || David M. Rogers, Dian Jiao, Lawrence Pratt, and Susan B. Rempe. "Structural Models and Molecular Thermodynamics of Hydration of Ions and Small Molecules" [http://dx.doi.org/10.1016/B978-0-444-59440-2.00004-1 Annu. Rep. Comp. Chem. 8:71–127, 2012.] |- style="border: 1px solid darkgray;" || David M. Rogers and Susan B. Rempe. "Irreversible Thermodynamics." [http://dx.doi.org/10.1088/1742-6596/402/1/012014 J. Phys.: Conf. Ser. 402:012014, 2012]. |- style="border: 1px solid darkgray;" || David M. Rogers, Thomas L. Beck, and Susan B. Rempe. [[Media:Dmroge_InfoNonequ2011.pdf|"An Information Theory Approach to Nonlinear, Nonequilibrium Thermodynamics."]] [http://dx.doi.org/10.1007/s10955-011-0358-9 J. Stat. Phys. 145(2):385-409, 2011] We show how the interpretation of thermodynamic states as representing system information leads naturally to thermodynamic cycles and the first and second laws of thermodynamics as well as similar formulations for nontrivial nonequilibrium problems. The logical development of the theory also leads naturally to correct indistinguishability factors in the partition function. |- style="border: 1px solid darkgray;" || Sameer Varma, David M. Rogers, Lawrence R. Pratt, and Susan B. Rempe. "Perspectives on Ion Selectivity: Design Principles for K+ Selectivity in Membrane Transport." [http://jgp.rupress.org/content/137/6/479.full J. Gen. Physiol., 137(6):479-488, 2011.] We review the development of models for understanding the physical basis of selectivity for K+ ions over Na+, its sibling only one row behind, in membrane channels and transporters. Although the problem is subtle because of the morass of competing effects, we emphasize work analyzing the systematic influence of the environment on tipping local binding site structure toward selective configurations. |- style="border: 1px solid darkgray;" || David M. Rogers and Susan B. Rempe. [http://www.ncbi.nlm.nih.gov/pmc/articles/PMC3443978/ “Probing the Thermodynamics of Competitive Ion Binding Using Minimum Energy Structures.”] [http://dx.doi.org/10.1021/jp2012864 J. Phys. Chem. B, 115(29):9116-29, 2011]. We presented an extension of the Quasi-Chemical theory for quantifying the impact of local structure on ion complexation thermodynamics. The theory can be simply represented using a set of thermodynamic cycles involving binding site structural and compositional states as reaction intermediates. |- style="border: 1px solid darkgray;" || Susan B. Rempe and David M. Rogers; et. al. “Computational and experimental platform for understanding and optimizing water flux and salt rejection in nanoporous membranes.” [http://prod.sandia.gov/techlib/access-control.cgi/2010/106735.pdf Sandia Technical Report, SAND2010-6735, 2010.] We summarize work on designing polymer coatings for salt exclusion in water transporting nanopores. In this work, I collected available molecular dynamics results for these systems and performed a novel energy efficiency analysis able to relate atomistic and experimental scales as well as identify important design goals and chemical principles for material performance. |- style="border: 1px solid darkgray;" || David M. Rogers, [http://rave.ohiolink.edu/etdc/view?acc_num=ucin1251832030 ''''Using Bayes' Theorem for Free Energy Calculations''''], 2009. We investigated the central quantity of free energies in a Bayesian context and provide estimators for solvation free energies as well as optimal potential of mean force approximations to model polymer coarse-grained dynamics from atomistic simulations. |- style="border: 1px solid darkgray;" || Zhen Zhao, David M. Rogers and Thomas L. Beck. "Polarization and Charge Transfer in the Hydration of Chloride Ions." [http://link.aip.org/link/?JCP/132/014502/1 J. Chem. Phys., 132:014502, 2010.] Dr. Zhao's ab-initio analysis of the charge distribution in water-ion clusters highlighted the importance of many-body water-water interactions and charge transfer effects in determining cluster structural and energetic properties. These are still challenging to represent in modern polarizable forcefields and have implications for anion properties at interfaces. |- style="border: 1px solid darkgray;" || David M. Rogers and Thomas L. Beck. "Quasi-Chemical and Structural Analysis of Polarizable Anion Hydration." [http://link.aip.org/link/?JCP/132/014505/1 J. Chem. Phys., 132:014505, 2010.] The role of polarizability in forcefield-based models of ions and water was examined. Utilizing some of our recent developments on quasi-chemical theory, we have been able to quantify the tightened, asymmetric nature of the ion's local solvation waters induced by increased polarizability as well as the exact effects of polarization on the solvation free energy. The results suggest some potential problems and diagnostics for such models. |- style="border: 1px solid darkgray;" || David M. Rogers and Thomas L. Beck. [http://forcesolve.sourceforge.net/ Force Solve] (Sourceforge, Chicago IL, 2008). This force matching software implements and tests coarse-graining for general molecular systems in a mere 4000 lines of code. It is able to parametrize coarse Hamiltonians from atomic trajectory data given arbitrary definitions of coarse united-atom type models as well as carry out short Langevin Dynamics simulations on the coarse scale. The program's main drawbacks are its slow speed and high memory usage due to its simplistic design, attributable to the interpreted nature of python. |- style="border: 1px solid darkgray;" || David M. Rogers and Thomas L. Beck. "Resolution and Scale Independent Nonparametric Function Matching Using a String Energy Penalized Spline Prior." 2008. [http://arxiv.org/abs/1003.4741 arXiv:1003.4741v1] (stat.ML). Fresh insight is provided into long-standing mathematical issues surrounding computational modeling of continuous functions from a few sampled data points. The present research lays the groundwork for predicting the behavior of complicated many-body systems using advanced regression techniques. |} c55bd044bcbcc23f7c4025b67604dcfa8423a462 341 340 2015-03-07T20:48:33Z David M. Rogers 2 wikitext text/x-wiki {| cellpadding="4" style="border: 1px solid darkgray;" |- style="border: 1px solid darkgray;" || David M. Rogers. "Real-space quadrature: a convenient, efficient representation for multipole expansions." [http://dx.doi.org/10.1063/1.4907404 J. Chem. Phys. 142:074101, 2015]. ([http://predictivestatmech.org/papers/real-poles.pdf Presentation]) I introduce sets of point charges that are able to simultaneously reproduce all multipole (spherical harmonic) expansions up to arbitrary order. The number of points is space-optimal. Translations are described from the usual harmonics and from Cartesian moments (dipole, quadrupole, etc.) on supersymmetric tensors to directional moments using the point weight distribution. Many applications are possible, including trivial implementation of multipoles in molecular mechanics and representing probability distributions over rotation space. |- || David M. Rogers, Michael S. Kent, and Susan B. Rempe, "Molecular basis of endosomal-membrane association for the dengue virus envelope protein." [http://dx.doi.org/10.1016/j.bbamem.2014.12.018 BBA Biomembranes 1848(4):1041-52.] A fully atomistic potential of mean force for association of the viral envelope protein from Dengue virus was compared to a Poisson-Boltzmann electrostatic plus dispersion model. The results are consistent, showing hope for this type of combined scale simulation. |- style="border: 1px solid darkgray;" || Yaqin Fu, Binsong Li, Ying-Bing Jiang, Darren R. Dunphy, Andy Tsai, Siu-Yue Tam, Hongyou Fan, Hongxia Zhan, David Rogers, Susan Rempe, Plamen Atanassov, Joseph L. Cecchi, and C. Jeffrey Brinker "Atomic Layer Deposition of L-Alanine Polypeptide." [http://pubs.acs.org/doi/abs/10.1021/ja5043403 JACS 136(45):15821–4, 2014.] This paper with our experimental collaborators carried out blocked peptide synthesis by vapor-depositing Boc-L-alanine to create a uniform thin film of polypeptides grown on a silica substrate activated by aminopropyltrimethoxysilane. |- style="border: 1px solid darkgray;" || David M. Rogers. "Silmaril, A Functional Language for Distributed Parallel Evaluation." [http://predictivestatmech.org/sil/papers/sil.pdf Submitted version] |- style="border: 1px solid darkgray;" || Mathias B. Andersen, David M. Rogers, Junyu Mai, Benjamin Schudel, Anson V. Hatch, Susan B. Rempe and Ali Mani. "Spatiotemporal pH dynamics in concentration polarization near ion-selective membranes." [http://dx.doi.org/10.1021/la5014297 Langmuir, 30(26):7902–7912, 2014] |- style="border: 1px solid darkgray;" || W. K. Chan, P. L. Lorenzi, A. Anishkin, P. Purwaha, D. M. Rogers, S. Sukharev, S.B. Rempe, and J. N. Weinstein. "The glutaminase activity of l-asparaginase is not required for anticancer activity against ASNS-negative cells." [http://dx.doi.org/10.1182/blood-2013-10-535112 Blood. 123(23):3596-606, 2014]. |- style="border: 1px solid darkgray;" || David M. Rogers, Dian Jiao, Lawrence Pratt, and Susan B. Rempe. "Structural Models and Molecular Thermodynamics of Hydration of Ions and Small Molecules" [http://dx.doi.org/10.1016/B978-0-444-59440-2.00004-1 Annu. Rep. Comp. Chem. 8:71–127, 2012.] |- style="border: 1px solid darkgray;" || David M. Rogers and Susan B. Rempe. "Irreversible Thermodynamics." [http://dx.doi.org/10.1088/1742-6596/402/1/012014 J. Phys.: Conf. Ser. 402:012014, 2012]. |- style="border: 1px solid darkgray;" || David M. Rogers, Thomas L. Beck, and Susan B. Rempe. [[Media:Dmroge_InfoNonequ2011.pdf|"An Information Theory Approach to Nonlinear, Nonequilibrium Thermodynamics."]] [http://dx.doi.org/10.1007/s10955-011-0358-9 J. Stat. Phys. 145(2):385-409, 2011] We show how the interpretation of thermodynamic states as representing system information leads naturally to thermodynamic cycles and the first and second laws of thermodynamics as well as similar formulations for nontrivial nonequilibrium problems. The logical development of the theory also leads naturally to correct indistinguishability factors in the partition function. |- style="border: 1px solid darkgray;" || Sameer Varma, David M. Rogers, Lawrence R. Pratt, and Susan B. Rempe. "Perspectives on Ion Selectivity: Design Principles for K+ Selectivity in Membrane Transport." [http://jgp.rupress.org/content/137/6/479.full J. Gen. Physiol., 137(6):479-488, 2011.] We review the development of models for understanding the physical basis of selectivity for K+ ions over Na+, its sibling only one row behind, in membrane channels and transporters. Although the problem is subtle because of the morass of competing effects, we emphasize work analyzing the systematic influence of the environment on tipping local binding site structure toward selective configurations. |- style="border: 1px solid darkgray;" || David M. Rogers and Susan B. Rempe. [http://www.ncbi.nlm.nih.gov/pmc/articles/PMC3443978/ “Probing the Thermodynamics of Competitive Ion Binding Using Minimum Energy Structures.”] [http://dx.doi.org/10.1021/jp2012864 J. Phys. Chem. B, 115(29):9116-29, 2011]. We presented an extension of the Quasi-Chemical theory for quantifying the impact of local structure on ion complexation thermodynamics. The theory can be simply represented using a set of thermodynamic cycles involving binding site structural and compositional states as reaction intermediates. |- style="border: 1px solid darkgray;" || Susan B. Rempe and David M. Rogers; et. al. “Computational and experimental platform for understanding and optimizing water flux and salt rejection in nanoporous membranes.” [http://prod.sandia.gov/techlib/access-control.cgi/2010/106735.pdf Sandia Technical Report, SAND2010-6735, 2010.] We summarize work on designing polymer coatings for salt exclusion in water transporting nanopores. In this work, I collected available molecular dynamics results for these systems and performed a novel energy efficiency analysis able to relate atomistic and experimental scales as well as identify important design goals and chemical principles for material performance. |- style="border: 1px solid darkgray;" || David M. Rogers, [http://rave.ohiolink.edu/etdc/view?acc_num=ucin1251832030 ''''Using Bayes' Theorem for Free Energy Calculations''''], 2009. We investigated the central quantity of free energies in a Bayesian context and provide estimators for solvation free energies as well as optimal potential of mean force approximations to model polymer coarse-grained dynamics from atomistic simulations. |- style="border: 1px solid darkgray;" || Zhen Zhao, David M. Rogers and Thomas L. Beck. "Polarization and Charge Transfer in the Hydration of Chloride Ions." [http://link.aip.org/link/?JCP/132/014502/1 J. Chem. Phys., 132:014502, 2010.] Dr. Zhao's ab-initio analysis of the charge distribution in water-ion clusters highlighted the importance of many-body water-water interactions and charge transfer effects in determining cluster structural and energetic properties. These are still challenging to represent in modern polarizable forcefields and have implications for anion properties at interfaces. |- style="border: 1px solid darkgray;" || David M. Rogers and Thomas L. Beck. "Quasi-Chemical and Structural Analysis of Polarizable Anion Hydration." [http://link.aip.org/link/?JCP/132/014505/1 J. Chem. Phys., 132:014505, 2010.] The role of polarizability in forcefield-based models of ions and water was examined. Utilizing some of our recent developments on quasi-chemical theory, we have been able to quantify the tightened, asymmetric nature of the ion's local solvation waters induced by increased polarizability as well as the exact effects of polarization on the solvation free energy. The results suggest some potential problems and diagnostics for such models. |- style="border: 1px solid darkgray;" || David M. Rogers and Thomas L. Beck. [http://forcesolve.sourceforge.net/ Force Solve] (Sourceforge, Chicago IL, 2008). This force matching software implements and tests coarse-graining for general molecular systems in a mere 4000 lines of code. It is able to parametrize coarse Hamiltonians from atomic trajectory data given arbitrary definitions of coarse united-atom type models as well as carry out short Langevin Dynamics simulations on the coarse scale. The program's main drawbacks are its slow speed and high memory usage due to its simplistic design, attributable to the interpreted nature of python. |- style="border: 1px solid darkgray;" || David M. Rogers and Thomas L. Beck. "Resolution and Scale Independent Nonparametric Function Matching Using a String Energy Penalized Spline Prior." 2008. [http://arxiv.org/abs/1003.4741 arXiv:1003.4741v1] (stat.ML). Fresh insight is provided into long-standing mathematical issues surrounding computational modeling of continuous functions from a few sampled data points. The present research lays the groundwork for predicting the behavior of complicated many-body systems using advanced regression techniques. |} 7cf8f5ac265407823c0b11c43c53dea9db9ce542 342 341 2015-03-07T20:48:45Z David M. Rogers 2 wikitext text/x-wiki {| cellpadding="4" style="border: 1px solid darkgray;" |- style="border: 1px solid darkgray;" || David M. Rogers. "Real-space quadrature: a convenient, efficient representation for multipole expansions." [http://dx.doi.org/10.1063/1.4907404 J. Chem. Phys. 142:074101, 2015]. ([http://predictivestatmech.org/papers/real-poles.pdf Presentation]) I introduce sets of point charges that are able to simultaneously reproduce all multipole (spherical harmonic) expansions up to arbitrary order. The number of points is space-optimal. Translations are described from the usual harmonics and from Cartesian moments (dipole, quadrupole, etc.) on supersymmetric tensors to directional moments using the point weight distribution. Many applications are possible, including trivial implementation of multipoles in molecular mechanics and representing probability distributions over rotation space. |- || David M. Rogers, Michael S. Kent, and Susan B. Rempe, "Molecular basis of endosomal-membrane association for the dengue virus envelope protein." [http://dx.doi.org/10.1016/j.bbamem.2014.12.018 BBA Biomembranes 1848(4):1041-52.] A fully atomistic potential of mean force for association of the viral envelope protein from Dengue virus was compared to a Poisson-Boltzmann electrostatic plus dispersion model. The results are consistent, showing hope for this type of combined scale simulation. |- style="border: 1px solid darkgray;" || Yaqin Fu, Binsong Li, Ying-Bing Jiang, Darren R. Dunphy, Andy Tsai, Siu-Yue Tam, Hongyou Fan, Hongxia Zhan, David Rogers, Susan Rempe, Plamen Atanassov, Joseph L. Cecchi, and C. Jeffrey Brinker "Atomic Layer Deposition of L-Alanine Polypeptide." [http://pubs.acs.org/doi/abs/10.1021/ja5043403 JACS 136(45):15821–4, 2014.] This paper with our experimental collaborators carried out blocked peptide synthesis by vapor-depositing Boc-L-alanine to create a uniform thin film of polypeptides grown on a silica substrate activated by aminopropyltrimethoxysilane. |- style="border: 1px solid darkgray;" || David M. Rogers. "Silmaril, A Functional Language for Distributed Parallel Evaluation." [http://predictivestatmech.org/sil/papers/sil.pdf Submitted version] |- style="border: 1px solid darkgray;" || Mathias B. Andersen, David M. Rogers, Junyu Mai, Benjamin Schudel, Anson V. Hatch, Susan B. Rempe and Ali Mani. "Spatiotemporal pH dynamics in concentration polarization near ion-selective membranes." [http://dx.doi.org/10.1021/la5014297 Langmuir, 30(26):7902–7912, 2014] |- style="border: 1px solid darkgray;" || W. K. Chan, P. L. Lorenzi, A. Anishkin, P. Purwaha, D. M. Rogers, S. Sukharev, S.B. Rempe, and J. N. Weinstein. "The glutaminase activity of l-asparaginase is not required for anticancer activity against ASNS-negative cells." [http://dx.doi.org/10.1182/blood-2013-10-535112 Blood. 123(23):3596-606, 2014]. |- style="border: 1px solid darkgray;" || David M. Rogers, Dian Jiao, Lawrence Pratt, and Susan B. Rempe. "Structural Models and Molecular Thermodynamics of Hydration of Ions and Small Molecules" [http://dx.doi.org/10.1016/B978-0-444-59440-2.00004-1 Annu. Rep. Comp. Chem. 8:71–127, 2012.] |- style="border: 1px solid darkgray;" || David M. Rogers and Susan B. Rempe. "Irreversible Thermodynamics." [http://dx.doi.org/10.1088/1742-6596/402/1/012014 J. Phys.: Conf. Ser. 402:012014, 2012]. |- style="border: 1px solid darkgray;" || David M. Rogers, Thomas L. Beck, and Susan B. Rempe. [[Media:Dmroge_InfoNonequ2011.pdf|"An Information Theory Approach to Nonlinear, Nonequilibrium Thermodynamics."]] [http://dx.doi.org/10.1007/s10955-011-0358-9 J. Stat. Phys. 145(2):385-409, 2011] We show how the interpretation of thermodynamic states as representing system information leads naturally to thermodynamic cycles and the first and second laws of thermodynamics as well as similar formulations for nontrivial nonequilibrium problems. The logical development of the theory also leads naturally to correct indistinguishability factors in the partition function. |- style="border: 1px solid darkgray;" || Sameer Varma, David M. Rogers, Lawrence R. Pratt, and Susan B. Rempe. "Perspectives on Ion Selectivity: Design Principles for K+ Selectivity in Membrane Transport." [http://jgp.rupress.org/content/137/6/479.full J. Gen. Physiol., 137(6):479-488, 2011.] We review the development of models for understanding the physical basis of selectivity for K+ ions over Na+, its sibling only one row behind, in membrane channels and transporters. Although the problem is subtle because of the morass of competing effects, we emphasize work analyzing the systematic influence of the environment on tipping local binding site structure toward selective configurations. |- style="border: 1px solid darkgray;" || David M. Rogers and Susan B. Rempe. [http://www.ncbi.nlm.nih.gov/pmc/articles/PMC3443978/ “Probing the Thermodynamics of Competitive Ion Binding Using Minimum Energy Structures.”] [http://dx.doi.org/10.1021/jp2012864 J. Phys. Chem. B, 115(29):9116-29, 2011]. We presented an extension of the Quasi-Chemical theory for quantifying the impact of local structure on ion complexation thermodynamics. The theory can be simply represented using a set of thermodynamic cycles involving binding site structural and compositional states as reaction intermediates. |- style="border: 1px solid darkgray;" || Susan B. Rempe and David M. Rogers; et. al. “Computational and experimental platform for understanding and optimizing water flux and salt rejection in nanoporous membranes.” [http://prod.sandia.gov/techlib/access-control.cgi/2010/106735.pdf Sandia Technical Report, SAND2010-6735, 2010.] We summarize work on designing polymer coatings for salt exclusion in water transporting nanopores. In this work, I collected available molecular dynamics results for these systems and performed a novel energy efficiency analysis able to relate atomistic and experimental scales as well as identify important design goals and chemical principles for material performance. |- style="border: 1px solid darkgray;" || David M. Rogers, [http://rave.ohiolink.edu/etdc/view?acc_num=ucin1251832030 ''''Using Bayes' Theorem for Free Energy Calculations''''], 2009. We investigated the central quantity of free energies in a Bayesian context and provide estimators for solvation free energies as well as optimal potential of mean force approximations to model polymer coarse-grained dynamics from atomistic simulations. |- style="border: 1px solid darkgray;" || Zhen Zhao, David M. Rogers and Thomas L. Beck. "Polarization and Charge Transfer in the Hydration of Chloride Ions." [http://link.aip.org/link/?JCP/132/014502/1 J. Chem. Phys., 132:014502, 2010.] Dr. Zhao's ab-initio analysis of the charge distribution in water-ion clusters highlighted the importance of many-body water-water interactions and charge transfer effects in determining cluster structural and energetic properties. These are still challenging to represent in modern polarizable forcefields and have implications for anion properties at interfaces. |- style="border: 1px solid darkgray;" || David M. Rogers and Thomas L. Beck. "Quasi-Chemical and Structural Analysis of Polarizable Anion Hydration." [http://link.aip.org/link/?JCP/132/014505/1 J. Chem. Phys., 132:014505, 2010.] The role of polarizability in forcefield-based models of ions and water was examined. Utilizing some of our recent developments on quasi-chemical theory, we have been able to quantify the tightened, asymmetric nature of the ion's local solvation waters induced by increased polarizability as well as the exact effects of polarization on the solvation free energy. The results suggest some potential problems and diagnostics for such models. |- style="border: 1px solid darkgray;" || David M. Rogers and Thomas L. Beck. [http://forcesolve.sourceforge.net/ Force Solve] (Sourceforge, Chicago IL, 2008). This force matching software implements and tests coarse-graining for general molecular systems in a mere 4000 lines of code. It is able to parametrize coarse Hamiltonians from atomic trajectory data given arbitrary definitions of coarse united-atom type models as well as carry out short Langevin Dynamics simulations on the coarse scale. The program's main drawbacks are its slow speed and high memory usage due to its simplistic design, attributable to the interpreted nature of python. |- style="border: 1px solid darkgray;" || David M. Rogers and Thomas L. Beck. "Resolution and Scale Independent Nonparametric Function Matching Using a String Energy Penalized Spline Prior." 2008. [http://arxiv.org/abs/1003.4741 arXiv:1003.4741v1] (stat.ML). Fresh insight is provided into long-standing mathematical issues surrounding computational modeling of continuous functions from a few sampled data points. The present research lays the groundwork for predicting the behavior of complicated many-body systems using advanced regression techniques. |} a7e2d12907a06ff6b2e09a7be89a1dd0d754a7ae 343 342 2015-03-07T20:49:21Z David M. Rogers 2 wikitext text/x-wiki {| cellpadding="4" style="border: 1px solid darkgray;" |- style="border: 1px solid darkgray;" || David M. Rogers. "Real-space quadrature: a convenient, efficient representation for multipole expansions." [http://dx.doi.org/10.1063/1.4907404 J. Chem. Phys. 142:074101, 2015]. ([http://predictivestatmech.org/papers/real-poles.pdf Presentation]) I introduce sets of point charges that are able to simultaneously reproduce all multipole (spherical harmonic) expansions up to arbitrary order. The number of points is space-optimal. Translations are described from the usual harmonics and from Cartesian moments (dipole, quadrupole, etc.) on supersymmetric tensors to directional moments using the point weight distribution. Many applications are possible, including trivial implementation of multipoles in molecular mechanics and representing probability distributions over rotation space. |- style="border: 1px solid darkgray;" || David M. Rogers, Michael S. Kent, and Susan B. Rempe, "Molecular basis of endosomal-membrane association for the dengue virus envelope protein." [http://dx.doi.org/10.1016/j.bbamem.2014.12.018 BBA Biomembranes 1848(4):1041-52.] A fully atomistic potential of mean force for association of the viral envelope protein from Dengue virus was compared to a Poisson-Boltzmann electrostatic plus dispersion model. The results are consistent, showing hope for this type of combined scale simulation. |- style="border: 1px solid darkgray;" || Yaqin Fu, Binsong Li, Ying-Bing Jiang, Darren R. Dunphy, Andy Tsai, Siu-Yue Tam, Hongyou Fan, Hongxia Zhan, David Rogers, Susan Rempe, Plamen Atanassov, Joseph L. Cecchi, and C. Jeffrey Brinker "Atomic Layer Deposition of L-Alanine Polypeptide." [http://pubs.acs.org/doi/abs/10.1021/ja5043403 JACS 136(45):15821–4, 2014.] This paper with our experimental collaborators carried out blocked peptide synthesis by vapor-depositing Boc-L-alanine to create a uniform thin film of polypeptides grown on a silica substrate activated by aminopropyltrimethoxysilane. |- style="border: 1px solid darkgray;" || David M. Rogers. "Silmaril, A Functional Language for Distributed Parallel Evaluation." [http://predictivestatmech.org/sil/papers/sil.pdf Submitted version] |- style="border: 1px solid darkgray;" || Mathias B. Andersen, David M. Rogers, Junyu Mai, Benjamin Schudel, Anson V. Hatch, Susan B. Rempe and Ali Mani. "Spatiotemporal pH dynamics in concentration polarization near ion-selective membranes." [http://dx.doi.org/10.1021/la5014297 Langmuir, 30(26):7902–7912, 2014] |- style="border: 1px solid darkgray;" || W. K. Chan, P. L. Lorenzi, A. Anishkin, P. Purwaha, D. M. Rogers, S. Sukharev, S.B. Rempe, and J. N. Weinstein. "The glutaminase activity of l-asparaginase is not required for anticancer activity against ASNS-negative cells." [http://dx.doi.org/10.1182/blood-2013-10-535112 Blood. 123(23):3596-606, 2014]. |- style="border: 1px solid darkgray;" || David M. Rogers, Dian Jiao, Lawrence Pratt, and Susan B. Rempe. "Structural Models and Molecular Thermodynamics of Hydration of Ions and Small Molecules" [http://dx.doi.org/10.1016/B978-0-444-59440-2.00004-1 Annu. Rep. Comp. Chem. 8:71–127, 2012.] |- style="border: 1px solid darkgray;" || David M. Rogers and Susan B. Rempe. "Irreversible Thermodynamics." [http://dx.doi.org/10.1088/1742-6596/402/1/012014 J. Phys.: Conf. Ser. 402:012014, 2012]. |- style="border: 1px solid darkgray;" || David M. Rogers, Thomas L. Beck, and Susan B. Rempe. [[Media:Dmroge_InfoNonequ2011.pdf|"An Information Theory Approach to Nonlinear, Nonequilibrium Thermodynamics."]] [http://dx.doi.org/10.1007/s10955-011-0358-9 J. Stat. Phys. 145(2):385-409, 2011] We show how the interpretation of thermodynamic states as representing system information leads naturally to thermodynamic cycles and the first and second laws of thermodynamics as well as similar formulations for nontrivial nonequilibrium problems. The logical development of the theory also leads naturally to correct indistinguishability factors in the partition function. |- style="border: 1px solid darkgray;" || Sameer Varma, David M. Rogers, Lawrence R. Pratt, and Susan B. Rempe. "Perspectives on Ion Selectivity: Design Principles for K+ Selectivity in Membrane Transport." [http://jgp.rupress.org/content/137/6/479.full J. Gen. Physiol., 137(6):479-488, 2011.] We review the development of models for understanding the physical basis of selectivity for K+ ions over Na+, its sibling only one row behind, in membrane channels and transporters. Although the problem is subtle because of the morass of competing effects, we emphasize work analyzing the systematic influence of the environment on tipping local binding site structure toward selective configurations. |- style="border: 1px solid darkgray;" || David M. Rogers and Susan B. Rempe. [http://www.ncbi.nlm.nih.gov/pmc/articles/PMC3443978/ “Probing the Thermodynamics of Competitive Ion Binding Using Minimum Energy Structures.”] [http://dx.doi.org/10.1021/jp2012864 J. Phys. Chem. B, 115(29):9116-29, 2011]. We presented an extension of the Quasi-Chemical theory for quantifying the impact of local structure on ion complexation thermodynamics. The theory can be simply represented using a set of thermodynamic cycles involving binding site structural and compositional states as reaction intermediates. |- style="border: 1px solid darkgray;" || Susan B. Rempe and David M. Rogers; et. al. “Computational and experimental platform for understanding and optimizing water flux and salt rejection in nanoporous membranes.” [http://prod.sandia.gov/techlib/access-control.cgi/2010/106735.pdf Sandia Technical Report, SAND2010-6735, 2010.] We summarize work on designing polymer coatings for salt exclusion in water transporting nanopores. In this work, I collected available molecular dynamics results for these systems and performed a novel energy efficiency analysis able to relate atomistic and experimental scales as well as identify important design goals and chemical principles for material performance. |- style="border: 1px solid darkgray;" || David M. Rogers, [http://rave.ohiolink.edu/etdc/view?acc_num=ucin1251832030 ''''Using Bayes' Theorem for Free Energy Calculations''''], 2009. We investigated the central quantity of free energies in a Bayesian context and provide estimators for solvation free energies as well as optimal potential of mean force approximations to model polymer coarse-grained dynamics from atomistic simulations. |- style="border: 1px solid darkgray;" || Zhen Zhao, David M. Rogers and Thomas L. Beck. "Polarization and Charge Transfer in the Hydration of Chloride Ions." [http://link.aip.org/link/?JCP/132/014502/1 J. Chem. Phys., 132:014502, 2010.] Dr. Zhao's ab-initio analysis of the charge distribution in water-ion clusters highlighted the importance of many-body water-water interactions and charge transfer effects in determining cluster structural and energetic properties. These are still challenging to represent in modern polarizable forcefields and have implications for anion properties at interfaces. |- style="border: 1px solid darkgray;" || David M. Rogers and Thomas L. Beck. "Quasi-Chemical and Structural Analysis of Polarizable Anion Hydration." [http://link.aip.org/link/?JCP/132/014505/1 J. Chem. Phys., 132:014505, 2010.] The role of polarizability in forcefield-based models of ions and water was examined. Utilizing some of our recent developments on quasi-chemical theory, we have been able to quantify the tightened, asymmetric nature of the ion's local solvation waters induced by increased polarizability as well as the exact effects of polarization on the solvation free energy. The results suggest some potential problems and diagnostics for such models. |- style="border: 1px solid darkgray;" || David M. Rogers and Thomas L. Beck. [http://forcesolve.sourceforge.net/ Force Solve] (Sourceforge, Chicago IL, 2008). This force matching software implements and tests coarse-graining for general molecular systems in a mere 4000 lines of code. It is able to parametrize coarse Hamiltonians from atomic trajectory data given arbitrary definitions of coarse united-atom type models as well as carry out short Langevin Dynamics simulations on the coarse scale. The program's main drawbacks are its slow speed and high memory usage due to its simplistic design, attributable to the interpreted nature of python. |- style="border: 1px solid darkgray;" || David M. Rogers and Thomas L. Beck. "Resolution and Scale Independent Nonparametric Function Matching Using a String Energy Penalized Spline Prior." 2008. [http://arxiv.org/abs/1003.4741 arXiv:1003.4741v1] (stat.ML). Fresh insight is provided into long-standing mathematical issues surrounding computational modeling of continuous functions from a few sampled data points. The present research lays the groundwork for predicting the behavior of complicated many-body systems using advanced regression techniques. |} ad744409c5572830d3c97a2fee1d603592b8218a 350 343 2015-07-13T19:05:36Z David M. Rogers 2 wikitext text/x-wiki {| cellpadding="4" style="border: 1px solid darkgray;" |- style="border: 1px solid darkgray;" || Marielle Soniat, David M. Rogers, and Susan Rempe. "Dispersion- and Exchange-Corrected Density Functional Theory for Sodium Ion Hydration." [http://pubs.acs.org/doi/abs/10.1021/acs.jctc.5b00357 J. Chem. Theory. Comput. 142:074101, 2015]. We studied the influence of dispersion energy corrections on the free energy of formation for sodium-water clusters computed with DFT and wound up discovering that dispersion and split-range exchange functionals can somewhat counter-balance each other. The charged sodium ion pulls on the water's electrons, clearly showing which density functionals over-polarize compared to CCSD. Split-range exchange can reduce this over-polarization, but results in reduced electrostatic interaction. Dispersion can lower the binding energy again to counter-balance. So, functionals fit to experimental formation energies need both effects to avoid lowering energies by over-polarizing. |- style="border: 1px solid darkgray;" || David M. Rogers. "Real-space quadrature: a convenient, efficient representation for multipole expansions." [http://dx.doi.org/10.1063/1.4907404 J. Chem. Phys. 142:074101, 2015]. ([http://predictivestatmech.org/papers/real-poles.pdf Presentation]) I introduce sets of point charges that are able to simultaneously reproduce all multipole (spherical harmonic) expansions up to arbitrary order. The number of points is space-optimal. Translations are described from the usual harmonics and from Cartesian moments (dipole, quadrupole, etc.) on supersymmetric tensors to directional moments using the point weight distribution. Many applications are possible, including trivial implementation of multipoles in molecular mechanics and representing probability distributions over rotation space. |- style="border: 1px solid darkgray;" || David M. Rogers, Michael S. Kent, and Susan B. Rempe, "Molecular basis of endosomal-membrane association for the dengue virus envelope protein." [http://dx.doi.org/10.1016/j.bbamem.2014.12.018 BBA Biomembranes 1848(4):1041-52.] A fully atomistic potential of mean force for association of the viral envelope protein from Dengue virus was compared to a Poisson-Boltzmann electrostatic plus dispersion model. The results are consistent, showing hope for this type of combined scale simulation. |- style="border: 1px solid darkgray;" || Yaqin Fu, Binsong Li, Ying-Bing Jiang, Darren R. Dunphy, Andy Tsai, Siu-Yue Tam, Hongyou Fan, Hongxia Zhan, David Rogers, Susan Rempe, Plamen Atanassov, Joseph L. Cecchi, and C. Jeffrey Brinker "Atomic Layer Deposition of L-Alanine Polypeptide." [http://pubs.acs.org/doi/abs/10.1021/ja5043403 JACS 136(45):15821–4, 2014.] This paper with our experimental collaborators carried out blocked peptide synthesis by vapor-depositing Boc-L-alanine to create a uniform thin film of polypeptides grown on a silica substrate activated by aminopropyltrimethoxysilane. |- style="border: 1px solid darkgray;" || David M. Rogers. "Silmaril, A Functional Language for Distributed Parallel Evaluation." [http://predictivestatmech.org/sil/papers/sil.pdf Submitted version] |- style="border: 1px solid darkgray;" || Mathias B. Andersen, David M. Rogers, Junyu Mai, Benjamin Schudel, Anson V. Hatch, Susan B. Rempe and Ali Mani. "Spatiotemporal pH dynamics in concentration polarization near ion-selective membranes." [http://dx.doi.org/10.1021/la5014297 Langmuir, 30(26):7902–7912, 2014] |- style="border: 1px solid darkgray;" || W. K. Chan, P. L. Lorenzi, A. Anishkin, P. Purwaha, D. M. Rogers, S. Sukharev, S.B. Rempe, and J. N. Weinstein. "The glutaminase activity of l-asparaginase is not required for anticancer activity against ASNS-negative cells." [http://dx.doi.org/10.1182/blood-2013-10-535112 Blood. 123(23):3596-606, 2014]. |- style="border: 1px solid darkgray;" || David M. Rogers, Dian Jiao, Lawrence Pratt, and Susan B. Rempe. "Structural Models and Molecular Thermodynamics of Hydration of Ions and Small Molecules" [http://dx.doi.org/10.1016/B978-0-444-59440-2.00004-1 Annu. Rep. Comp. Chem. 8:71–127, 2012.] |- style="border: 1px solid darkgray;" || David M. Rogers and Susan B. Rempe. "Irreversible Thermodynamics." [http://dx.doi.org/10.1088/1742-6596/402/1/012014 J. Phys.: Conf. Ser. 402:012014, 2012]. |- style="border: 1px solid darkgray;" || David M. Rogers, Thomas L. Beck, and Susan B. Rempe. [[Media:Dmroge_InfoNonequ2011.pdf|"An Information Theory Approach to Nonlinear, Nonequilibrium Thermodynamics."]] [http://dx.doi.org/10.1007/s10955-011-0358-9 J. Stat. Phys. 145(2):385-409, 2011] We show how the interpretation of thermodynamic states as representing system information leads naturally to thermodynamic cycles and the first and second laws of thermodynamics as well as similar formulations for nontrivial nonequilibrium problems. The logical development of the theory also leads naturally to correct indistinguishability factors in the partition function. |- style="border: 1px solid darkgray;" || Sameer Varma, David M. Rogers, Lawrence R. Pratt, and Susan B. Rempe. "Perspectives on Ion Selectivity: Design Principles for K+ Selectivity in Membrane Transport." [http://jgp.rupress.org/content/137/6/479.full J. Gen. Physiol., 137(6):479-488, 2011.] We review the development of models for understanding the physical basis of selectivity for K+ ions over Na+, its sibling only one row behind, in membrane channels and transporters. Although the problem is subtle because of the morass of competing effects, we emphasize work analyzing the systematic influence of the environment on tipping local binding site structure toward selective configurations. |- style="border: 1px solid darkgray;" || David M. Rogers and Susan B. Rempe. [http://www.ncbi.nlm.nih.gov/pmc/articles/PMC3443978/ “Probing the Thermodynamics of Competitive Ion Binding Using Minimum Energy Structures.”] [http://dx.doi.org/10.1021/jp2012864 J. Phys. Chem. B, 115(29):9116-29, 2011]. We presented an extension of the Quasi-Chemical theory for quantifying the impact of local structure on ion complexation thermodynamics. The theory can be simply represented using a set of thermodynamic cycles involving binding site structural and compositional states as reaction intermediates. |- style="border: 1px solid darkgray;" || Susan B. Rempe and David M. Rogers; et. al. “Computational and experimental platform for understanding and optimizing water flux and salt rejection in nanoporous membranes.” [http://prod.sandia.gov/techlib/access-control.cgi/2010/106735.pdf Sandia Technical Report, SAND2010-6735, 2010.] We summarize work on designing polymer coatings for salt exclusion in water transporting nanopores. In this work, I collected available molecular dynamics results for these systems and performed a novel energy efficiency analysis able to relate atomistic and experimental scales as well as identify important design goals and chemical principles for material performance. |- style="border: 1px solid darkgray;" || David M. Rogers, [http://rave.ohiolink.edu/etdc/view?acc_num=ucin1251832030 ''''Using Bayes' Theorem for Free Energy Calculations''''], 2009. We investigated the central quantity of free energies in a Bayesian context and provide estimators for solvation free energies as well as optimal potential of mean force approximations to model polymer coarse-grained dynamics from atomistic simulations. |- style="border: 1px solid darkgray;" || Zhen Zhao, David M. Rogers and Thomas L. Beck. "Polarization and Charge Transfer in the Hydration of Chloride Ions." [http://link.aip.org/link/?JCP/132/014502/1 J. Chem. Phys., 132:014502, 2010.] Dr. Zhao's ab-initio analysis of the charge distribution in water-ion clusters highlighted the importance of many-body water-water interactions and charge transfer effects in determining cluster structural and energetic properties. These are still challenging to represent in modern polarizable forcefields and have implications for anion properties at interfaces. |- style="border: 1px solid darkgray;" || David M. Rogers and Thomas L. Beck. "Quasi-Chemical and Structural Analysis of Polarizable Anion Hydration." [http://link.aip.org/link/?JCP/132/014505/1 J. Chem. Phys., 132:014505, 2010.] The role of polarizability in forcefield-based models of ions and water was examined. Utilizing some of our recent developments on quasi-chemical theory, we have been able to quantify the tightened, asymmetric nature of the ion's local solvation waters induced by increased polarizability as well as the exact effects of polarization on the solvation free energy. The results suggest some potential problems and diagnostics for such models. |- style="border: 1px solid darkgray;" || David M. Rogers and Thomas L. Beck. [http://forcesolve.sourceforge.net/ Force Solve] (Sourceforge, Chicago IL, 2008). This force matching software implements and tests coarse-graining for general molecular systems in a mere 4000 lines of code. It is able to parametrize coarse Hamiltonians from atomic trajectory data given arbitrary definitions of coarse united-atom type models as well as carry out short Langevin Dynamics simulations on the coarse scale. The program's main drawbacks are its slow speed and high memory usage due to its simplistic design, attributable to the interpreted nature of python. |- style="border: 1px solid darkgray;" || David M. Rogers and Thomas L. Beck. "Resolution and Scale Independent Nonparametric Function Matching Using a String Energy Penalized Spline Prior." 2008. [http://arxiv.org/abs/1003.4741 arXiv:1003.4741v1] (stat.ML). Fresh insight is provided into long-standing mathematical issues surrounding computational modeling of continuous functions from a few sampled data points. The present research lays the groundwork for predicting the behavior of complicated many-body systems using advanced regression techniques. |} 7277f52fa959a53dcda34b4ace911bf2eba7ac3d Best Practices 0 72 345 2015-06-18T14:06:56Z David M. Rogers 2 Created page with "This page collects best use practices and expected timings for codes we use regularly. If you have additional timing info., please share the wealth! == Gromacs == On CIRCE, US…" wikitext text/x-wiki This page collects best use practices and expected timings for codes we use regularly. If you have additional timing info., please share the wealth! == Gromacs == On CIRCE, USF's Linux x86_86 SLURM cluster, we have several GPU systems available. Using them requires requesting a special request flag to SLURM. Here's a submit script: #!/bin/bash #SBATCH -J run #SBATCH -o run_job.log #SBATCH --nodes=1 -p cuda --exclusive --cpus-per-task=16 -t 24:00:00 --gres=gpu:2 --constraint gpu_K20 --constraint avx The -p option is not required, but selects a special partition that gives higher priority to GPU-using jobs. The --gres option requests nodes with 2 gpus, and the gpu_K20 option requests Kepler K20 GPUs (based on the GK110 chipset) with CUDA compute capability 3.5. Note that although this card has lots of double-precision floating point units, Gromacs won't use them, since it prefers single precision for memory throughput anyway. Also, note that this command is specialized, since our dual-GPU nodes have exactly 16 cores. --exclusive requests the whole machine and should be the default, but is not for some reason. The correct launch command is almost as complicated. mpirun -bysocket -bind-to-socket -report-bindings --npernode 2 mdrun_mpi -ntomp 8 -deffnm run The first 4 options are all sent to mpirun, asking for 2 processes to be started per node, and each process to be bound to a single socket. Each socket is a physical processor, containing 8 cores. Without the binding options, mpirun sets up Gromacs (mdrun_mpi) to run on a single core, and will only use 2 cores out of the total 16! To continue a run that was terminated before finishing, use mpirun -bysocket -bind-to-socket --npernode 2 mdrun_mpi -ntomp 8 -deffnm run -cpi run -append -append is required because our NFS filesystem doesn't support locking, and you have to override the default. === Compilation Specifics === We compiled Gromacs 5.0.5 for the Intel(R) Xeon(R) CPU E5-2650 and GPU acceleration using the following script: <code lang="bash"> module load compilers/intel/14.0.1 mpi/openmpi/1.6.1 apps/cmake/2.8.12.2 apps/cuda/6.5.14 cmake -DCMAKE_INSTALL_PREFIX=/shares/rogers \ -DFFTW_INCLUDE_DIR=/shares/rogers/include \ -DFFTW_LIBRARY=/shares/rogers/lib \ -DGMX_SIMD=AVX_256 \ -DGMX_FFT_LIBRARY=fftw3 \ -DGMX_GPU=on \ -DGMX_MPI=ON \ .. make -j8 make install </code> AVX2_256 fails to run on this machine, terminating with an error '''Program received signal 4, Illegal instruction.''' This happens generally when your program tries to do something the CPU running it doesn't understand. Here, the program compiled for AVX2_256 had an AVX2 instruction, which the older processor choked on. You'll have to watch out for issues like this on CIRCE, which contains a mix of old and new Intel and AMD processors. Also, note that this version of Gromacs, compiled with CUDA support, is flexible. It can run efficiently on machines with or without GPU accelerators. 293373a13dc03efa5309b825d6431d50a58e2524 346 345 2015-06-18T14:07:29Z David M. Rogers 2 /* Compilation Specifics */ wikitext text/x-wiki This page collects best use practices and expected timings for codes we use regularly. If you have additional timing info., please share the wealth! == Gromacs == On CIRCE, USF's Linux x86_86 SLURM cluster, we have several GPU systems available. Using them requires requesting a special request flag to SLURM. Here's a submit script: #!/bin/bash #SBATCH -J run #SBATCH -o run_job.log #SBATCH --nodes=1 -p cuda --exclusive --cpus-per-task=16 -t 24:00:00 --gres=gpu:2 --constraint gpu_K20 --constraint avx The -p option is not required, but selects a special partition that gives higher priority to GPU-using jobs. The --gres option requests nodes with 2 gpus, and the gpu_K20 option requests Kepler K20 GPUs (based on the GK110 chipset) with CUDA compute capability 3.5. Note that although this card has lots of double-precision floating point units, Gromacs won't use them, since it prefers single precision for memory throughput anyway. Also, note that this command is specialized, since our dual-GPU nodes have exactly 16 cores. --exclusive requests the whole machine and should be the default, but is not for some reason. The correct launch command is almost as complicated. mpirun -bysocket -bind-to-socket -report-bindings --npernode 2 mdrun_mpi -ntomp 8 -deffnm run The first 4 options are all sent to mpirun, asking for 2 processes to be started per node, and each process to be bound to a single socket. Each socket is a physical processor, containing 8 cores. Without the binding options, mpirun sets up Gromacs (mdrun_mpi) to run on a single core, and will only use 2 cores out of the total 16! To continue a run that was terminated before finishing, use mpirun -bysocket -bind-to-socket --npernode 2 mdrun_mpi -ntomp 8 -deffnm run -cpi run -append -append is required because our NFS filesystem doesn't support locking, and you have to override the default. === Compilation Specifics === We compiled Gromacs 5.0.5 for the Intel(R) Xeon(R) CPU E5-2650 and GPU acceleration using the following script: <source lang="bash"> module load compilers/intel/14.0.1 mpi/openmpi/1.6.1 apps/cmake/2.8.12.2 apps/cuda/6.5.14 cmake -DCMAKE_INSTALL_PREFIX=/shares/rogers \ -DFFTW_INCLUDE_DIR=/shares/rogers/include \ -DFFTW_LIBRARY=/shares/rogers/lib \ -DGMX_SIMD=AVX_256 \ -DGMX_FFT_LIBRARY=fftw3 \ -DGMX_GPU=on \ -DGMX_MPI=ON \ .. make -j8 make install </source> AVX2_256 fails to run on this machine, terminating with an error '''Program received signal 4, Illegal instruction.''' This happens generally when your program tries to do something the CPU running it doesn't understand. Here, the program compiled for AVX2_256 had an AVX2 instruction, which the older processor choked on. You'll have to watch out for issues like this on CIRCE, which contains a mix of old and new Intel and AMD processors. Also, note that this version of Gromacs, compiled with CUDA support, is flexible. It can run efficiently on machines with or without GPU accelerators. 9b0e9435c97e1a7ba70f2a846a5966a69c347109 347 346 2015-06-18T14:20:25Z David M. Rogers 2 /* Gromacs */ wikitext text/x-wiki This page collects best use practices and expected timings for codes we use regularly. If you have additional timing info., please share the wealth! == Gromacs == On CIRCE, USF's Linux x86_86 SLURM cluster, we have several GPU systems available. Using them requires requesting a special request flag to SLURM. Here's a submit script: #!/bin/bash #SBATCH -J run #SBATCH -o run_job.log #SBATCH --nodes=1 -p cuda --exclusive --cpus-per-task=16 -t 24:00:00 --gres=gpu:2 --constraint gpu_K20 --constraint avx The -p option is not required, but selects a special partition that gives higher priority to GPU-using jobs. The --gres option requests nodes with 2 gpus, and the gpu_K20 option requests Kepler K20 GPUs (based on the GK110 chipset) with CUDA compute capability 3.5. Note that although this card has lots of double-precision floating point units, Gromacs won't use them, since it prefers single precision for memory throughput anyway. Also, note that this command is specialized, since our dual-GPU nodes have exactly 16 cores. --exclusive requests the whole machine and should be the default, but is not for some reason. The correct launch command is almost as complicated. mpirun -bysocket -bind-to-socket -report-bindings --npernode 2 mdrun_mpi -ntomp 8 -deffnm run The first 4 options are all sent to mpirun, asking for 2 processes to be started per node, and each process to be bound to a single socket. Each socket is a physical processor, containing 8 cores. Without the binding options, mpirun sets up Gromacs (mdrun_mpi) to run on a single core, and will only use 2 cores out of the total 16! To continue a run that was terminated before finishing, use mpirun -bysocket -bind-to-socket --npernode 2 mdrun_mpi -ntomp 8 -deffnm run -cpi run -append -append is required because our NFS filesystem doesn't support locking, and you have to override the default. === Timings === Using this setup, with 1 node I get 2.1 hours per nanosecond on a system with 72,270 atoms (using the TIP4P rigid water model and 1.2 nm cutoffs). This is the best timing I've seen on CIRCE so far, and translates to 2.9 hours per nanosecond per 100,000 atoms. Using a similar setup on a 16-core Intel E5-2640 system clocked at 2.6 GHz (rather than the 2.0 GHz of the hardware above), and using the GeForce GTX 980, 1380.0 MHz (lots of floating point units, fewer doubles) gives 1.413 hr/ns. === Compilation Specifics === Gromacs 5.0.5 was compiled for the Intel(R) Xeon(R) CPU E5-2650 and GPU acceleration using the following script: <source lang="bash"> module load compilers/intel/14.0.1 mpi/openmpi/1.6.1 apps/cmake/2.8.12.2 apps/cuda/6.5.14 cmake -DCMAKE_INSTALL_PREFIX=/shares/rogers \ -DFFTW_INCLUDE_DIR=/shares/rogers/include \ -DFFTW_LIBRARY=/shares/rogers/lib \ -DGMX_SIMD=AVX_256 \ -DGMX_FFT_LIBRARY=fftw3 \ -DGMX_GPU=on \ -DGMX_MPI=ON \ .. make -j8 make install </source> AVX2_256 fails to run on this machine, terminating with an error '''Program received signal 4, Illegal instruction.''' This happens generally when your program tries to do something the CPU running it doesn't understand. Here, the program compiled for AVX2_256 had an AVX2 instruction, which the older processor choked on. You'll have to watch out for issues like this on CIRCE, which contains a mix of old and new Intel and AMD processors. Also, note that this version of Gromacs, compiled with CUDA support, is flexible. It can run efficiently on machines with or without GPU accelerators. e66a82d95412b574372fd213e250eef72a9fab8d HowTo:Unlock 0 73 352 2015-07-24T20:46:12Z David M. Rogers 2 Created page with "Smartphones are a great convenience, but unfortunately can be a major stress on your budget and limit on your digital freedom. If you've been reading any news lately, you kno..." wikitext text/x-wiki Smartphones are a great convenience, but unfortunately can be a major stress on your budget and limit on your digital freedom. If you've been reading any news lately, you know that there's a lively national debate on what data our governments should be collecting and mining. There's an equally lively debate on what big companies should be doing with your data. Although it was obviously an abuse of authority for the NSA to force black boxes into all of our telecommunication datacenters, it turns out a large chunk of what we do electronically can be tracked with much less effort by anyone by grabbing public records from Facebook / Twitter / Flickr / Online Forum Posts. It should also be remembered that the source of all that data was not the NSA, but your telecom companies, and ultimately you. Long story short, if you have a cell phone that is ON (even if it's not on a service plan), it's constantly communicating with a national GSM (or CDMA) network. At a minimum, this gives the network a constant readout of your location. Control over this network has been concentrated into the hands of 4 major companies: * Verizon (115 million subscribers) * AT&T wireless (107 million subscribers) * Sprint/Nextel (56 million subscribers) * T-Mobile (owned by the German Deutsche Telekom) (43 million subscribers) There's no way to stop it, since those communications are required to send and receive calls and do things like show your signal strength. As it turns out, it's [https://events.ccc.de/congress/2010/Fahrplan/events/4208.en.html not difficult] to snoop on these communications either. As an aside, you're much better off with GSM than CDMA, since GSM is an industry standard used in most other countries, and allows you much more freedom than CDMA to decide your network.[http://www.pcmag.com/article2/0,2817,2407896,00.asp] Although you can't stop what goes over the air, you should be able to control what your phone is doing. Surprisingly, most people have very little control over that. Take the early battles over Apple customers trying to unlock their iPhones[http://www.engadget.com/2010/05/10/confirmed-apple-and-atandt-signed-five-year-iphone-exclusivity-de/] or the countless folks who have to throw away their cell phones to switch carriers, or even the silly skirmishes over carriers locking functionality out of your phone that they don't want you to use. My old Sprint phone wouldn't let me download a free MP3 and use it as a ringtone, because there was a Sprint `store' for that! Can your cell-phone carrier tell you what to do with your own device? Your carrier would like to think so, because it gives them total control over you. There have been rumors that special firmware has been routinely used to turn phones on and get location data[https://www.techdirt.com/articles/20130723/12395923907/even-powering-down-cell-phone-cant-keep-nsa-tracking-its-location.shtml], or even remotely activate the microphone and camera to listen-in on you. Wired's 2014 interview with Snowden revealed the juicy detail[http://www.wired.com/2014/08/edward-snowden/] "Snowden’s handlers repeatedly warned me that, even switched off, a cell phone can easily be turned into an NSA microphone." It's the un-reviewable, un-editable firmware, according to Richard Stallman, that make cellphones "[http://www.networkworld.com/article/2200967/software/cell-phones-are--stalin-s-dream---says-free-software-movement-founder.html Stalin's dream]". Add to that the fact that you're paying (in most cases in excess of $40/moth) for this `service', and I don't understand why most `customers' are happy. Luckily, there are some steps that you can take to get your freedom back. The first is to buy your own phone, like not from the 4 company stores above or in any version that comes with a service plan. Yes, there is an upfront cost, but it's not the $600 they scare everyone with. In fact, it can be much less than what you'll end up paying for the same phone if you buy it with a service plan. If you can tolerate their data-collecting agenda, Google directly sells some of the cheapest full-featured phones around[http://www.google.com/nexus/]. The way it works is that they write some hardware specifications, and convince manufacturers to put the phones together and sell near cost. You can also find tons of them on [http://www.newegg.com/Cell-Phones-Unlocked/Category/ID-249 Newegg] under "unlocked phones", like the ZTE Nubia for $240. Make sure it's one that wasn't previously locked. Locked means the phone was made in collaboration with a service provider, and contains software to lock you out of the phone and keep you on their network (remember the Microsoft bundling that became the subject of anti-trust lawsuits?). Also, check that it runs Android and that it's supported if you intend to switch to Cyanogenmod or Replicant. When it arrives, you will have a phone that is really like a small tablet computer and works without effort on your wireless network. How do you get it to make calls? Simple - you [https://support.google.com/nexus/answer/2809810?hl=en install a SIM card]. Most carriers are more than happy to put you on their network, and will sell you a SIM card for around $9. Some will give the card away as a promotion. While you're looking, service providers will constantly try to fleece you with monthly plans. Whatever you do, stay away from them. I was on T-Mobile's prepaid plan for a few years and only needed < 100 minutes per month. I got that for less than $10 per month by using a $100 prepaid card for each year. Web browsing, apps, email, navigation, and maps all worked great (and for free) on wifi. Sadly, T-Mobile takes your minutes away if you don't buy a card every year, so I started looking for a new carrier. Their customer service is even worse than Delta when they've lost your luggage (long story), so I'm leaving. No contract, no fees, no broken phone, no worries. Enter [https://z219s549ajb.ting.com/ Ting]. Ting has to buy its bandwidth from the big carriers (mostly Sprint), but understands the struggle, and ships their GSM card for $9 + $5 shipping. According to their FAQ, "SM devices purchased from Ting will come automatically unlocked. " [https://help.ting.com/hc/en-us/articles/205428208-FAQ-Ting-SIM-Cards]. Pop out T-Mobile, pop in Ting. Like any utility, they send a monthly bill with a $6 service fee, ~$4 in taxes, and usage fees at around 1.8 cents per Mb (1 minute is like 1 Mb). So, I get an upgrade that works out to around $16 per month - win/win. [https://republicwireless.com Republic Wireless] may be a close contender, but requires you to buy a custom phone from them with firmware support for their implementation of WiFi hybrid calling. Finally, there's that nagging software control issue. Should you grow to resent the few bits of non-free code Google puts on the Nexus phones, there's not really a good alternative. However, the [http://www.replicant.us/ Replicant] project is working to replaces all this hidden junk with free software [http://www.linux-magazine.com/Online/Features/Replicant-The-Struggle-for-Free-Mobile]. They do not, however, try to support 3D graphics acceleration or the use of extra processors (Nexus IR mobile payment technology, etc.). Should you crave these things, you might look into [http://www.cyanogenmod.org/ Cyanogenmod]. 87f89691fa5b4e622d64621af7469ead08f015b1 353 352 2015-07-24T21:00:10Z David M. Rogers 2 wikitext text/x-wiki Smartphones are a great convenience, but unfortunately can be a major stress on your budget and limit on your digital freedom. If you've been reading any news lately, you know that there's a lively national debate on what data our governments should be collecting and mining. There's an equally lively debate on what big companies should be doing with your data. Although it was obviously an abuse of authority for the NSA to force black boxes into all of our telecommunication datacenters, it turns out a large chunk of what we do electronically can be tracked with much less effort by anyone by grabbing public records from Facebook / Twitter / Flickr / Online Forum Posts. It should also be remembered that the source of all that data was not the NSA, but your telecom companies, and ultimately you. Long story short, if you have a cell phone that is ON (even if it's not on a service plan), it's constantly communicating with a national GSM (or CDMA) network. At a minimum, this gives the network a constant readout of your location. Control over this network has been concentrated into the hands of 4 major companies: * Verizon (115 million subscribers) * AT&T wireless (107 million subscribers) * Sprint/Nextel (56 million subscribers) * T-Mobile (owned by the German Deutsche Telekom) (43 million subscribers) There's no way to stop it, since those communications are required to send and receive calls and do things like show your signal strength. As it turns out, it's [https://events.ccc.de/congress/2010/Fahrplan/events/4208.en.html not difficult] to snoop on these communications either. As an aside, you're much better off with GSM than CDMA, since GSM is an industry standard used in most other countries, and allows you much more freedom than CDMA to decide your network.[http://www.pcmag.com/article2/0,2817,2407896,00.asp] Although you can't stop what goes over the air, you should be able to control what your phone is doing. Surprisingly, most people have very little control over that. Take the early battles over Apple customers trying to unlock their iPhones[http://www.engadget.com/2010/05/10/confirmed-apple-and-atandt-signed-five-year-iphone-exclusivity-de/] or the countless folks who have to throw away their cell phones to switch carriers, or even the silly skirmishes over carriers locking functionality out of your phone that they don't want you to use. My old Sprint phone wouldn't let me download a free MP3 and use it as a ringtone, because there was a Sprint `store' for that! Can your cell-phone carrier tell you what to do with your own device? Your carrier would like to think so, because it gives them total control over you. There have been rumors that special firmware has been routinely used to turn phones on and get location data[https://www.techdirt.com/articles/20130723/12395923907/even-powering-down-cell-phone-cant-keep-nsa-tracking-its-location.shtml], or even remotely activate the microphone and camera to listen-in on you. Wired's 2014 interview with Snowden revealed the juicy detail[http://www.wired.com/2014/08/edward-snowden/] "Snowden’s handlers repeatedly warned me that, even switched off, a cell phone can easily be turned into an NSA microphone." It's the un-reviewable, un-editable firmware, according to Richard Stallman, that make cellphones "[http://www.networkworld.com/article/2200967/software/cell-phones-are--stalin-s-dream---says-free-software-movement-founder.html Stalin's dream]". Add to that the fact that you're paying (in most cases in excess of $40/moth) for this `service', and I don't understand why most `customers' are happy. Luckily, there are some steps that you can take to get your freedom back. The first is to buy your own phone, like not from the 4 company stores above or in any version that comes with a service plan. Yes, there is an upfront cost, but it's not the $600 they scare everyone with. In fact, it can be much less than what you'll end up paying for the same phone if you buy it with a service plan. If you can tolerate their data-collecting agenda, Google directly sells some of the cheapest full-featured phones around[http://www.google.com/nexus/]. The way it works is that they write some hardware specifications, and convince manufacturers to put the phones together and sell near cost. You can also find tons of them on [http://www.newegg.com/Cell-Phones-Unlocked/Category/ID-249 Newegg] under "unlocked phones", like the ZTE Nubia for $240. Make sure it's one that wasn't previously locked and takes a GSM card. Locked means the phone was made in collaboration with a service provider, and contains software to lock you out of the phone and keep you on their network (remember the Microsoft bundling that became the subject of anti-trust lawsuits?). Also, check that it runs Android and that it's supported if you intend to switch to Cyanogenmod or Replicant. When it arrives, you will have a phone that is really like a small tablet computer and works without effort on your wireless network. How do you get it to make calls? Simple - you [https://support.google.com/nexus/answer/2809810?hl=en install a SIM card]. Most carriers are more than happy to put you on their network, and will sell you a SIM card for around $9. Some will give the card away as a promotion. While you're looking, service providers will constantly try to fleece you with monthly plans. Whatever you do, stay away from them. I was on T-Mobile's prepaid plan for a few years and only needed < 100 minutes per month. I got that for less than $10 per month by using a $100 prepaid card for each year. Web browsing, apps, email, navigation, and maps all worked great (and for free) on wifi. Sadly, T-Mobile takes your minutes away if you don't buy a card every year, so I started looking for a new carrier. Their customer service is even worse than Delta when they've lost your luggage (long story), so I'm leaving. No contract, no fees, no broken phone, no worries. Enter [https://z219s549ajb.ting.com/ Ting]. Ting has to buy its bandwidth from the big carriers (mostly Sprint and T-Mobile), but understands the struggle, and ships their GSM card for $9 + $5 shipping. According to their FAQ, "SM devices purchased from Ting will come automatically unlocked. " [https://help.ting.com/hc/en-us/articles/205428208-FAQ-Ting-SIM-Cards]. Pop out T-Mobile, pop in Ting. Like any utility, they send a monthly bill with a $6 service fee, ~$4 in taxes, and usage fees at around 1.8 cents per Mb (1 minute is like 1 Mb). So, I get an upgrade that works out to around $16 per month - win/win. [https://republicwireless.com Republic Wireless] may be a close contender, but requires you to buy a custom phone from them with firmware support for their implementation of WiFi hybrid calling. Finally, there's that nagging software control issue. Should you grow to resent the few bits of non-free code Google puts on the Nexus phones, there's not really a good alternative. However, the [http://www.replicant.us/ Replicant] project is working to replaces all this hidden junk with free software [http://www.linux-magazine.com/Online/Features/Replicant-The-Struggle-for-Free-Mobile]. They do not, however, try to support 3D graphics acceleration or the use of extra processors (Nexus IR mobile payment technology, etc.). Should you crave these things, you might look into [http://www.cyanogenmod.org/ Cyanogenmod]. 193cd8eb840f85520cd0c20bd2f41d2687e1746e 354 353 2015-07-24T22:45:49Z David M. Rogers 2 wikitext text/x-wiki Smartphones are a great convenience, but unfortunately can be a major stress on your budget and limit on your digital freedom. If you've been reading any news lately, you know that there's a lively national debate on what data our governments should be collecting and mining. There's an equally lively debate on what big companies should be doing with your data. Although it was obviously an abuse of authority for the NSA to force black boxes into all of our telecommunication datacenters, it turns out a large chunk of what we do electronically can be tracked with much less effort by anyone by grabbing public records from Facebook / Twitter / Flickr / Online Forum Posts. It should also be remembered that the source of all that data was not the NSA, but your telecom companies, and ultimately you. Long story short, if you have a cell phone that is ON (even if it's not on a service plan), it's constantly communicating with a national GSM (or CDMA) network. At a minimum, this gives the network a constant readout of your location. Control over this network has been concentrated into the hands of 4 major companies: * Verizon (115 million subscribers) * AT&T wireless (107 million subscribers) * Sprint/Nextel (56 million subscribers) * T-Mobile (owned by the German Deutsche Telekom) (43 million subscribers) There's no way to stop it, since those communications are required to send and receive calls and do things like show your signal strength. As it turns out, it's [https://events.ccc.de/congress/2010/Fahrplan/events/4208.en.html not difficult] to snoop on these communications either. As an aside, you're much better off with GSM than CDMA, since GSM is an industry standard used in most other countries, and allows you much more freedom than CDMA to decide your network.[http://www.pcmag.com/article2/0,2817,2407896,00.asp] Although you can't stop what goes over the air, you should be able to control what your phone is doing. Surprisingly, most people have very little control over that. Take the early battles over Apple customers trying to unlock their iPhones[http://www.engadget.com/2010/05/10/confirmed-apple-and-atandt-signed-five-year-iphone-exclusivity-de/] or the countless folks who have to throw away their cell phones to switch carriers, or even the silly skirmishes over carriers locking functionality out of your phone that they don't want you to use. My old Sprint phone wouldn't let me download a free MP3 and use it as a ringtone, because there was a Sprint `store' for that! Can your cell-phone carrier tell you what to do with your own device? Your carrier would like to think so, because it gives them total control over you. It's actually well-known that the communication chip in almost all smartphones will send location data to any network request they get[https://www.techdirt.com/articles/20130723/12395923907/even-powering-down-cell-phone-cant-keep-nsa-tracking-its-location.shtml][https://en.wikipedia.org/wiki/Radio_resource_location_services_protocol], or, if it can, remotely activate the microphone and camera to listen-in on you. Wired's 2014 interview with Snowden revealed the juicy detail[http://www.wired.com/2014/08/edward-snowden/] "Snowden’s handlers repeatedly warned me that, even switched off, a cell phone can easily be turned into an NSA microphone." It's the un-reviewable, un-editable firmware, according to Richard Stallman, that make cellphones "[http://www.networkworld.com/article/2200967/software/cell-phones-are--stalin-s-dream---says-free-software-movement-founder.html Stalin's dream]". Add to that the fact that you're paying (in most cases in excess of $40/moth) for this `service', and I don't understand why most `customers' are happy. Luckily, there are some steps that you can take to get your freedom back. The first is to buy your own phone, like not from the 4 company stores above or in any version that comes with a service plan. Yes, there is an upfront cost, but it's not the $600 they scare everyone with. In fact, it can be much less than what you'll end up paying for the same phone if you buy it with a service plan. If you can tolerate their data-collecting agenda, Google directly sells some of the cheapest full-featured phones around[http://www.google.com/nexus/]. The way it works is that they write some hardware specifications, and convince manufacturers to put the phones together and sell near cost. You can also find tons of them on [http://www.newegg.com/Cell-Phones-Unlocked/Category/ID-249 Newegg] under "unlocked phones", like the ZTE Nubia for $240. Make sure it's one that wasn't previously locked and takes a GSM card. Locked means the phone was made in collaboration with a service provider, and contains software to lock you out of the phone and keep you on their network (remember the Microsoft bundling that became the subject of anti-trust lawsuits?). Also, check that it runs Android and that it's supported if you intend to switch to Cyanogenmod or Replicant. There may yet be hope for the OpenMoko project, one of the few out there working to undo the damage done by proprietary communication hardware[http://lists.openmoko.org/pipermail/community/2011-September/065493.html]. When it arrives, you will have a phone that is really like a small tablet computer and works without effort on your wireless network. How do you get it to make calls? Simple - you [https://support.google.com/nexus/answer/2809810?hl=en install a SIM card]. Most carriers are more than happy to put you on their network, and will sell you a SIM card for around $9. Some will give the card away as a promotion. While you're looking, service providers will constantly try to fleece you with monthly plans. Whatever you do, stay away from them. I was on T-Mobile's prepaid plan for a few years and only needed < 100 minutes per month. I got that for less than $10 per month by using a $100 prepaid card for each year. Web browsing, apps, email, navigation, and maps all worked great (and for free) on wifi. Sadly, T-Mobile takes your minutes away if you don't buy a card every year, so I started looking for a new carrier. Their customer service is even worse than Delta when they've lost your luggage (long story), so I'm leaving. No contract, no fees, no broken phone, no worries. Enter [https://z219s549ajb.ting.com/ Ting]. Ting has to buy its bandwidth from the big carriers (mostly Sprint and T-Mobile), but understands the struggle, and ships their GSM card for $9 + $5 shipping. According to their FAQ, "SM devices purchased from Ting will come automatically unlocked. " [https://help.ting.com/hc/en-us/articles/205428208-FAQ-Ting-SIM-Cards]. Pop out T-Mobile, pop in Ting. Like any utility, they send a monthly bill with a $6 service fee, ~$4 in taxes, and usage fees at around 1.8 cents per Mb (1 minute is like 1 Mb). So, I get an upgrade that works out to around $16 per month - win/win. [https://republicwireless.com Republic Wireless] may be a close contender, but requires you to buy a custom phone from them with firmware support for their implementation of WiFi hybrid calling. Finally, there's that nagging software control issue. Should you grow to resent the few bits of non-free code Google puts on the Nexus phones, there's not really a good alternative. However, the [http://www.replicant.us/ Replicant] project is working to replaces all this hidden junk with free software [http://www.linux-magazine.com/Online/Features/Replicant-The-Struggle-for-Free-Mobile]. They do not, however, try to support 3D graphics acceleration or the use of extra processors (Nexus IR mobile payment technology, etc.). Should you crave these things, you might look into [http://www.cyanogenmod.org/ Cyanogenmod]. 54a236fab93bfcb8061fbaeb3a94044edd726495 355 354 2015-07-25T00:02:54Z David M. Rogers 2 wikitext text/x-wiki Smartphones are a great convenience, but unfortunately can be a major stress on your budget and limit on your digital freedom. If you've been reading any news lately, you know that there's a lively national debate on what data our governments should be collecting and mining. There's an equally lively debate on what big companies should be doing with your data. Although it was obviously an abuse of authority for the NSA to force black boxes into all of our telecommunication datacenters, it turns out a large chunk of what we do electronically can be tracked with much less effort by anyone by grabbing public records from Facebook / Twitter / Flickr / Online Forum Posts. It should also be remembered that the source of all that data was not the NSA, but your telecom companies, and ultimately you. Long story short, if you have a cell phone that is ON (even if it's not on a service plan), it's constantly communicating with a national GSM (or CDMA) network. At a minimum, this gives the network a constant readout of your location. Control over this network has been concentrated into the hands of 4 major companies: * Verizon (115 million subscribers) * AT&T wireless (107 million subscribers) * Sprint/Nextel (56 million subscribers) * T-Mobile (owned by the German Deutsche Telekom) (43 million subscribers) There's no way to stop it, since those communications are required to send and receive calls and do things like show your signal strength. As it turns out, it's [https://events.ccc.de/congress/2010/Fahrplan/events/4208.en.html not difficult] to snoop on these communications either. As an aside, you're much better off with GSM than CDMA, since GSM is an industry standard used in most other countries, and allows you much more freedom than CDMA to decide your network.[http://www.pcmag.com/article2/0,2817,2407896,00.asp] Although you can't stop what goes over the air, you should be able to control what your phone is doing. Surprisingly, most people have very little control over that. Take the early battles over Apple customers trying to unlock their iPhones[http://www.engadget.com/2010/05/10/confirmed-apple-and-atandt-signed-five-year-iphone-exclusivity-de/] or the countless folks who have to throw away their cell phones to switch carriers, or even the silly skirmishes over carriers locking functionality out of your phone that they don't want you to use. My old Sprint phone wouldn't let me download a free MP3 and use it as a ringtone, because there was a Sprint `store' for that! Can your cell-phone carrier tell you what to do with your own device? Your carrier would like to think so, because it gives them total control over you. It's actually well-known that the communication chip in almost all smartphones will send location data to any network request they get[https://www.techdirt.com/articles/20130723/12395923907/even-powering-down-cell-phone-cant-keep-nsa-tracking-its-location.shtml][https://en.wikipedia.org/wiki/Radio_resource_location_services_protocol], or, if it can, remotely activate the microphone and camera to listen-in on you. Wired's 2014 interview with Snowden revealed the juicy detail[http://www.wired.com/2014/08/edward-snowden/] "Snowden’s handlers repeatedly warned me that, even switched off, a cell phone can easily be turned into an NSA microphone." It's the un-reviewable, un-editable firmware, according to Richard Stallman, that make cellphones "[http://www.networkworld.com/article/2200967/software/cell-phones-are--stalin-s-dream---says-free-software-movement-founder.html Stalin's dream]". Add to that the fact that you're paying (in most cases in excess of $40/moth) for this `service', and I don't understand why most `customers' are happy. Luckily, there are some steps that you can take to get your freedom back. The first is to buy your own phone, like not from the 4 company stores above or in any version that comes with a service plan. Yes, there is an upfront cost, but it's not the $600 they scare everyone with. In fact, it can be much less than what you'll end up paying for the same phone if you buy it with a service plan. If you can tolerate their data-collecting agenda, Google directly sells some of the cheapest full-featured phones around[http://www.google.com/nexus/]. The way it works is that they write some hardware specifications, and convince manufacturers to put the phones together and sell near cost. You can also find tons of them on [http://www.newegg.com/Cell-Phones-Unlocked/Category/ID-249 Newegg] under "unlocked phones", like the ZTE Nubia for $240. Make sure it's one that wasn't previously locked and takes a GSM card. Locked means the phone was made in collaboration with a service provider, and contains software to lock you out of the phone and keep you on their network (remember the Microsoft bundling that became the subject of anti-trust lawsuits?). Also, check that it runs Android and that it's supported if you intend to switch to Cyanogenmod or Replicant. There may yet be hope for the OpenMoko project, one of the few out there working to undo the damage done by proprietary communication hardware[http://lists.openmoko.org/pipermail/community/2011-September/065493.html]. When it arrives, you will have a phone that is really like a small tablet computer and works without effort on your wireless network. How do you get it to make calls? Simple - you [https://support.google.com/nexus/answer/2809810?hl=en install a SIM card]. Most carriers are more than happy to put you on their network, and will sell you a SIM card for around $9. Some will give the card away as a promotion. While you're looking, service providers will constantly try to fleece you with monthly plans. Whatever you do, stay away from them. I was on T-Mobile's prepaid plan for a few years and only needed < 100 minutes per month. I got that for less than $10 per month by using a $100 prepaid card for each year. Web browsing, apps, email, navigation, and maps all worked great (and for free) on wifi. Sadly, T-Mobile takes your minutes away if you don't buy a card every year, so I started looking for a new carrier. Their customer service is even worse than Delta when they've lost your luggage (long story), so I'm leaving. No contract, no fees, no broken phone, no worries. Enter [https://z219s549ajb.ting.com/ Ting]. Ting has to buy its bandwidth from the big carriers (mostly Sprint and T-Mobile), but understands the struggle, and ships their GSM card for $9 + $5 shipping. According to their FAQ, "SM devices purchased from Ting will come automatically unlocked. " [https://help.ting.com/hc/en-us/articles/205428208-FAQ-Ting-SIM-Cards]. Pop out T-Mobile, pop in Ting. Like any utility, they send a monthly bill with a $6 service fee, ~$4 in taxes, and usage fees at around 1.8 cents per Mb (1 minute is like 1 Mb). So, I get an upgrade that works out to around $16 per month - win/win. [https://republicwireless.com Republic Wireless] may be a close contender, but requires you to buy a custom phone from them with firmware support for their implementation of WiFi hybrid calling. Finally, there's that nagging software control issue. Since the core functionality of the phone is a GSM modem and a Wifi Card, and these things are only available as monolithic (black-box) chips with proprietary firmware and interfaces under NDA-s, there's really no getting around the issue. However, a good OS will isolate you from the vagaries of these devices, should you choose to turn them off. If worry about these parts of the code Google puts on the Nexus phones, the [http://www.replicant.us/ Replicant] project is working to free everything they can and support better isolation [http://www.linux-magazine.com/Online/Features/Replicant-The-Struggle-for-Free-Mobile]. They do not, however, try to support 3D graphics acceleration or the use of extra processors (Nexus IR mobile payment technology, etc.). Should you crave these things, you might look into [http://www.cyanogenmod.org/ Cyanogenmod], or even the near total isolation of the [https://neo900.org/ Neo900]. d9a8a6efc097d5e7d49e3a788257221e749528a5 PChemFall2015 0 74 356 2015-08-19T19:07:42Z David M. Rogers 2 Created page with "'''<BIG>Physical Chemistry I</BIG>''' Course Info * Course Numbers CHM 4410 * Credit Hours: 4 * Meeting Dates: Aug. 25 - Dec. 4, 2015 ** No Class Nov. 26 & 27 * Meeting Times..." wikitext text/x-wiki '''<BIG>Physical Chemistry I</BIG>''' Course Info * Course Numbers CHM 4410 * Credit Hours: 4 * Meeting Dates: Aug. 25 - Dec. 4, 2015 ** No Class Nov. 26 & 27 * Meeting Times: Tues. and Thurs., 3:30-4:45 pm in Muma College of Business, 1403 ** Problem Session: Fri., 10:10-11:00 am in CHE303 ** Office Hours: Tues. and Thurs., 2:30-3:30 pm in SCA 433 * Grading: ** Quiz (40%) *** To succeed in the quiz, do assigned homework. ** Midterm (30%) Thurs., Oct. 8, 3:30-4:45 pm ** Final (30%) Thurs., Dec. 10, 12:30-2:30 pm == Overview == This is the first part of a 2-semester course in thermodynamics. This course will cover the mathematical theory of chemical equilibrium, heat, and work. These are the driving forces behind the operation of Le Châtelier's principle, and are routinely used to understand and control chemical reactions, states of matter, and amount and efficiency of energy production. == Textbooks == * McQuarrie and Simon, Physical Chemistry: A Molecular Approach, University Science Books, 1997. ISBN: 0935702997. == Topics == # Partial Differentiation # First Law of Thermodynamics # Algebraic Methods # Energy, Enthalpy, Entropy, and Free Energy # Counting Statistics # The Second Law of Thermodynamics # Standard States and Energies - Third Law of Thermodynamics # Phase Equilibria and Basic Phase Diagrams # Thermodynamic Cycles, Examples with Refrigeration and Galvanic Cells === Notes & Homework === * TBA 9f21127ac361bdf75097f2579926e7dd69490b6e 357 356 2015-08-25T23:59:09Z David M. Rogers 2 /* Notes & Homework */ wikitext text/x-wiki '''<BIG>Physical Chemistry I</BIG>''' Course Info * Course Numbers CHM 4410 * Credit Hours: 4 * Meeting Dates: Aug. 25 - Dec. 4, 2015 ** No Class Nov. 26 & 27 * Meeting Times: Tues. and Thurs., 3:30-4:45 pm in Muma College of Business, 1403 ** Problem Session: Fri., 10:10-11:00 am in CHE303 ** Office Hours: Tues. and Thurs., 2:30-3:30 pm in SCA 433 * Grading: ** Quiz (40%) *** To succeed in the quiz, do assigned homework. ** Midterm (30%) Thurs., Oct. 8, 3:30-4:45 pm ** Final (30%) Thurs., Dec. 10, 12:30-2:30 pm == Overview == This is the first part of a 2-semester course in thermodynamics. This course will cover the mathematical theory of chemical equilibrium, heat, and work. These are the driving forces behind the operation of Le Châtelier's principle, and are routinely used to understand and control chemical reactions, states of matter, and amount and efficiency of energy production. == Textbooks == * McQuarrie and Simon, Physical Chemistry: A Molecular Approach, University Science Books, 1997. ISBN: 0935702997. == Topics == # Partial Differentiation # First Law of Thermodynamics # Algebraic Methods # Energy, Enthalpy, Entropy, and Free Energy # Counting Statistics # The Second Law of Thermodynamics # Standard States and Energies - Third Law of Thermodynamics # Phase Equilibria and Basic Phase Diagrams # Thermodynamic Cycles, Examples with Refrigeration and Galvanic Cells === Notes & Homework === * [[File:intro_slides.pdf|Introduction to P-Chem]] 357eb543536de202e3681037c9963e9e635cf75a 359 357 2015-08-26T00:02:22Z David M. Rogers 2 /* Notes & Homework */ wikitext text/x-wiki '''<BIG>Physical Chemistry I</BIG>''' Course Info * Course Numbers CHM 4410 * Credit Hours: 4 * Meeting Dates: Aug. 25 - Dec. 4, 2015 ** No Class Nov. 26 & 27 * Meeting Times: Tues. and Thurs., 3:30-4:45 pm in Muma College of Business, 1403 ** Problem Session: Fri., 10:10-11:00 am in CHE303 ** Office Hours: Tues. and Thurs., 2:30-3:30 pm in SCA 433 * Grading: ** Quiz (40%) *** To succeed in the quiz, do assigned homework. ** Midterm (30%) Thurs., Oct. 8, 3:30-4:45 pm ** Final (30%) Thurs., Dec. 10, 12:30-2:30 pm == Overview == This is the first part of a 2-semester course in thermodynamics. This course will cover the mathematical theory of chemical equilibrium, heat, and work. These are the driving forces behind the operation of Le Châtelier's principle, and are routinely used to understand and control chemical reactions, states of matter, and amount and efficiency of energy production. == Textbooks == * McQuarrie and Simon, Physical Chemistry: A Molecular Approach, University Science Books, 1997. ISBN: 0935702997. == Topics == # Partial Differentiation # First Law of Thermodynamics # Algebraic Methods # Energy, Enthalpy, Entropy, and Free Energy # Counting Statistics # The Second Law of Thermodynamics # Standard States and Energies - Third Law of Thermodynamics # Phase Equilibria and Basic Phase Diagrams # Thermodynamic Cycles, Examples with Refrigeration and Galvanic Cells === Notes & Homework === * [[Media:intro_slides.pdf|Introduction to P-Chem]] fe02b81690b3ed250c65e0843418ed46cc2edf60 360 359 2015-08-27T18:29:51Z David M. Rogers 2 /* Notes & Homework */ wikitext text/x-wiki '''<BIG>Physical Chemistry I</BIG>''' Course Info * Course Numbers CHM 4410 * Credit Hours: 4 * Meeting Dates: Aug. 25 - Dec. 4, 2015 ** No Class Nov. 26 & 27 * Meeting Times: Tues. and Thurs., 3:30-4:45 pm in Muma College of Business, 1403 ** Problem Session: Fri., 10:10-11:00 am in CHE303 ** Office Hours: Tues. and Thurs., 2:30-3:30 pm in SCA 433 * Grading: ** Quiz (40%) *** To succeed in the quiz, do assigned homework. ** Midterm (30%) Thurs., Oct. 8, 3:30-4:45 pm ** Final (30%) Thurs., Dec. 10, 12:30-2:30 pm == Overview == This is the first part of a 2-semester course in thermodynamics. This course will cover the mathematical theory of chemical equilibrium, heat, and work. These are the driving forces behind the operation of Le Châtelier's principle, and are routinely used to understand and control chemical reactions, states of matter, and amount and efficiency of energy production. == Textbooks == * McQuarrie and Simon, Physical Chemistry: A Molecular Approach, University Science Books, 1997. ISBN: 0935702997. == Topics == # Partial Differentiation # First Law of Thermodynamics # Algebraic Methods # Energy, Enthalpy, Entropy, and Free Energy # Counting Statistics # The Second Law of Thermodynamics # Standard States and Energies - Third Law of Thermodynamics # Phase Equilibria and Basic Phase Diagrams # Thermodynamic Cycles, Examples with Refrigeration and Galvanic Cells === Notes & Homework === * [[Media:intro_slides.pdf|Introduction to P-Chem]] * Homework 1: 16-1 through 16-7, 16-9, H-1, H-4 through H-6, H-10, H-11, 27-1 through 27-7 315292a3b99badacc65322f4e9de72087535d28e File:Intro slides.pdf 6 75 358 2015-08-25T23:59:42Z David M. Rogers 2 wikitext text/x-wiki da39a3ee5e6b4b0d3255bfef95601890afd80709 PChemFall2015 0 74 361 360 2015-08-27T19:14:56Z David M. Rogers 2 /* Notes & Homework */ wikitext text/x-wiki '''<BIG>Physical Chemistry I</BIG>''' Course Info * Course Numbers CHM 4410 * Credit Hours: 4 * Meeting Dates: Aug. 25 - Dec. 4, 2015 ** No Class Nov. 26 & 27 * Meeting Times: Tues. and Thurs., 3:30-4:45 pm in Muma College of Business, 1403 ** Problem Session: Fri., 10:10-11:00 am in CHE303 ** Office Hours: Tues. and Thurs., 2:30-3:30 pm in SCA 433 * Grading: ** Quiz (40%) *** To succeed in the quiz, do assigned homework. ** Midterm (30%) Thurs., Oct. 8, 3:30-4:45 pm ** Final (30%) Thurs., Dec. 10, 12:30-2:30 pm == Overview == This is the first part of a 2-semester course in thermodynamics. This course will cover the mathematical theory of chemical equilibrium, heat, and work. These are the driving forces behind the operation of Le Châtelier's principle, and are routinely used to understand and control chemical reactions, states of matter, and amount and efficiency of energy production. == Textbooks == * McQuarrie and Simon, Physical Chemistry: A Molecular Approach, University Science Books, 1997. ISBN: 0935702997. == Topics == # Partial Differentiation # First Law of Thermodynamics # Algebraic Methods # Energy, Enthalpy, Entropy, and Free Energy # Counting Statistics # The Second Law of Thermodynamics # Standard States and Energies - Third Law of Thermodynamics # Phase Equilibria and Basic Phase Diagrams # Thermodynamic Cycles, Examples with Refrigeration and Galvanic Cells === Notes & Homework === * [[Media:intro_slides.pdf|Introduction to P-Chem]] * Homework 1: 16-1 through 16-7, 16-9, H-1, H-4 through H-6, H-10, H-11, 27-1 through 27-7 ** Does the vdW equation of state make a prediction for the density of liquid H2? ** What is a critical temperature? ** Who is Fritz London? 235ba95ce1b44266ba0d82bc0583c0f93f7df99e 362 361 2015-08-27T21:15:29Z David M. Rogers 2 /* Notes & Homework */ wikitext text/x-wiki '''<BIG>Physical Chemistry I</BIG>''' Course Info * Course Numbers CHM 4410 * Credit Hours: 4 * Meeting Dates: Aug. 25 - Dec. 4, 2015 ** No Class Nov. 26 & 27 * Meeting Times: Tues. and Thurs., 3:30-4:45 pm in Muma College of Business, 1403 ** Problem Session: Fri., 10:10-11:00 am in CHE303 ** Office Hours: Tues. and Thurs., 2:30-3:30 pm in SCA 433 * Grading: ** Quiz (40%) *** To succeed in the quiz, do assigned homework. ** Midterm (30%) Thurs., Oct. 8, 3:30-4:45 pm ** Final (30%) Thurs., Dec. 10, 12:30-2:30 pm == Overview == This is the first part of a 2-semester course in thermodynamics. This course will cover the mathematical theory of chemical equilibrium, heat, and work. These are the driving forces behind the operation of Le Châtelier's principle, and are routinely used to understand and control chemical reactions, states of matter, and amount and efficiency of energy production. == Textbooks == * McQuarrie and Simon, Physical Chemistry: A Molecular Approach, University Science Books, 1997. ISBN: 0935702997. == Topics == # Partial Differentiation # First Law of Thermodynamics # Algebraic Methods # Energy, Enthalpy, Entropy, and Free Energy # Counting Statistics # The Second Law of Thermodynamics # Standard States and Energies - Third Law of Thermodynamics # Phase Equilibria and Basic Phase Diagrams # Thermodynamic Cycles, Examples with Refrigeration and Galvanic Cells === Notes & Homework === * [[Media:intro_slides.pdf|Introduction to P-Chem]] * [[Media:CO2.xls|Excel plot and V-solve]] for van der Waals Equation of State * Homework 1: 16-1 through 16-7, 16-9, H-1, H-4 through H-6, H-10, H-11, 27-1 through 27-7 ** Does the vdW equation of state make a prediction for the density of liquid H2? ** What is a critical temperature? ** Who is Fritz London? 06f4382ed318b5ed9f112df963fdc2eeaaeed565 364 362 2015-08-27T21:18:31Z David M. Rogers 2 /* Notes & Homework */ wikitext text/x-wiki '''<BIG>Physical Chemistry I</BIG>''' Course Info * Course Numbers CHM 4410 * Credit Hours: 4 * Meeting Dates: Aug. 25 - Dec. 4, 2015 ** No Class Nov. 26 & 27 * Meeting Times: Tues. and Thurs., 3:30-4:45 pm in Muma College of Business, 1403 ** Problem Session: Fri., 10:10-11:00 am in CHE303 ** Office Hours: Tues. and Thurs., 2:30-3:30 pm in SCA 433 * Grading: ** Quiz (40%) *** To succeed in the quiz, do assigned homework. ** Midterm (30%) Thurs., Oct. 8, 3:30-4:45 pm ** Final (30%) Thurs., Dec. 10, 12:30-2:30 pm == Overview == This is the first part of a 2-semester course in thermodynamics. This course will cover the mathematical theory of chemical equilibrium, heat, and work. These are the driving forces behind the operation of Le Châtelier's principle, and are routinely used to understand and control chemical reactions, states of matter, and amount and efficiency of energy production. == Textbooks == * McQuarrie and Simon, Physical Chemistry: A Molecular Approach, University Science Books, 1997. ISBN: 0935702997. == Topics == # Partial Differentiation # First Law of Thermodynamics # Algebraic Methods # Energy, Enthalpy, Entropy, and Free Energy # Counting Statistics # The Second Law of Thermodynamics # Standard States and Energies - Third Law of Thermodynamics # Phase Equilibria and Basic Phase Diagrams # Thermodynamic Cycles, Examples with Refrigeration and Galvanic Cells === Notes & Homework === * [[Media:intro_slides.pdf|Introduction to P-Chem]] * [[Media:CO2.xlsx|Excel plot and V-solve]] for van der Waals Equation of State * Homework 1: 16-1 through 16-7, 16-9, H-1, H-4 through H-6, H-10, H-11, 27-1 through 27-7 ** Does the vdW equation of state make a prediction for the density of liquid H2? ** What is a critical temperature? ** Who is Fritz London? fb1b5740efc03460c9c90e075b44158080945d5d 365 364 2015-08-27T21:23:38Z David M. Rogers 2 /* Notes & Homework */ wikitext text/x-wiki '''<BIG>Physical Chemistry I</BIG>''' Course Info * Course Numbers CHM 4410 * Credit Hours: 4 * Meeting Dates: Aug. 25 - Dec. 4, 2015 ** No Class Nov. 26 & 27 * Meeting Times: Tues. and Thurs., 3:30-4:45 pm in Muma College of Business, 1403 ** Problem Session: Fri., 10:10-11:00 am in CHE303 ** Office Hours: Tues. and Thurs., 2:30-3:30 pm in SCA 433 * Grading: ** Quiz (40%) *** To succeed in the quiz, do assigned homework. ** Midterm (30%) Thurs., Oct. 8, 3:30-4:45 pm ** Final (30%) Thurs., Dec. 10, 12:30-2:30 pm == Overview == This is the first part of a 2-semester course in thermodynamics. This course will cover the mathematical theory of chemical equilibrium, heat, and work. These are the driving forces behind the operation of Le Châtelier's principle, and are routinely used to understand and control chemical reactions, states of matter, and amount and efficiency of energy production. == Textbooks == * McQuarrie and Simon, Physical Chemistry: A Molecular Approach, University Science Books, 1997. ISBN: 0935702997. == Topics == # Partial Differentiation # First Law of Thermodynamics # Algebraic Methods # Energy, Enthalpy, Entropy, and Free Energy # Counting Statistics # The Second Law of Thermodynamics # Standard States and Energies - Third Law of Thermodynamics # Phase Equilibria and Basic Phase Diagrams # Thermodynamic Cycles, Examples with Refrigeration and Galvanic Cells === Notes & Homework === * [[Media:intro_slides.pdf|Introduction to P-Chem]] * [[Media:CO2.xlsx|Excel plot and V-solve]] for van der Waals Equation of State ** Works fine with [https://www.libreoffice.org LibreOffice] * Homework 1: 16-1 through 16-7, 16-9, H-1, H-4 through H-6, H-10, H-11, 27-1 through 27-7 ** Does the vdW equation of state make a prediction for the density of liquid H2? ** What is a critical temperature? ** Who is Fritz London? 25e3ca4343b646ce329e645bbc73ab765eb5a9c2 367 365 2015-09-03T19:18:10Z David M. Rogers 2 wikitext text/x-wiki '''<BIG>Physical Chemistry I</BIG>''' Course Info * Course Numbers CHM 4410 * Credit Hours: 4 * Meeting Dates: Aug. 25 - Dec. 4, 2015 ** No Class Nov. 26 & 27 * Meeting Times: Tues. and Thurs., 3:30-4:45 pm in Muma College of Business, 1403 ** Problem Session: Fri., 10:10-11:00 am in CHE303 ** Office Hours: Tues. and Thurs., 2:30-3:30 pm in SCA 433 * Grading: ** Quiz (40%) *** To succeed in the quiz, do assigned homework. ** Midterm (30%) Thurs., Oct. 8, 3:30-4:45 pm ** Final (30%) Thurs., Dec. 10, 12:30-2:30 pm == Overview == This is the first part of a 2-semester course in thermodynamics. This course will cover the mathematical theory of chemical equilibrium, heat, and work. These are the driving forces behind the operation of Le Châtelier's principle, and are routinely used to understand and control chemical reactions, states of matter, and amount and efficiency of energy production. == Textbooks == * McQuarrie and Simon, Physical Chemistry: A Molecular Approach, University Science Books, 1997. ISBN: 0935702997. == Resources == * [http://hyperphysics.phy-astr.gsu.edu/hbase/kinetic/ktcon.html Kinetic Theory] at HyperPhysics * [http://hyperphysics.phy-astr.gsu.edu/hbase/heacon.html Heat Concepts] at HyperPhysics ** Note: McQuarrie says dU = dQ + dW, while Nave says dU = dQ - dW. There is no contradiction, since McQuarrie's dW = -P dV (work done on the system), while Nave's dW = P dV (work done by the system). I prefer the first definition. == Topics == # Partial Differentiation # First Law of Thermodynamics # Algebraic Methods # Energy, Enthalpy, Entropy, and Free Energy # Counting Statistics # The Second Law of Thermodynamics # Standard States and Energies - Third Law of Thermodynamics # Phase Equilibria and Basic Phase Diagrams # Thermodynamic Cycles, Examples with Refrigeration and Galvanic Cells === Notes & Homework === * [[Media:intro_slides.pdf|Introduction to P-Chem]] * [[Media:CO2.xlsx|Excel plot and V-solve]] for van der Waals Equation of State ** Works fine with [https://www.libreoffice.org LibreOffice] * Homework 1: 16-1 through 16-7, 16-9, H-1, H-4 through H-6, H-10, H-11, 27-1 through 27-7 ** Does the vdW equation of state make a prediction for the density of liquid H2? ** What is a critical temperature? ** Who is Fritz London? * Homework 2: G-1, G-5, H-12, H-13, 16-31 through 16-32, 16-37, 16-38 through 16-40, 16-44, 16-55, 16-56 3e86f2181bdaf75922138c563f8722eb67550820 368 367 2015-09-11T12:45:13Z David M. Rogers 2 /* Notes & Homework */ wikitext text/x-wiki '''<BIG>Physical Chemistry I</BIG>''' Course Info * Course Numbers CHM 4410 * Credit Hours: 4 * Meeting Dates: Aug. 25 - Dec. 4, 2015 ** No Class Nov. 26 & 27 * Meeting Times: Tues. and Thurs., 3:30-4:45 pm in Muma College of Business, 1403 ** Problem Session: Fri., 10:10-11:00 am in CHE303 ** Office Hours: Tues. and Thurs., 2:30-3:30 pm in SCA 433 * Grading: ** Quiz (40%) *** To succeed in the quiz, do assigned homework. ** Midterm (30%) Thurs., Oct. 8, 3:30-4:45 pm ** Final (30%) Thurs., Dec. 10, 12:30-2:30 pm == Overview == This is the first part of a 2-semester course in thermodynamics. This course will cover the mathematical theory of chemical equilibrium, heat, and work. These are the driving forces behind the operation of Le Châtelier's principle, and are routinely used to understand and control chemical reactions, states of matter, and amount and efficiency of energy production. == Textbooks == * McQuarrie and Simon, Physical Chemistry: A Molecular Approach, University Science Books, 1997. ISBN: 0935702997. == Resources == * [http://hyperphysics.phy-astr.gsu.edu/hbase/kinetic/ktcon.html Kinetic Theory] at HyperPhysics * [http://hyperphysics.phy-astr.gsu.edu/hbase/heacon.html Heat Concepts] at HyperPhysics ** Note: McQuarrie says dU = dQ + dW, while Nave says dU = dQ - dW. There is no contradiction, since McQuarrie's dW = -P dV (work done on the system), while Nave's dW = P dV (work done by the system). I prefer the first definition. == Topics == # Partial Differentiation # First Law of Thermodynamics # Algebraic Methods # Energy, Enthalpy, Entropy, and Free Energy # Counting Statistics # The Second Law of Thermodynamics # Standard States and Energies - Third Law of Thermodynamics # Phase Equilibria and Basic Phase Diagrams # Thermodynamic Cycles, Examples with Refrigeration and Galvanic Cells === Notes & Homework === * [[Media:intro_slides.pdf|Introduction to P-Chem]] * [[Media:CO2.xlsx|Excel plot and V-solve]] for van der Waals Equation of State ** Works fine with [https://www.libreoffice.org LibreOffice] * Homework 1: 16-1 through 16-7, 16-9, H-1, H-4 through H-6, H-10, H-11, 27-1 through 27-7 ** Does the vdW equation of state make a prediction for the density of liquid H2? ** What is a critical temperature? ** Who is Fritz London? * Homework 2: G-1, G-5, H-12, H-13, 16-31 through 16-32, 16-37, 16-38 through 16-40, 16-44, 16-55, 16-56 * Homework 3: ** Use the [[Media:LJ.xlsx|Lennard Jones]] spreadsheet for the following: **# Plot Vc vs sigma^3 to find the correlation between the two. **# Compute the exact derivative of the Lennard-Jones function for each r in column M, and compare the results to the numerical approximation in column L. **# Decrease the x-spacing, dx, in the numerical integration of B2v to 0.05. How does the result change? ** Use the [[Media:two_state_model.xlsx|2 state model]] spreadsheet for the following (DG is an abbreviation for Delta G of folding): **# Fit a line to DG(T) = DH - T DS **# Compute the average of d(beta DG)/dbeta **# Compute and plot d(beta DG) / d(beta P) - this should give you an effective folding volume **# Compute and plot d(DG) / d[Urea] - this should give you the energetic influence of urea 8b51c354cc91ee6b2440f9aec9703a92a16c8107 371 368 2015-09-11T12:47:18Z David M. Rogers 2 /* Resources */ wikitext text/x-wiki '''<BIG>Physical Chemistry I</BIG>''' Course Info * Course Numbers CHM 4410 * Credit Hours: 4 * Meeting Dates: Aug. 25 - Dec. 4, 2015 ** No Class Nov. 26 & 27 * Meeting Times: Tues. and Thurs., 3:30-4:45 pm in Muma College of Business, 1403 ** Problem Session: Fri., 10:10-11:00 am in CHE303 ** Office Hours: Tues. and Thurs., 2:30-3:30 pm in SCA 433 * Grading: ** Quiz (40%) *** To succeed in the quiz, do assigned homework. ** Midterm (30%) Thurs., Oct. 8, 3:30-4:45 pm ** Final (30%) Thurs., Dec. 10, 12:30-2:30 pm == Overview == This is the first part of a 2-semester course in thermodynamics. This course will cover the mathematical theory of chemical equilibrium, heat, and work. These are the driving forces behind the operation of Le Châtelier's principle, and are routinely used to understand and control chemical reactions, states of matter, and amount and efficiency of energy production. == Textbooks == * McQuarrie and Simon, Physical Chemistry: A Molecular Approach, University Science Books, 1997. ISBN: 0935702997. == Resources == * [http://hyperphysics.phy-astr.gsu.edu/hbase/kinetic/ktcon.html Kinetic Theory] at HyperPhysics * [http://hyperphysics.phy-astr.gsu.edu/hbase/heacon.html Heat Concepts] at HyperPhysics ** Note: McQuarrie says dU = dQ + dW, while Nave says dU = dQ - dW. There is no contradiction, since McQuarrie's dW = -P dV (work done on the system), while Nave's dW = P dV (work done by the system). I prefer the first definition. == Topics == # Partial Differentiation # First Law of Thermodynamics # Algebraic Methods # Energy, Enthalpy, Entropy, and Free Energy # Counting Statistics # The Second Law of Thermodynamics # Standard States and Energies - Third Law of Thermodynamics # Phase Equilibria and Basic Phase Diagrams # Thermodynamic Cycles, Examples with Refrigeration and Galvanic Cells === Notes & Homework === * [[Media:intro_slides.pdf|Introduction to P-Chem]] * [[Media:CO2.xlsx|Excel plot and V-solve]] for van der Waals Equation of State ** Works fine with [https://www.libreoffice.org LibreOffice] * Homework 1: 16-1 through 16-7, 16-9, H-1, H-4 through H-6, H-10, H-11, 27-1 through 27-7 ** Does the vdW equation of state make a prediction for the density of liquid H2? ** What is a critical temperature? ** Who is Fritz London? * Homework 2: G-1, G-5, H-12, H-13, 16-31 through 16-32, 16-37, 16-38 through 16-40, 16-44, 16-55, 16-56 * Homework 3: ** Use the [[Media:LJ.xlsx|Lennard Jones]] spreadsheet for the following: **# Plot Vc vs sigma^3 to find the correlation between the two. **# Compute the exact derivative of the Lennard-Jones function for each r in column M, and compare the results to the numerical approximation in column L. **# Decrease the x-spacing, dx, in the numerical integration of B2v to 0.05. How does the result change? ** Use the [[Media:two_state_model.xlsx|2 state model]] spreadsheet for the following (DG is an abbreviation for Delta G of folding): **# Fit a line to DG(T) = DH - T DS **# Compute the average of d(beta DG)/dbeta **# Compute and plot d(beta DG) / d(beta P) - this should give you an effective folding volume **# Compute and plot d(DG) / d[Urea] - this should give you the energetic influence of urea 8f529518dbeebe907080c6b0e2be5c9333619154 373 371 2015-09-18T03:17:44Z David M. Rogers 2 /* Notes & Homework */ wikitext text/x-wiki '''<BIG>Physical Chemistry I</BIG>''' Course Info * Course Numbers CHM 4410 * Credit Hours: 4 * Meeting Dates: Aug. 25 - Dec. 4, 2015 ** No Class Nov. 26 & 27 * Meeting Times: Tues. and Thurs., 3:30-4:45 pm in Muma College of Business, 1403 ** Problem Session: Fri., 10:10-11:00 am in CHE303 ** Office Hours: Tues. and Thurs., 2:30-3:30 pm in SCA 433 * Grading: ** Quiz (40%) *** To succeed in the quiz, do assigned homework. ** Midterm (30%) Thurs., Oct. 8, 3:30-4:45 pm ** Final (30%) Thurs., Dec. 10, 12:30-2:30 pm == Overview == This is the first part of a 2-semester course in thermodynamics. This course will cover the mathematical theory of chemical equilibrium, heat, and work. These are the driving forces behind the operation of Le Châtelier's principle, and are routinely used to understand and control chemical reactions, states of matter, and amount and efficiency of energy production. == Textbooks == * McQuarrie and Simon, Physical Chemistry: A Molecular Approach, University Science Books, 1997. ISBN: 0935702997. == Resources == * [http://hyperphysics.phy-astr.gsu.edu/hbase/kinetic/ktcon.html Kinetic Theory] at HyperPhysics * [http://hyperphysics.phy-astr.gsu.edu/hbase/heacon.html Heat Concepts] at HyperPhysics ** Note: McQuarrie says dU = dQ + dW, while Nave says dU = dQ - dW. There is no contradiction, since McQuarrie's dW = -P dV (work done on the system), while Nave's dW = P dV (work done by the system). I prefer the first definition. == Topics == # Partial Differentiation # First Law of Thermodynamics # Algebraic Methods # Energy, Enthalpy, Entropy, and Free Energy # Counting Statistics # The Second Law of Thermodynamics # Standard States and Energies - Third Law of Thermodynamics # Phase Equilibria and Basic Phase Diagrams # Thermodynamic Cycles, Examples with Refrigeration and Galvanic Cells === Notes & Homework === Here are the running [[Media:notes.pdf|notes]] for the course. You can check the file date to see when there have been updates. * [[Media:intro_slides.pdf|Introduction to P-Chem]] * [[Media:CO2.xlsx|Excel plot and V-solve]] for van der Waals Equation of State ** Works fine with [https://www.libreoffice.org LibreOffice] * Homework 1: 16-1 through 16-7, 16-9, H-1, H-4 through H-6, H-10, H-11, 27-1 through 27-7 ** Does the vdW equation of state make a prediction for the density of liquid H2? ** What is a critical temperature? ** Who is Fritz London? * Homework 2: G-1, G-5, H-12, H-13, 16-31 through 16-32, 16-37, 16-38 through 16-40, 16-44, 16-55, 16-56 * Homework 3: ** Use the [[Media:LJ.xlsx|Lennard Jones]] spreadsheet for the following: **# Plot Vc vs sigma^3 to find the correlation between the two. **# Compute the exact derivative of the Lennard-Jones function for each r in column M, and compare the results to the numerical approximation in column L. **# Decrease the x-spacing, dx, in the numerical integration of B2v to 0.05. How does the result change? ** Use the [[Media:two_state_model.xlsx|2 state model]] spreadsheet for the following (DG is an abbreviation for Delta G of folding): **# Fit a line to DG(T) = DH - T DS **# Compute the average of d(beta DG)/dbeta **# Compute and plot d(beta DG) / d(beta P) - this should give you an effective folding volume **# Compute and plot d(DG) / d[Urea] - this should give you the energetic influence of urea * Homework 4 (to appear on Quiz 4): ** Chapter 19: 1-7, 9, 19, 29-31 ** For 19-3, remember to solve for P = P(V) c3a9f94ed4653d95b9d80d4853d22b94a06d808a 374 373 2015-09-18T03:17:55Z David M. Rogers 2 /* Notes & Homework */ wikitext text/x-wiki '''<BIG>Physical Chemistry I</BIG>''' Course Info * Course Numbers CHM 4410 * Credit Hours: 4 * Meeting Dates: Aug. 25 - Dec. 4, 2015 ** No Class Nov. 26 & 27 * Meeting Times: Tues. and Thurs., 3:30-4:45 pm in Muma College of Business, 1403 ** Problem Session: Fri., 10:10-11:00 am in CHE303 ** Office Hours: Tues. and Thurs., 2:30-3:30 pm in SCA 433 * Grading: ** Quiz (40%) *** To succeed in the quiz, do assigned homework. ** Midterm (30%) Thurs., Oct. 8, 3:30-4:45 pm ** Final (30%) Thurs., Dec. 10, 12:30-2:30 pm == Overview == This is the first part of a 2-semester course in thermodynamics. This course will cover the mathematical theory of chemical equilibrium, heat, and work. These are the driving forces behind the operation of Le Châtelier's principle, and are routinely used to understand and control chemical reactions, states of matter, and amount and efficiency of energy production. == Textbooks == * McQuarrie and Simon, Physical Chemistry: A Molecular Approach, University Science Books, 1997. ISBN: 0935702997. == Resources == * [http://hyperphysics.phy-astr.gsu.edu/hbase/kinetic/ktcon.html Kinetic Theory] at HyperPhysics * [http://hyperphysics.phy-astr.gsu.edu/hbase/heacon.html Heat Concepts] at HyperPhysics ** Note: McQuarrie says dU = dQ + dW, while Nave says dU = dQ - dW. There is no contradiction, since McQuarrie's dW = -P dV (work done on the system), while Nave's dW = P dV (work done by the system). I prefer the first definition. == Topics == # Partial Differentiation # First Law of Thermodynamics # Algebraic Methods # Energy, Enthalpy, Entropy, and Free Energy # Counting Statistics # The Second Law of Thermodynamics # Standard States and Energies - Third Law of Thermodynamics # Phase Equilibria and Basic Phase Diagrams # Thermodynamic Cycles, Examples with Refrigeration and Galvanic Cells === Notes & Homework === Here are the running [[Media:notes.pdf|notes]] for the course. You can check the file date to see when there have been updates. * [[Media:intro_slides.pdf|Introduction to P-Chem]] * [[Media:CO2.xlsx|Excel plot and V-solve]] for van der Waals Equation of State ** Works fine with [https://www.libreoffice.org LibreOffice] * Homework 1: 16-1 through 16-7, 16-9, H-1, H-4 through H-6, H-10, H-11, 27-1 through 27-7 ** Does the vdW equation of state make a prediction for the density of liquid H2? ** What is a critical temperature? ** Who is Fritz London? * Homework 2: G-1, G-5, H-12, H-13, 16-31 through 16-32, 16-37, 16-38 through 16-40, 16-44, 16-55, 16-56 * Homework 3: ** Use the [[Media:LJ.xlsx|Lennard Jones]] spreadsheet for the following: **# Plot Vc vs sigma^3 to find the correlation between the two. **# Compute the exact derivative of the Lennard-Jones function for each r in column M, and compare the results to the numerical approximation in column L. **# Decrease the x-spacing, dx, in the numerical integration of B2v to 0.05. How does the result change? ** Use the [[Media:two_state_model.xlsx|2 state model]] spreadsheet for the following (DG is an abbreviation for Delta G of folding): **# Fit a line to DG(T) = DH - T DS **# Compute the average of d(beta DG)/dbeta **# Compute and plot d(beta DG) / d(beta P) - this should give you an effective folding volume **# Compute and plot d(DG) / d[Urea] - this should give you the energetic influence of urea * Homework 4 (to appear on Quiz 4): ** Chapter 19: 1-7, 9, 19, 29-31 ** For 19-3, remember to solve for P = P(V) efb6c1cfbdba7b008e88c891707d953760c213b6 375 374 2015-09-18T03:18:37Z David M. Rogers 2 /* Notes & Homework */ wikitext text/x-wiki '''<BIG>Physical Chemistry I</BIG>''' Course Info * Course Numbers CHM 4410 * Credit Hours: 4 * Meeting Dates: Aug. 25 - Dec. 4, 2015 ** No Class Nov. 26 & 27 * Meeting Times: Tues. and Thurs., 3:30-4:45 pm in Muma College of Business, 1403 ** Problem Session: Fri., 10:10-11:00 am in CHE303 ** Office Hours: Tues. and Thurs., 2:30-3:30 pm in SCA 433 * Grading: ** Quiz (40%) *** To succeed in the quiz, do assigned homework. ** Midterm (30%) Thurs., Oct. 8, 3:30-4:45 pm ** Final (30%) Thurs., Dec. 10, 12:30-2:30 pm == Overview == This is the first part of a 2-semester course in thermodynamics. This course will cover the mathematical theory of chemical equilibrium, heat, and work. These are the driving forces behind the operation of Le Châtelier's principle, and are routinely used to understand and control chemical reactions, states of matter, and amount and efficiency of energy production. == Textbooks == * McQuarrie and Simon, Physical Chemistry: A Molecular Approach, University Science Books, 1997. ISBN: 0935702997. == Resources == * [http://hyperphysics.phy-astr.gsu.edu/hbase/kinetic/ktcon.html Kinetic Theory] at HyperPhysics * [http://hyperphysics.phy-astr.gsu.edu/hbase/heacon.html Heat Concepts] at HyperPhysics ** Note: McQuarrie says dU = dQ + dW, while Nave says dU = dQ - dW. There is no contradiction, since McQuarrie's dW = -P dV (work done on the system), while Nave's dW = P dV (work done by the system). I prefer the first definition. == Topics == # Partial Differentiation # First Law of Thermodynamics # Algebraic Methods # Energy, Enthalpy, Entropy, and Free Energy # Counting Statistics # The Second Law of Thermodynamics # Standard States and Energies - Third Law of Thermodynamics # Phase Equilibria and Basic Phase Diagrams # Thermodynamic Cycles, Examples with Refrigeration and Galvanic Cells === Notes & Homework === Here are the running [[Media:pchem_notes.pdf|notes]] for the course. You can check the file date to see when there have been updates. * [[Media:intro_slides.pdf|Introduction to P-Chem]] * [[Media:CO2.xlsx|Excel plot and V-solve]] for van der Waals Equation of State ** Works fine with [https://www.libreoffice.org LibreOffice] * Homework 1: 16-1 through 16-7, 16-9, H-1, H-4 through H-6, H-10, H-11, 27-1 through 27-7 ** Does the vdW equation of state make a prediction for the density of liquid H2? ** What is a critical temperature? ** Who is Fritz London? * Homework 2: G-1, G-5, H-12, H-13, 16-31 through 16-32, 16-37, 16-38 through 16-40, 16-44, 16-55, 16-56 * Homework 3: ** Use the [[Media:LJ.xlsx|Lennard Jones]] spreadsheet for the following: **# Plot Vc vs sigma^3 to find the correlation between the two. **# Compute the exact derivative of the Lennard-Jones function for each r in column M, and compare the results to the numerical approximation in column L. **# Decrease the x-spacing, dx, in the numerical integration of B2v to 0.05. How does the result change? ** Use the [[Media:two_state_model.xlsx|2 state model]] spreadsheet for the following (DG is an abbreviation for Delta G of folding): **# Fit a line to DG(T) = DH - T DS **# Compute the average of d(beta DG)/dbeta **# Compute and plot d(beta DG) / d(beta P) - this should give you an effective folding volume **# Compute and plot d(DG) / d[Urea] - this should give you the energetic influence of urea * Homework 4 (to appear on Quiz 4): ** Chapter 19: 1-7, 9, 19, 29-31 ** For 19-3, remember to solve for P = P(V) a9437131b5ab496872b4ed2733b0dc28341d2ebc 381 375 2015-09-24T16:19:41Z David M. Rogers 2 /* Notes & Homework */ wikitext text/x-wiki '''<BIG>Physical Chemistry I</BIG>''' Course Info * Course Numbers CHM 4410 * Credit Hours: 4 * Meeting Dates: Aug. 25 - Dec. 4, 2015 ** No Class Nov. 26 & 27 * Meeting Times: Tues. and Thurs., 3:30-4:45 pm in Muma College of Business, 1403 ** Problem Session: Fri., 10:10-11:00 am in CHE303 ** Office Hours: Tues. and Thurs., 2:30-3:30 pm in SCA 433 * Grading: ** Quiz (40%) *** To succeed in the quiz, do assigned homework. ** Midterm (30%) Thurs., Oct. 8, 3:30-4:45 pm ** Final (30%) Thurs., Dec. 10, 12:30-2:30 pm == Overview == This is the first part of a 2-semester course in thermodynamics. This course will cover the mathematical theory of chemical equilibrium, heat, and work. These are the driving forces behind the operation of Le Châtelier's principle, and are routinely used to understand and control chemical reactions, states of matter, and amount and efficiency of energy production. == Textbooks == * McQuarrie and Simon, Physical Chemistry: A Molecular Approach, University Science Books, 1997. ISBN: 0935702997. == Resources == * [http://hyperphysics.phy-astr.gsu.edu/hbase/kinetic/ktcon.html Kinetic Theory] at HyperPhysics * [http://hyperphysics.phy-astr.gsu.edu/hbase/heacon.html Heat Concepts] at HyperPhysics ** Note: McQuarrie says dU = dQ + dW, while Nave says dU = dQ - dW. There is no contradiction, since McQuarrie's dW = -P dV (work done on the system), while Nave's dW = P dV (work done by the system). I prefer the first definition. == Topics == # Partial Differentiation # First Law of Thermodynamics # Algebraic Methods # Energy, Enthalpy, Entropy, and Free Energy # Counting Statistics # The Second Law of Thermodynamics # Standard States and Energies - Third Law of Thermodynamics # Phase Equilibria and Basic Phase Diagrams # Thermodynamic Cycles, Examples with Refrigeration and Galvanic Cells === Notes & Homework === Here are the running [[Media:pchem_notes.pdf|notes]] for the course. You can check the file date to see when there have been updates. * [[Media:intro_slides.pdf|Introduction to P-Chem]] * [[Media:CO2.xlsx|Excel plot and V-solve]] for van der Waals Equation of State ** Works fine with [https://www.libreoffice.org LibreOffice] * Homework 1: 16-1 through 16-7, 16-9, H-1, H-4 through H-6, H-10, H-11, 27-1 through 27-7 ** Does the vdW equation of state make a prediction for the density of liquid H2? ** What is a critical temperature? ** Who is Fritz London? * Homework 2: G-1, G-5, H-12, H-13, 16-31 through 16-32, 16-37, 16-38 through 16-40, 16-44, 16-55, 16-56 * Homework 3: ** Use the [[Media:LJ.xlsx|Lennard Jones]] spreadsheet for the following: **# Plot Vc vs sigma^3 to find the correlation between the two. **# Compute the exact derivative of the Lennard-Jones function for each r in column M, and compare the results to the numerical approximation in column L. **# Decrease the x-spacing, dx, in the numerical integration of B2v to 0.05. How does the result change? ** Use the [[Media:two_state_model.xlsx|2 state model]] spreadsheet for the following (DG is an abbreviation for Delta G of folding): **# Fit a line to DG(T) = DH - T DS **# Compute the average of d(beta DG)/dbeta **# Compute and plot d(beta DG) / d(beta P) - this should give you an effective folding volume **# Compute and plot d(DG) / d[Urea] - this should give you the energetic influence of urea * Homework 4 (to appear on Quiz 4): ** Chapter 19: 1-7, 9, 19, 29-31 ** For 19-3, remember to solve for P = P(V) * Homework 5: ** Chapter 19: 35-44, 46-50 ** Chapter 20: 1-5 ee348ece8921e548438a8f018531ffb7bd0dfb57 382 381 2015-10-01T03:30:55Z David M. Rogers 2 wikitext text/x-wiki '''<BIG>Physical Chemistry I</BIG>''' Course Info * Course Numbers CHM 4410 * Credit Hours: 4 * Meeting Dates: Aug. 25 - Dec. 4, 2015 ** No Class Nov. 26 & 27 * Meeting Times: Tues. and Thurs., 3:30-4:45 pm in Muma College of Business, 1403 ** Problem Session: Fri., 10:10-11:00 am in CHE303 ** Office Hours: Tues. and Thurs., 2:30-3:30 pm in SCA 433 * Grading: ** Quiz (40%) *** To succeed in the quiz, do assigned homework. ** Midterm (30%) Thurs., Oct. 8, 3:30-4:45 pm ** Final (30%) Thurs., Dec. 10, 12:30-2:30 pm == Overview == This is the first part of a 2-semester course in thermodynamics. This course will cover the mathematical theory of chemical equilibrium, heat, and work. These are the driving forces behind the operation of Le Châtelier's principle, and are routinely used to understand and control chemical reactions, states of matter, and amount and efficiency of energy production. == Textbooks == * McQuarrie and Simon, Physical Chemistry: A Molecular Approach, University Science Books, 1997. ISBN: 0935702997. == Resources == * [http://hyperphysics.phy-astr.gsu.edu/hbase/kinetic/ktcon.html Kinetic Theory] at HyperPhysics * [http://hyperphysics.phy-astr.gsu.edu/hbase/heacon.html Heat Concepts] at HyperPhysics ** Note: McQuarrie says dU = dQ + dW, while Nave says dU = dQ - dW. There is no contradiction, since McQuarrie's dW = -P dV (work done on the system), while Nave's dW = P dV (work done by the system). I prefer the first definition. == Topics == # Partial Differentiation # First Law of Thermodynamics # Algebraic Methods # Energy, Enthalpy, Entropy, and Free Energy # Counting Statistics # The Second Law of Thermodynamics # Standard States and Energies - Third Law of Thermodynamics # Phase Equilibria and Basic Phase Diagrams # Thermodynamic Cycles, Examples with Refrigeration and Galvanic Cells === Notes & Homework === Here are the running [[Media:pchem_notes.pdf|notes]] for the course. You can check the file date to see when there have been updates. By request, here are the [[Media:pchem_quiz1-5.pdf|quiz keys]]. * [[Media:intro_slides.pdf|Introduction to P-Chem]] * [[Media:CO2.xlsx|Excel plot and V-solve]] for van der Waals Equation of State ** Works fine with [https://www.libreoffice.org LibreOffice] * Homework 1: 16-1 through 16-7, 16-9, H-1, H-4 through H-6, H-10, H-11, 27-1 through 27-7 ** Does the vdW equation of state make a prediction for the density of liquid H2? ** What is a critical temperature? ** Who is Fritz London? * Homework 2: G-1, G-5, H-12, H-13, 16-31 through 16-32, 16-37, 16-38 through 16-40, 16-44, 16-55, 16-56 * Homework 3: ** Use the [[Media:LJ.xlsx|Lennard Jones]] spreadsheet for the following: **# Plot Vc vs sigma^3 to find the correlation between the two. **# Compute the exact derivative of the Lennard-Jones function for each r in column M, and compare the results to the numerical approximation in column L. **# Decrease the x-spacing, dx, in the numerical integration of B2v to 0.05. How does the result change? ** Use the [[Media:two_state_model.xlsx|2 state model]] spreadsheet for the following (DG is an abbreviation for Delta G of folding): **# Fit a line to DG(T) = DH - T DS **# Compute the average of d(beta DG)/dbeta **# Compute and plot d(beta DG) / d(beta P) - this should give you an effective folding volume **# Compute and plot d(DG) / d[Urea] - this should give you the energetic influence of urea * Homework 4 (to appear on Quiz 4): ** Chapter 19: 1-7, 9, 19, 29-31 ** For 19-3, remember to solve for P = P(V) * Homework 5: ** Chapter 19: 35-44, 46-50 ** Chapter 20: 1-5 6913a54a73923bfda6c1812f2234c9d3781c213a 384 382 2015-10-07T14:59:59Z David M. Rogers 2 wikitext text/x-wiki '''<BIG>Physical Chemistry I</BIG>''' Course Info * Course Numbers CHM 4410 * Credit Hours: 4 * Meeting Dates: Aug. 25 - Dec. 4, 2015 ** No Class Nov. 26 & 27 * Meeting Times: Tues. and Thurs., 3:30-4:45 pm in Muma College of Business, 1403 ** Problem Session: Fri., 10:10-11:00 am in CHE303 ** Office Hours: Tues. and Thurs., 2:30-3:30 pm in SCA 433 * Grading: ** Quiz (40%) *** To succeed in the quiz, do assigned homework. ** Midterm (30%) Thurs., Oct. 8, 3:30-4:45 pm ** Final (30%) Thurs., Dec. 10, 12:30-2:30 pm == Overview == This is the first part of a 2-semester course in thermodynamics. This course will cover the mathematical theory of chemical equilibrium, heat, and work. These are the driving forces behind the operation of Le Châtelier's principle, and are routinely used to understand and control chemical reactions, states of matter, and amount and efficiency of energy production. == Textbooks == * McQuarrie and Simon, Physical Chemistry: A Molecular Approach, University Science Books, 1997. ISBN: 0935702997. == Resources == * [http://hyperphysics.phy-astr.gsu.edu/hbase/kinetic/ktcon.html Kinetic Theory] at HyperPhysics * [http://hyperphysics.phy-astr.gsu.edu/hbase/heacon.html Heat Concepts] at HyperPhysics ** Note: McQuarrie says dU = dQ + dW, while Nave says dU = dQ - dW. There is no contradiction, since McQuarrie's dW = -P dV (work done on the system), while Nave's dW = P dV (work done by the system). I prefer the first definition. == Topics == # Partial Differentiation # First Law of Thermodynamics # Algebraic Methods # Energy, Enthalpy, Entropy, and Free Energy # Counting Statistics # The Second Law of Thermodynamics # Standard States and Energies - Third Law of Thermodynamics # Phase Equilibria and Basic Phase Diagrams # Thermodynamic Cycles, Examples with Refrigeration and Galvanic Cells === Notes & Homework === Here are the running [[Media:pchem_notes.pdf|notes]] for the course. You can check the file date to see when there have been updates. By request, here are the [[Media:pchem_quiz1-5.pdf|quiz keys]] (or you can quiz your friends with the [[Media:pchem_bquiz1-5.pdf|blank quizzes]]). * [[Media:intro_slides.pdf|Introduction to P-Chem]] * [[Media:CO2.xlsx|Excel plot and V-solve]] for van der Waals Equation of State ** Works fine with [https://www.libreoffice.org LibreOffice] * Homework 1: 16-1 through 16-7, 16-9, H-1, H-4 through H-6, H-10, H-11, 27-1 through 27-7 ** Does the vdW equation of state make a prediction for the density of liquid H2? ** What is a critical temperature? ** Who is Fritz London? * Homework 2: G-1, G-5, H-12, H-13, 16-31 through 16-32, 16-37, 16-38 through 16-40, 16-44, 16-55, 16-56 * Homework 3: ** Use the [[Media:LJ.xlsx|Lennard Jones]] spreadsheet for the following: **# Plot Vc vs sigma^3 to find the correlation between the two. **# Compute the exact derivative of the Lennard-Jones function for each r in column M, and compare the results to the numerical approximation in column L. **# Decrease the x-spacing, dx, in the numerical integration of B2v to 0.05. How does the result change? ** Use the [[Media:two_state_model.xlsx|2 state model]] spreadsheet for the following (DG is an abbreviation for Delta G of folding): **# Fit a line to DG(T) = DH - T DS **# Compute the average of d(beta DG)/dbeta **# Compute and plot d(beta DG) / d(beta P) - this should give you an effective folding volume **# Compute and plot d(DG) / d[Urea] - this should give you the energetic influence of urea * Homework 4 (to appear on Quiz 4): ** Chapter 19: 1-7, 9, 19, 29-31 ** For 19-3, remember to solve for P = P(V) * Homework 5: ** Chapter 19: 35-44, 46-50 ** Chapter 20: 1-5 086b06bb1cbf6bea1b74e0035c127397779b4a2a 386 384 2015-10-15T18:58:03Z David M. Rogers 2 wikitext text/x-wiki '''<BIG>Physical Chemistry I</BIG>''' Course Info * Course Numbers CHM 4410 * Credit Hours: 4 * Meeting Dates: Aug. 25 - Dec. 4, 2015 ** No Class Nov. 26 & 27 * Meeting Times: Tues. and Thurs., 3:30-4:45 pm in Muma College of Business, 1403 ** Problem Session: Fri., 10:10-11:00 am in CHE303 ** Office Hours: Tues. and Thurs., 2:30-3:30 pm in SCA 433 * Grading: ** Quiz (40%) *** To succeed in the quiz, do assigned homework. ** Midterm (30%) Thurs., Oct. 8, 3:30-4:45 pm ** Final (30%) Thurs., Dec. 10, 12:30-2:30 pm == Overview == This is the first part of a 2-semester course in thermodynamics. This course will cover the mathematical theory of chemical equilibrium, heat, and work. These are the driving forces behind the operation of Le Châtelier's principle, and are routinely used to understand and control chemical reactions, states of matter, and amount and efficiency of energy production. == Textbooks == * McQuarrie and Simon, Physical Chemistry: A Molecular Approach, University Science Books, 1997. ISBN: 0935702997. == Resources == * [http://hyperphysics.phy-astr.gsu.edu/hbase/kinetic/ktcon.html Kinetic Theory] at HyperPhysics * [http://hyperphysics.phy-astr.gsu.edu/hbase/heacon.html Heat Concepts] at HyperPhysics ** Note: McQuarrie says dU = dQ + dW, while Nave says dU = dQ - dW. There is no contradiction, since McQuarrie's dW = -P dV (work done on the system), while Nave's dW = P dV (work done by the system). I prefer the first definition. == Topics == # Partial Differentiation # First Law of Thermodynamics # Algebraic Methods # Energy, Enthalpy, Entropy, and Free Energy # Counting Statistics # The Second Law of Thermodynamics # Standard States and Energies - Third Law of Thermodynamics # Phase Equilibria and Basic Phase Diagrams # Thermodynamic Cycles, Examples with Refrigeration and Galvanic Cells === Notes & Homework === Here are the running [[Media:pchem_notes.pdf|notes]] for the course. You can check the file date to see when there have been updates. By request, here are the [[Media:pchem_quiz1-5.pdf|quiz keys]] (or you can quiz your friends with the [[Media:pchem_bquiz1-5.pdf|blank quizzes]]). * [[Media:intro_slides.pdf|Introduction to P-Chem]] * [[Media:CO2.xlsx|Excel plot and V-solve]] for van der Waals Equation of State ** Works fine with [https://www.libreoffice.org LibreOffice] * Homework 1: 16-1 through 16-7, 16-9, H-1, H-4 through H-6, H-10, H-11, 27-1 through 27-7 ** Does the vdW equation of state make a prediction for the density of liquid H2? ** What is a critical temperature? ** Who is Fritz London? * Homework 2: G-1, G-5, H-12, H-13, 16-31 through 16-32, 16-37, 16-38 through 16-40, 16-44, 16-55, 16-56 * Homework 3: ** Use the [[Media:LJ.xlsx|Lennard Jones]] spreadsheet for the following: **# Plot Vc vs sigma^3 to find the correlation between the two. **# Compute the exact derivative of the Lennard-Jones function for each r in column M, and compare the results to the numerical approximation in column L. **# Decrease the x-spacing, dx, in the numerical integration of B2v to 0.05. How does the result change? ** Use the [[Media:two_state_model.xlsx|2 state model]] spreadsheet for the following (DG is an abbreviation for Delta G of folding): **# Fit a line to DG(T) = DH - T DS **# Compute the average of d(beta DG)/dbeta **# Compute and plot d(beta DG) / d(beta P) - this should give you an effective folding volume **# Compute and plot d(DG) / d[Urea] - this should give you the energetic influence of urea * Homework 4 (to appear on Quiz 4): ** Chapter 19: 1-7, 9, 19, 29-31 ** For 19-3, remember to solve for P = P(V) * Homework 5: ** Chapter 19: 35-44, 46-50 ** Chapter 20: 1-5 * [[Media:final_hw.pdf|Final Exam Material]] (updated Oct. 15, 2015) ** The rest of the homework assignments will be based on the above final exam material. It will be updated with more details on related reading and homework questions from McQuarrie as we cover each topic. 8a1ab6a3914ac74a726220df0b5cfd351015fb25 389 386 2015-10-15T21:45:30Z David M. Rogers 2 /* Notes & Homework */ wikitext text/x-wiki '''<BIG>Physical Chemistry I</BIG>''' Course Info * Course Numbers CHM 4410 * Credit Hours: 4 * Meeting Dates: Aug. 25 - Dec. 4, 2015 ** No Class Nov. 26 & 27 * Meeting Times: Tues. and Thurs., 3:30-4:45 pm in Muma College of Business, 1403 ** Problem Session: Fri., 10:10-11:00 am in CHE303 ** Office Hours: Tues. and Thurs., 2:30-3:30 pm in SCA 433 * Grading: ** Quiz (40%) *** To succeed in the quiz, do assigned homework. ** Midterm (30%) Thurs., Oct. 8, 3:30-4:45 pm ** Final (30%) Thurs., Dec. 10, 12:30-2:30 pm == Overview == This is the first part of a 2-semester course in thermodynamics. This course will cover the mathematical theory of chemical equilibrium, heat, and work. These are the driving forces behind the operation of Le Châtelier's principle, and are routinely used to understand and control chemical reactions, states of matter, and amount and efficiency of energy production. == Textbooks == * McQuarrie and Simon, Physical Chemistry: A Molecular Approach, University Science Books, 1997. ISBN: 0935702997. == Resources == * [http://hyperphysics.phy-astr.gsu.edu/hbase/kinetic/ktcon.html Kinetic Theory] at HyperPhysics * [http://hyperphysics.phy-astr.gsu.edu/hbase/heacon.html Heat Concepts] at HyperPhysics ** Note: McQuarrie says dU = dQ + dW, while Nave says dU = dQ - dW. There is no contradiction, since McQuarrie's dW = -P dV (work done on the system), while Nave's dW = P dV (work done by the system). I prefer the first definition. == Topics == # Partial Differentiation # First Law of Thermodynamics # Algebraic Methods # Energy, Enthalpy, Entropy, and Free Energy # Counting Statistics # The Second Law of Thermodynamics # Standard States and Energies - Third Law of Thermodynamics # Phase Equilibria and Basic Phase Diagrams # Thermodynamic Cycles, Examples with Refrigeration and Galvanic Cells === Notes & Homework === Here are the running [[Media:pchem_notes.pdf|notes]] for the course. You can check the file date to see when there have been updates. By request, here are the [[Media:pchem_quiz1-5.pdf|quiz keys]] (or you can quiz your friends with the [[Media:pchem_bquiz1-5.pdf|blank quizzes]]). * [[Media:intro_slides.pdf|Introduction to P-Chem]] * [[Media:CO2.xlsx|Excel plot and V-solve]] for van der Waals Equation of State ** Works fine with [https://www.libreoffice.org LibreOffice] * Homework 1: 16-1 through 16-7, 16-9, H-1, H-4 through H-6, H-10, H-11, 27-1 through 27-7 ** Does the vdW equation of state make a prediction for the density of liquid H2? ** What is a critical temperature? ** Who is Fritz London? * Homework 2: G-1, G-5, H-12, H-13, 16-31 through 16-32, 16-37, 16-38 through 16-40, 16-44, 16-55, 16-56 * Homework 3: ** Use the [[Media:LJ.xlsx|Lennard Jones]] spreadsheet for the following: **# Plot Vc vs sigma^3 to find the correlation between the two. **# Compute the exact derivative of the Lennard-Jones function for each r in column M, and compare the results to the numerical approximation in column L. **# Decrease the x-spacing, dx, in the numerical integration of B2v to 0.05. How does the result change? ** Use the [[Media:two_state_model.xlsx|2 state model]] spreadsheet for the following (DG is an abbreviation for Delta G of folding): **# Fit a line to DG(T) = DH - T DS **# Compute the average of d(beta DG)/dbeta **# Compute and plot d(beta DG) / d(beta P) - this should give you an effective folding volume **# Compute and plot d(DG) / d[Urea] - this should give you the energetic influence of urea * Homework 4 (to appear on Quiz 4): ** Chapter 19: 1-7, 9, 19, 29-31 ** For 19-3, remember to solve for P = P(V) * Homework 5: ** Chapter 19: 35-44, 46-50 ** Chapter 20: 1-5 * [[Media:final_hw.pdf|Final Exam Material]] (updated Oct. 15, 2015) ** The rest of the homework assignments will be based on the above final exam material. It will be updated with more details on related reading and homework questions from McQuarrie as we cover each topic. * For Quiz on Tues., Oct. 20 ** Read Chapter 20 and compute the entropy change on expansion of a gas and for a mixture of 2 ideal gases. ** Write the entropy of isothermal expansion for a mixture of 2 ideal gases from V0 to V1 (p. 832). ** Write the expression for the entropy of mixing for ideal 2 gases (p. 835). ** Why do the entropies of expansion add together (bottom of p. 835, just after Ex. 20-4), while the entropy of mixing the two gases is not zero - phrase your answer in terms of independence and counting the total number of states (see Ex. 20-3)? ** Bonus: How does this relate to reversible vs. irreversible? (we'll discuss) c93df40a4c6a3ceb5c9c65952c548c268266cae9 391 389 2015-10-28T18:07:53Z David M. Rogers 2 /* Resources */ wikitext text/x-wiki '''<BIG>Physical Chemistry I</BIG>''' Course Info * Course Numbers CHM 4410 * Credit Hours: 4 * Meeting Dates: Aug. 25 - Dec. 4, 2015 ** No Class Nov. 26 & 27 * Meeting Times: Tues. and Thurs., 3:30-4:45 pm in Muma College of Business, 1403 ** Problem Session: Fri., 10:10-11:00 am in CHE303 ** Office Hours: Tues. and Thurs., 2:30-3:30 pm in SCA 433 * Grading: ** Quiz (40%) *** To succeed in the quiz, do assigned homework. ** Midterm (30%) Thurs., Oct. 8, 3:30-4:45 pm ** Final (30%) Thurs., Dec. 10, 12:30-2:30 pm == Overview == This is the first part of a 2-semester course in thermodynamics. This course will cover the mathematical theory of chemical equilibrium, heat, and work. These are the driving forces behind the operation of Le Châtelier's principle, and are routinely used to understand and control chemical reactions, states of matter, and amount and efficiency of energy production. == Textbooks == * McQuarrie and Simon, Physical Chemistry: A Molecular Approach, University Science Books, 1997. ISBN: 0935702997. == Resources == * [http://hyperphysics.phy-astr.gsu.edu/hbase/kinetic/ktcon.html Kinetic Theory] at HyperPhysics * [http://hyperphysics.phy-astr.gsu.edu/hbase/heacon.html Heat Concepts] at HyperPhysics ** Note: McQuarrie says dU = dQ + dW, while Nave says dU = dQ - dW. There is no contradiction, since McQuarrie's dW = -P dV (work done on the system), while Nave's dW = P dV (work done by the system). I prefer the first definition. * News from the frontlines of exploring entropy: [http://scitation.aip.org/content/aip/magazine/physicstoday/article/68/9/10.1063/PT.3.2912 Information: From Maxwell’s demon to Landauer’s eraser] == Topics == # Partial Differentiation # First Law of Thermodynamics # Algebraic Methods # Energy, Enthalpy, Entropy, and Free Energy # Counting Statistics # The Second Law of Thermodynamics # Standard States and Energies - Third Law of Thermodynamics # Phase Equilibria and Basic Phase Diagrams # Thermodynamic Cycles, Examples with Refrigeration and Galvanic Cells === Notes & Homework === Here are the running [[Media:pchem_notes.pdf|notes]] for the course. You can check the file date to see when there have been updates. By request, here are the [[Media:pchem_quiz1-5.pdf|quiz keys]] (or you can quiz your friends with the [[Media:pchem_bquiz1-5.pdf|blank quizzes]]). * [[Media:intro_slides.pdf|Introduction to P-Chem]] * [[Media:CO2.xlsx|Excel plot and V-solve]] for van der Waals Equation of State ** Works fine with [https://www.libreoffice.org LibreOffice] * Homework 1: 16-1 through 16-7, 16-9, H-1, H-4 through H-6, H-10, H-11, 27-1 through 27-7 ** Does the vdW equation of state make a prediction for the density of liquid H2? ** What is a critical temperature? ** Who is Fritz London? * Homework 2: G-1, G-5, H-12, H-13, 16-31 through 16-32, 16-37, 16-38 through 16-40, 16-44, 16-55, 16-56 * Homework 3: ** Use the [[Media:LJ.xlsx|Lennard Jones]] spreadsheet for the following: **# Plot Vc vs sigma^3 to find the correlation between the two. **# Compute the exact derivative of the Lennard-Jones function for each r in column M, and compare the results to the numerical approximation in column L. **# Decrease the x-spacing, dx, in the numerical integration of B2v to 0.05. How does the result change? ** Use the [[Media:two_state_model.xlsx|2 state model]] spreadsheet for the following (DG is an abbreviation for Delta G of folding): **# Fit a line to DG(T) = DH - T DS **# Compute the average of d(beta DG)/dbeta **# Compute and plot d(beta DG) / d(beta P) - this should give you an effective folding volume **# Compute and plot d(DG) / d[Urea] - this should give you the energetic influence of urea * Homework 4 (to appear on Quiz 4): ** Chapter 19: 1-7, 9, 19, 29-31 ** For 19-3, remember to solve for P = P(V) * Homework 5: ** Chapter 19: 35-44, 46-50 ** Chapter 20: 1-5 * [[Media:final_hw.pdf|Final Exam Material]] (updated Oct. 15, 2015) ** The rest of the homework assignments will be based on the above final exam material. It will be updated with more details on related reading and homework questions from McQuarrie as we cover each topic. * For Quiz on Tues., Oct. 20 ** Read Chapter 20 and compute the entropy change on expansion of a gas and for a mixture of 2 ideal gases. ** Write the entropy of isothermal expansion for a mixture of 2 ideal gases from V0 to V1 (p. 832). ** Write the expression for the entropy of mixing for ideal 2 gases (p. 835). ** Why do the entropies of expansion add together (bottom of p. 835, just after Ex. 20-4), while the entropy of mixing the two gases is not zero - phrase your answer in terms of independence and counting the total number of states (see Ex. 20-3)? ** Bonus: How does this relate to reversible vs. irreversible? (we'll discuss) 5eb7af6446ea5715cfdc0aa928b408a1d723cde1 392 391 2015-10-30T17:20:11Z David M. Rogers 2 wikitext text/x-wiki '''<BIG>Physical Chemistry I</BIG>''' Course Info * Course Numbers CHM 4410 * Credit Hours: 4 * Meeting Dates: Aug. 25 - Dec. 4, 2015 ** No Class Nov. 26 & 27 * Meeting Times: Tues. and Thurs., 3:30-4:45 pm in Muma College of Business, 1403 ** Problem Session: Fri., 10:10-11:00 am in CHE303 ** Office Hours: Tues. and Thurs., 2:30-3:30 pm in SCA 433 * Grading: ** Quiz (40%) *** To succeed in the quiz, do assigned homework. ** Midterm (30%) Thurs., Oct. 8, 3:30-4:45 pm ** Final (30%) Thurs., Dec. 10, 12:30-2:30 pm == Overview == This is the first part of a 2-semester course in thermodynamics. This course will cover the mathematical theory of chemical equilibrium, heat, and work. These are the driving forces behind the operation of Le Châtelier's principle, and are routinely used to understand and control chemical reactions, states of matter, and amount and efficiency of energy production. == Textbooks == * McQuarrie and Simon, Physical Chemistry: A Molecular Approach, University Science Books, 1997. ISBN: 0935702997. == Resources == * [http://hyperphysics.phy-astr.gsu.edu/hbase/kinetic/ktcon.html Kinetic Theory] at HyperPhysics * [http://hyperphysics.phy-astr.gsu.edu/hbase/heacon.html Heat Concepts] at HyperPhysics ** Note: McQuarrie says dU = dQ + dW, while Nave says dU = dQ - dW. There is no contradiction, since McQuarrie's dW = -P dV (work done on the system), while Nave's dW = P dV (work done by the system). I prefer the first definition. * News from the frontlines of exploring entropy: [http://scitation.aip.org/content/aip/magazine/physicstoday/article/68/9/10.1063/PT.3.2912 Information: From Maxwell’s demon to Landauer’s eraser] == Topics == # Partial Differentiation # First Law of Thermodynamics # Algebraic Methods # Energy, Enthalpy, Entropy, and Free Energy # Counting Statistics # The Second Law of Thermodynamics # Standard States and Energies - Third Law of Thermodynamics # Phase Equilibria and Basic Phase Diagrams # Thermodynamic Cycles, Examples with Refrigeration and Galvanic Cells === Notes & Homework === Here are the running [[Media:pchem_notes.pdf|notes]] for the course. You can check the file date to see when there have been updates. By request, here are the [[Media:pchem_quiz1-5.pdf|quiz keys]] (or you can quiz your friends with the [[Media:pchem_bquiz1-5.pdf|blank quizzes]]). * [[Media:intro_slides.pdf|Introduction to P-Chem]] * [[Media:CO2.xlsx|Excel plot and V-solve]] for van der Waals Equation of State ** Works fine with [https://www.libreoffice.org LibreOffice] * Homework 1: 16-1 through 16-7, 16-9, H-1, H-4 through H-6, H-10, H-11, 27-1 through 27-7 ** Does the vdW equation of state make a prediction for the density of liquid H2? ** What is a critical temperature? ** Who is Fritz London? * Homework 2: G-1, G-5, H-12, H-13, 16-31 through 16-32, 16-37, 16-38 through 16-40, 16-44, 16-55, 16-56 * Homework 3: ** Use the [[Media:LJ.xlsx|Lennard Jones]] spreadsheet for the following: **# Plot Vc vs sigma^3 to find the correlation between the two. **# Compute the exact derivative of the Lennard-Jones function for each r in column M, and compare the results to the numerical approximation in column L. **# Decrease the x-spacing, dx, in the numerical integration of B2v to 0.05. How does the result change? ** Use the [[Media:two_state_model.xlsx|2 state model]] spreadsheet for the following (DG is an abbreviation for Delta G of folding): **# Fit a line to DG(T) = DH - T DS **# Compute the average of d(beta DG)/dbeta **# Compute and plot d(beta DG) / d(beta P) - this should give you an effective folding volume **# Compute and plot d(DG) / d[Urea] - this should give you the energetic influence of urea * Homework 4 (to appear on Quiz 4): ** Chapter 19: 1-7, 9, 19, 29-31 ** For 19-3, remember to solve for P = P(V) * Homework 5: ** Chapter 19: 35-44, 46-50 ** Chapter 20: 1-5 * [[Media:final_hw.pdf|Final Exam Material]] (updated Oct. 15, 2015) ** The rest of the homework assignments will be based on the above final exam material. It will be updated with more details on related reading and homework questions from McQuarrie as we cover each topic. * For Quiz on Tues., Oct. 20 ** Read Chapter 20 and compute the entropy change on expansion of a gas and for a mixture of 2 ideal gases. ** Write the entropy of isothermal expansion for a mixture of 2 ideal gases from V0 to V1 (p. 832). ** Write the expression for the entropy of mixing for ideal 2 gases (p. 835). ** Why do the entropies of expansion add together (bottom of p. 835, just after Ex. 20-4), while the entropy of mixing the two gases is not zero - phrase your answer in terms of independence and counting the total number of states (see Ex. 20-3)? ** Bonus: How does this relate to reversible vs. irreversible? (we'll discuss) * For Quiz 8, Tues. Nov 3: ** 21-3, 21-4,5,7 (plotting skills), 22-23,25, 24-1 through 24-6 (note use of Ybar = dY / dn in 24-3), 24-7 (note similarity to 16-9) ** Advanced level problems: *** 22-20 (Note Delta S[ideal -> nonideal] follows Fig. 22.6 on p. 900) *** 24-8 (we'll work this in class) 579817b641793d6c97e4d9c29b4e1c763d43bb94 393 392 2015-10-30T17:21:02Z David M. Rogers 2 wikitext text/x-wiki '''<BIG>Physical Chemistry I</BIG>''' Course Info * Course Numbers CHM 4410 * Credit Hours: 4 * Meeting Dates: Aug. 25 - Dec. 4, 2015 ** No Class Nov. 26 & 27 * Meeting Times: Tues. and Thurs., 3:30-4:45 pm in Muma College of Business, 1403 ** Problem Session: Fri., 10:10-11:00 am in CHE303 ** Office Hours: Tues. and Thurs., 2:30-3:30 pm in SCA 433 * Grading: ** Quiz (40%) *** To succeed in the quiz, do assigned homework. ** Midterm (30%) Thurs., Oct. 8, 3:30-4:45 pm ** Final (30%) Thurs., Dec. 10, 12:30-2:30 pm == Overview == This is the first part of a 2-semester course in thermodynamics. This course will cover the mathematical theory of chemical equilibrium, heat, and work. These are the driving forces behind the operation of Le Châtelier's principle, and are routinely used to understand and control chemical reactions, states of matter, and amount and efficiency of energy production. == Textbooks == * McQuarrie and Simon, Physical Chemistry: A Molecular Approach, University Science Books, 1997. ISBN: 0935702997. == Resources == * [http://hyperphysics.phy-astr.gsu.edu/hbase/kinetic/ktcon.html Kinetic Theory] at HyperPhysics * [http://hyperphysics.phy-astr.gsu.edu/hbase/heacon.html Heat Concepts] at HyperPhysics ** Note: McQuarrie says dU = dQ + dW, while Nave says dU = dQ - dW. There is no contradiction, since McQuarrie's dW = -P dV (work done on the system), while Nave's dW = P dV (work done by the system). I prefer the first definition. * News from the frontlines of exploring entropy: [http://scitation.aip.org/content/aip/magazine/physicstoday/article/68/9/10.1063/PT.3.2912 Information: From Maxwell’s demon to Landauer’s eraser] == Topics == # Partial Differentiation # First Law of Thermodynamics # Algebraic Methods # Energy, Enthalpy, Entropy, and Free Energy # Counting Statistics # The Second Law of Thermodynamics # Standard States and Energies - Third Law of Thermodynamics # Phase Equilibria and Basic Phase Diagrams # Thermodynamic Cycles, Examples with Refrigeration and Galvanic Cells === Notes & Homework === Here are the running [[Media:pchem_notes.pdf|notes]] for the course. You can check the file date to see when there have been updates. By request, here are the [[Media:pchem_quiz1-5.pdf|quiz keys]] (or you can quiz your friends with the [[Media:pchem_bquiz1-5.pdf|blank quizzes]]). * [[Media:intro_slides.pdf|Introduction to P-Chem]] * [[Media:CO2.xlsx|Excel plot and V-solve]] for van der Waals Equation of State ** Works fine with [https://www.libreoffice.org LibreOffice] * Homework 1: 16-1 through 16-7, 16-9, H-1, H-4 through H-6, H-10, H-11, 27-1 through 27-7 ** Does the vdW equation of state make a prediction for the density of liquid H2? ** What is a critical temperature? ** Who is Fritz London? * Homework 2: G-1, G-5, H-12, H-13, 16-31 through 16-32, 16-37, 16-38 through 16-40, 16-44, 16-55, 16-56 * Homework 3: ** Use the [[Media:LJ.xlsx|Lennard Jones]] spreadsheet for the following: **# Plot Vc vs sigma^3 to find the correlation between the two. **# Compute the exact derivative of the Lennard-Jones function for each r in column M, and compare the results to the numerical approximation in column L. **# Decrease the x-spacing, dx, in the numerical integration of B2v to 0.05. How does the result change? ** Use the [[Media:two_state_model.xlsx|2 state model]] spreadsheet for the following (DG is an abbreviation for Delta G of folding): **# Fit a line to DG(T) = DH - T DS **# Compute the average of d(beta DG)/dbeta **# Compute and plot d(beta DG) / d(beta P) - this should give you an effective folding volume **# Compute and plot d(DG) / d[Urea] - this should give you the energetic influence of urea * Homework 4 (to appear on Quiz 4): ** Chapter 19: 1-7, 9, 19, 29-31 ** For 19-3, remember to solve for P = P(V) * Homework 5: ** Chapter 19: 35-44, 46-50 ** Chapter 20: 1-5 * [[Media:final_hw.pdf|Final Exam Material]] (updated Oct. 15, 2015) ** The rest of the homework assignments will be based on the above final exam material. It will be updated with more details on related reading and homework questions from McQuarrie as we cover each topic. * For Quiz on Tues., Oct. 20 ** Read Chapter 20 and compute the entropy change on expansion of a gas and for a mixture of 2 ideal gases. ** Write the entropy of isothermal expansion for a mixture of 2 ideal gases from V0 to V1 (p. 832). ** Write the expression for the entropy of mixing for ideal 2 gases (p. 835). ** Why do the entropies of expansion add together (bottom of p. 835, just after Ex. 20-4), while the entropy of mixing the two gases is not zero - phrase your answer in terms of independence and counting the total number of states (see Ex. 20-3)? ** Bonus: How does this relate to reversible vs. irreversible? (we'll discuss) * For Quiz 8-9, Tues. Nov 3 and Nov 10: ** 21-3, 21-4,5,7 (plotting skills), 22-23,25, 24-1 through 24-6 (note use of Ybar = dY / dn in 24-3), 24-7 (note similarity to 16-9) ** Advanced level problems: *** 22-20 (Note Delta S[ideal -> nonideal] follows Fig. 22.6 on p. 900) *** 24-8 (we'll work this in class) 5fdc2cf547ea6725ec61b88d26b97e5c0ae65a71 394 393 2015-11-23T17:18:49Z David M. Rogers 2 wikitext text/x-wiki '''<BIG>Physical Chemistry I</BIG>''' Course Info * Course Numbers CHM 4410 * Credit Hours: 4 * Meeting Dates: Aug. 25 - Dec. 4, 2015 ** No Class Nov. 26 & 27 * Meeting Times: Tues. and Thurs., 3:30-4:45 pm in Muma College of Business, 1403 ** Problem Session: Fri., 10:10-11:00 am in CHE303 ** Office Hours: Tues. and Thurs., 2:30-3:30 pm in SCA 433 * Grading: ** Quiz (40%) *** To succeed in the quiz, do assigned homework. ** Midterm (30%) Thurs., Oct. 8, 3:30-4:45 pm ** Final (30%) Thurs., Dec. 10, 12:30-2:30 pm == Overview == This is the first part of a 2-semester course in thermodynamics. This course will cover the mathematical theory of chemical equilibrium, heat, and work. These are the driving forces behind the operation of Le Châtelier's principle, and are routinely used to understand and control chemical reactions, states of matter, and amount and efficiency of energy production. == Textbooks == * McQuarrie and Simon, Physical Chemistry: A Molecular Approach, University Science Books, 1997. ISBN: 0935702997. == Resources == * [http://hyperphysics.phy-astr.gsu.edu/hbase/kinetic/ktcon.html Kinetic Theory] at HyperPhysics * [http://hyperphysics.phy-astr.gsu.edu/hbase/heacon.html Heat Concepts] at HyperPhysics ** Note: McQuarrie says dU = dQ + dW, while Nave says dU = dQ - dW. There is no contradiction, since McQuarrie's dW = -P dV (work done on the system), while Nave's dW = P dV (work done by the system). I prefer the first definition. * News from the frontlines of exploring entropy: [http://scitation.aip.org/content/aip/magazine/physicstoday/article/68/9/10.1063/PT.3.2912 Information: From Maxwell’s demon to Landauer’s eraser] == Topics == # Partial Differentiation # First Law of Thermodynamics # Algebraic Methods # Energy, Enthalpy, Entropy, and Free Energy # Counting Statistics # The Second Law of Thermodynamics # Standard States and Energies - Third Law of Thermodynamics # Phase Equilibria and Basic Phase Diagrams # Thermodynamic Cycles, Examples with Refrigeration and Galvanic Cells === Notes & Homework === Here are the running [[Media:pchem_notes.pdf|notes]] for the course. You can check the file date to see when there have been updates. By request, here are the [[Media:pchem_quiz1-5.pdf|quiz keys]] (or you can quiz your friends with the [[Media:pchem_bquiz1-5.pdf|blank quizzes]]). * [[Media:intro_slides.pdf|Introduction to P-Chem]] * [[Media:CO2.xlsx|Excel plot and V-solve]] for van der Waals Equation of State ** Works fine with [https://www.libreoffice.org LibreOffice] * Homework 1: 16-1 through 16-7, 16-9, H-1, H-4 through H-6, H-10, H-11, 27-1 through 27-7 ** Does the vdW equation of state make a prediction for the density of liquid H2? ** What is a critical temperature? ** Who is Fritz London? * Homework 2: G-1, G-5, H-12, H-13, 16-31 through 16-32, 16-37, 16-38 through 16-40, 16-44, 16-55, 16-56 * Homework 3: ** Use the [[Media:LJ.xlsx|Lennard Jones]] spreadsheet for the following: **# Plot Vc vs sigma^3 to find the correlation between the two. **# Compute the exact derivative of the Lennard-Jones function for each r in column M, and compare the results to the numerical approximation in column L. **# Decrease the x-spacing, dx, in the numerical integration of B2v to 0.05. How does the result change? ** Use the [[Media:two_state_model.xlsx|2 state model]] spreadsheet for the following (DG is an abbreviation for Delta G of folding): **# Fit a line to DG(T) = DH - T DS **# Compute the average of d(beta DG)/dbeta **# Compute and plot d(beta DG) / d(beta P) - this should give you an effective folding volume **# Compute and plot d(DG) / d[Urea] - this should give you the energetic influence of urea * Homework 4 (to appear on Quiz 4): ** Chapter 19: 1-7, 9, 19, 29-31 ** For 19-3, remember to solve for P = P(V) * Homework 5: ** Chapter 19: 35-44, 46-50 ** Chapter 20: 1-5 * [[Media:final_hw.pdf|Final Exam Material]] (updated Oct. 15, 2015) ** The rest of the homework assignments will be based on the above final exam material. It will be updated with more details on related reading and homework questions from McQuarrie as we cover each topic. * For Quiz on Tues., Oct. 20 ** Read Chapter 20 and compute the entropy change on expansion of a gas and for a mixture of 2 ideal gases. ** Write the entropy of isothermal expansion for a mixture of 2 ideal gases from V0 to V1 (p. 832). ** Write the expression for the entropy of mixing for ideal 2 gases (p. 835). ** Why do the entropies of expansion add together (bottom of p. 835, just after Ex. 20-4), while the entropy of mixing the two gases is not zero - phrase your answer in terms of independence and counting the total number of states (see Ex. 20-3)? ** Bonus: How does this relate to reversible vs. irreversible? (we'll discuss) * For Quiz 8-9, Tues. Nov 3 and Nov 10: ** 21-3, 21-4,5,7 (plotting skills), 22-23,25, 24-1 through 24-6 (note use of Ybar = dY / dn in 24-3), 24-7 (note similarity to 16-9) ** Advanced level problems: *** 22-20 (Note Delta S[ideal -> nonideal] follows Fig. 22.6 on p. 900) *** 24-8 (we'll work this in class) * For Quiz 11-12 (problems worked in class) ** prob. 26-33; ex. 24-3; prob. 24-13,50-52; prob. 22-33; prob. 24-37,56,57; ex. 25-1,3 ** Equilibrium calculations: ex. 26-4 (see also Tbl 26.1); prob. 26-12,13 and 58 (mostly uses 26.66), 21,22,29,31,32,62,63 7be49b4ceb004088f9337bdb33c7cfccb80d8929 395 394 2015-12-01T17:46:45Z David M. Rogers 2 /* Notes & Homework */ wikitext text/x-wiki '''<BIG>Physical Chemistry I</BIG>''' Course Info * Course Numbers CHM 4410 * Credit Hours: 4 * Meeting Dates: Aug. 25 - Dec. 4, 2015 ** No Class Nov. 26 & 27 * Meeting Times: Tues. and Thurs., 3:30-4:45 pm in Muma College of Business, 1403 ** Problem Session: Fri., 10:10-11:00 am in CHE303 ** Office Hours: Tues. and Thurs., 2:30-3:30 pm in SCA 433 * Grading: ** Quiz (40%) *** To succeed in the quiz, do assigned homework. ** Midterm (30%) Thurs., Oct. 8, 3:30-4:45 pm ** Final (30%) Thurs., Dec. 10, 12:30-2:30 pm == Overview == This is the first part of a 2-semester course in thermodynamics. This course will cover the mathematical theory of chemical equilibrium, heat, and work. These are the driving forces behind the operation of Le Châtelier's principle, and are routinely used to understand and control chemical reactions, states of matter, and amount and efficiency of energy production. == Textbooks == * McQuarrie and Simon, Physical Chemistry: A Molecular Approach, University Science Books, 1997. ISBN: 0935702997. == Resources == * [http://hyperphysics.phy-astr.gsu.edu/hbase/kinetic/ktcon.html Kinetic Theory] at HyperPhysics * [http://hyperphysics.phy-astr.gsu.edu/hbase/heacon.html Heat Concepts] at HyperPhysics ** Note: McQuarrie says dU = dQ + dW, while Nave says dU = dQ - dW. There is no contradiction, since McQuarrie's dW = -P dV (work done on the system), while Nave's dW = P dV (work done by the system). I prefer the first definition. * News from the frontlines of exploring entropy: [http://scitation.aip.org/content/aip/magazine/physicstoday/article/68/9/10.1063/PT.3.2912 Information: From Maxwell’s demon to Landauer’s eraser] == Topics == # Partial Differentiation # First Law of Thermodynamics # Algebraic Methods # Energy, Enthalpy, Entropy, and Free Energy # Counting Statistics # The Second Law of Thermodynamics # Standard States and Energies - Third Law of Thermodynamics # Phase Equilibria and Basic Phase Diagrams # Thermodynamic Cycles, Examples with Refrigeration and Galvanic Cells === Notes & Homework === Here are the running [[Media:pchem_notes.pdf|notes]] for the course. You can check the file date to see when there have been updates. By request, here are the [[Media:pchem_quiz1-5.pdf|quiz keys]] (or you can quiz your friends with the [[Media:pchem_bquiz1-5.pdf|blank quizzes]]). * [[Media:intro_slides.pdf|Introduction to P-Chem]] * [[Media:CO2.xlsx|Excel plot and V-solve]] for van der Waals Equation of State ** Works fine with [https://www.libreoffice.org LibreOffice] * Homework 1: 16-1 through 16-7, 16-9, H-1, H-4 through H-6, H-10, H-11, 27-1 through 27-7 ** Does the vdW equation of state make a prediction for the density of liquid H2? ** What is a critical temperature? ** Who is Fritz London? * Homework 2: G-1, G-5, H-12, H-13, 16-31 through 16-32, 16-37, 16-38 through 16-40, 16-44, 16-55, 16-56 * Homework 3: ** Use the [[Media:LJ.xlsx|Lennard Jones]] spreadsheet for the following: **# Plot Vc vs sigma^3 to find the correlation between the two. **# Compute the exact derivative of the Lennard-Jones function for each r in column M, and compare the results to the numerical approximation in column L. **# Decrease the x-spacing, dx, in the numerical integration of B2v to 0.05. How does the result change? ** Use the [[Media:two_state_model.xlsx|2 state model]] spreadsheet for the following (DG is an abbreviation for Delta G of folding): **# Fit a line to DG(T) = DH - T DS **# Compute the average of d(beta DG)/dbeta **# Compute and plot d(beta DG) / d(beta P) - this should give you an effective folding volume **# Compute and plot d(DG) / d[Urea] - this should give you the energetic influence of urea * Homework 4 (to appear on Quiz 4): ** Chapter 19: 1-7, 9, 19, 29-31 ** For 19-3, remember to solve for P = P(V) * Homework 5: ** Chapter 19: 35-44, 46-50 ** Chapter 20: 1-5 * [[Media:final_hw.pdf|Final Exam Material]] (updated Oct. 15, 2015) ** The rest of the homework assignments will be based on the above final exam material. It will be updated with more details on related reading and homework questions from McQuarrie as we cover each topic. * For Quiz on Tues., Oct. 20 ** Read Chapter 20 and compute the entropy change on expansion of a gas and for a mixture of 2 ideal gases. ** Write the entropy of isothermal expansion for a mixture of 2 ideal gases from V0 to V1 (p. 832). ** Write the expression for the entropy of mixing for ideal 2 gases (p. 835). ** Why do the entropies of expansion add together (bottom of p. 835, just after Ex. 20-4), while the entropy of mixing the two gases is not zero - phrase your answer in terms of independence and counting the total number of states (see Ex. 20-3)? ** Bonus: How does this relate to reversible vs. irreversible? (we'll discuss) * For Quiz 8-9, Tues. Nov 3 and Nov 10: ** 21-3, 21-4,5,7 (plotting skills), 22-23,25, 24-1 through 24-6 (note use of Ybar = dY / dn in 24-3), 24-7 (note similarity to 16-9) ** Advanced level problems: *** 22-20 (Note Delta S[ideal -> nonideal] follows Fig. 22.6 on p. 900) *** 24-8 (we'll work this in class) * For Quiz 11-12 (problems worked in class) ** prob. 26-33; ex. 24-3; prob. 24-13,50-52; prob. 22-33; prob. 24-37,56,57; ex. 25-1,3 ** Equilibrium calculations: ex. 26-4 (see also Tbl 26.1); ex. 26-12,13 (mostly uses Eq. 26.66, also prob 58), 21,22,29,31,32,62,63 fef63fad2b9ae0873496a7717aa96e184b209b0f 396 395 2015-12-07T22:17:19Z David M. Rogers 2 /* Notes & Homework */ wikitext text/x-wiki '''<BIG>Physical Chemistry I</BIG>''' Course Info * Course Numbers CHM 4410 * Credit Hours: 4 * Meeting Dates: Aug. 25 - Dec. 4, 2015 ** No Class Nov. 26 & 27 * Meeting Times: Tues. and Thurs., 3:30-4:45 pm in Muma College of Business, 1403 ** Problem Session: Fri., 10:10-11:00 am in CHE303 ** Office Hours: Tues. and Thurs., 2:30-3:30 pm in SCA 433 * Grading: ** Quiz (40%) *** To succeed in the quiz, do assigned homework. ** Midterm (30%) Thurs., Oct. 8, 3:30-4:45 pm ** Final (30%) Thurs., Dec. 10, 12:30-2:30 pm == Overview == This is the first part of a 2-semester course in thermodynamics. This course will cover the mathematical theory of chemical equilibrium, heat, and work. These are the driving forces behind the operation of Le Châtelier's principle, and are routinely used to understand and control chemical reactions, states of matter, and amount and efficiency of energy production. == Textbooks == * McQuarrie and Simon, Physical Chemistry: A Molecular Approach, University Science Books, 1997. ISBN: 0935702997. == Resources == * [http://hyperphysics.phy-astr.gsu.edu/hbase/kinetic/ktcon.html Kinetic Theory] at HyperPhysics * [http://hyperphysics.phy-astr.gsu.edu/hbase/heacon.html Heat Concepts] at HyperPhysics ** Note: McQuarrie says dU = dQ + dW, while Nave says dU = dQ - dW. There is no contradiction, since McQuarrie's dW = -P dV (work done on the system), while Nave's dW = P dV (work done by the system). I prefer the first definition. * News from the frontlines of exploring entropy: [http://scitation.aip.org/content/aip/magazine/physicstoday/article/68/9/10.1063/PT.3.2912 Information: From Maxwell’s demon to Landauer’s eraser] == Topics == # Partial Differentiation # First Law of Thermodynamics # Algebraic Methods # Energy, Enthalpy, Entropy, and Free Energy # Counting Statistics # The Second Law of Thermodynamics # Standard States and Energies - Third Law of Thermodynamics # Phase Equilibria and Basic Phase Diagrams # Thermodynamic Cycles, Examples with Refrigeration and Galvanic Cells === Notes & Homework === Here are the running [[Media:pchem_notes.pdf|notes]] for the course. You can check the file date to see when there have been updates. By request, here are the [[Media:pchem_quiz1-5.pdf|quiz keys]] (or you can quiz your friends with the [[Media:pchem_bquiz1-5.pdf|early blank quizzes]] and [[Media:pchem_bquiz6-12.pdf|later blank quizzes]]). * [[Media:intro_slides.pdf|Introduction to P-Chem]] * [[Media:CO2.xlsx|Excel plot and V-solve]] for van der Waals Equation of State ** Works fine with [https://www.libreoffice.org LibreOffice] * Homework 1: 16-1 through 16-7, 16-9, H-1, H-4 through H-6, H-10, H-11, 27-1 through 27-7 ** Does the vdW equation of state make a prediction for the density of liquid H2? ** What is a critical temperature? ** Who is Fritz London? * Homework 2: G-1, G-5, H-12, H-13, 16-31 through 16-32, 16-37, 16-38 through 16-40, 16-44, 16-55, 16-56 * Homework 3: ** Use the [[Media:LJ.xlsx|Lennard Jones]] spreadsheet for the following: **# Plot Vc vs sigma^3 to find the correlation between the two. **# Compute the exact derivative of the Lennard-Jones function for each r in column M, and compare the results to the numerical approximation in column L. **# Decrease the x-spacing, dx, in the numerical integration of B2v to 0.05. How does the result change? ** Use the [[Media:two_state_model.xlsx|2 state model]] spreadsheet for the following (DG is an abbreviation for Delta G of folding): **# Fit a line to DG(T) = DH - T DS **# Compute the average of d(beta DG)/dbeta **# Compute and plot d(beta DG) / d(beta P) - this should give you an effective folding volume **# Compute and plot d(DG) / d[Urea] - this should give you the energetic influence of urea * Homework 4 (to appear on Quiz 4): ** Chapter 19: 1-7, 9, 19, 29-31 ** For 19-3, remember to solve for P = P(V) * Homework 5: ** Chapter 19: 35-44, 46-50 ** Chapter 20: 1-5 * [[Media:final_hw.pdf|Final Exam Material]] (updated Oct. 15, 2015) ** The rest of the homework assignments will be based on the above final exam material. It will be updated with more details on related reading and homework questions from McQuarrie as we cover each topic. * For Quiz on Tues., Oct. 20 ** Read Chapter 20 and compute the entropy change on expansion of a gas and for a mixture of 2 ideal gases. ** Write the entropy of isothermal expansion for a mixture of 2 ideal gases from V0 to V1 (p. 832). ** Write the expression for the entropy of mixing for ideal 2 gases (p. 835). ** Why do the entropies of expansion add together (bottom of p. 835, just after Ex. 20-4), while the entropy of mixing the two gases is not zero - phrase your answer in terms of independence and counting the total number of states (see Ex. 20-3)? ** Bonus: How does this relate to reversible vs. irreversible? (we'll discuss) * For Quiz 8-9, Tues. Nov 3 and Nov 10: ** 21-3, 21-4,5,7 (plotting skills), 22-23,25, 24-1 through 24-6 (note use of Ybar = dY / dn in 24-3), 24-7 (note similarity to 16-9) ** Advanced level problems: *** 22-20 (Note Delta S[ideal -> nonideal] follows Fig. 22.6 on p. 900) *** 24-8 (we'll work this in class) * For Quiz 11-12 (problems worked in class) ** prob. 26-33; ex. 24-3; prob. 24-13,50-52; prob. 22-33; prob. 24-37,56,57; ex. 25-1,3 ** Equilibrium calculations: ex. 26-4 (see also Tbl 26.1); ex. 26-12,13 (mostly uses Eq. 26.66, also prob 58), 21,22,29,31,32,62,63 cd6690168017656d82c0c5c4cf4aabdaa5468943 398 396 2015-12-09T03:35:27Z David M. Rogers 2 wikitext text/x-wiki '''<BIG>Physical Chemistry I</BIG>''' Course Info * Course Numbers CHM 4410 * Credit Hours: 4 * Meeting Dates: Aug. 25 - Dec. 4, 2015 ** No Class Nov. 26 & 27 * Meeting Times: Tues. and Thurs., 3:30-4:45 pm in Muma College of Business, 1403 ** Problem Session: Fri., 10:10-11:00 am in CHE303 ** Office Hours: Tues. and Thurs., 2:30-3:30 pm in SCA 433 * Grading: ** Quiz (40%) *** To succeed in the quiz, do assigned homework. ** Midterm (30%) Thurs., Oct. 8, 3:30-4:45 pm ** Final (30%) Thurs., Dec. 10, 12:30-2:30 pm == Overview == This is the first part of a 2-semester course in thermodynamics. This course will cover the mathematical theory of chemical equilibrium, heat, and work. These are the driving forces behind the operation of Le Châtelier's principle, and are routinely used to understand and control chemical reactions, states of matter, and amount and efficiency of energy production. == Textbooks == * McQuarrie and Simon, Physical Chemistry: A Molecular Approach, University Science Books, 1997. ISBN: 0935702997. == Resources == * [http://hyperphysics.phy-astr.gsu.edu/hbase/kinetic/ktcon.html Kinetic Theory] at HyperPhysics * [http://hyperphysics.phy-astr.gsu.edu/hbase/heacon.html Heat Concepts] at HyperPhysics ** Note: McQuarrie says dU = dQ + dW, while Nave says dU = dQ - dW. There is no contradiction, since McQuarrie's dW = -P dV (work done on the system), while Nave's dW = P dV (work done by the system). I prefer the first definition. * News from the frontlines of exploring entropy: [http://scitation.aip.org/content/aip/magazine/physicstoday/article/68/9/10.1063/PT.3.2912 Information: From Maxwell’s demon to Landauer’s eraser] == Topics == # Partial Differentiation # First Law of Thermodynamics # Algebraic Methods # Energy, Enthalpy, Entropy, and Free Energy # Counting Statistics # The Second Law of Thermodynamics # Standard States and Energies - Third Law of Thermodynamics # Phase Equilibria and Basic Phase Diagrams # Thermodynamic Cycles, Examples with Refrigeration and Galvanic Cells === Notes & Homework === Here are the running [[Media:pchem_notes.pdf|notes]] for the course. You can check the file date to see when there have been updates. By request, here are the [[Media:pchem_quiz1-5.pdf|quiz keys]] and [[Media:pchem_quiz6-12.pdf|quiz keys]] (or you can quiz your friends with the [[Media:pchem_bquiz1-5.pdf|early blank quizzes]] and [[Media:pchem_bquiz6-12.pdf|later blank quizzes]]). * [[Media:intro_slides.pdf|Introduction to P-Chem]] * [[Media:CO2.xlsx|Excel plot and V-solve]] for van der Waals Equation of State ** Works fine with [https://www.libreoffice.org LibreOffice] * Homework 1: 16-1 through 16-7, 16-9, H-1, H-4 through H-6, H-10, H-11, 27-1 through 27-7 ** Does the vdW equation of state make a prediction for the density of liquid H2? ** What is a critical temperature? ** Who is Fritz London? * Homework 2: G-1, G-5, H-12, H-13, 16-31 through 16-32, 16-37, 16-38 through 16-40, 16-44, 16-55, 16-56 * Homework 3: ** Use the [[Media:LJ.xlsx|Lennard Jones]] spreadsheet for the following: **# Plot Vc vs sigma^3 to find the correlation between the two. **# Compute the exact derivative of the Lennard-Jones function for each r in column M, and compare the results to the numerical approximation in column L. **# Decrease the x-spacing, dx, in the numerical integration of B2v to 0.05. How does the result change? ** Use the [[Media:two_state_model.xlsx|2 state model]] spreadsheet for the following (DG is an abbreviation for Delta G of folding): **# Fit a line to DG(T) = DH - T DS **# Compute the average of d(beta DG)/dbeta **# Compute and plot d(beta DG) / d(beta P) - this should give you an effective folding volume **# Compute and plot d(DG) / d[Urea] - this should give you the energetic influence of urea * Homework 4 (to appear on Quiz 4): ** Chapter 19: 1-7, 9, 19, 29-31 ** For 19-3, remember to solve for P = P(V) * Homework 5: ** Chapter 19: 35-44, 46-50 ** Chapter 20: 1-5 * [[Media:final_hw.pdf|Final Exam Material]] (updated Oct. 15, 2015) ** The rest of the homework assignments will be based on the above final exam material. It will be updated with more details on related reading and homework questions from McQuarrie as we cover each topic. * For Quiz on Tues., Oct. 20 ** Read Chapter 20 and compute the entropy change on expansion of a gas and for a mixture of 2 ideal gases. ** Write the entropy of isothermal expansion for a mixture of 2 ideal gases from V0 to V1 (p. 832). ** Write the expression for the entropy of mixing for ideal 2 gases (p. 835). ** Why do the entropies of expansion add together (bottom of p. 835, just after Ex. 20-4), while the entropy of mixing the two gases is not zero - phrase your answer in terms of independence and counting the total number of states (see Ex. 20-3)? ** Bonus: How does this relate to reversible vs. irreversible? (we'll discuss) * For Quiz 8-9, Tues. Nov 3 and Nov 10: ** 21-3, 21-4,5,7 (plotting skills), 22-23,25, 24-1 through 24-6 (note use of Ybar = dY / dn in 24-3), 24-7 (note similarity to 16-9) ** Advanced level problems: *** 22-20 (Note Delta S[ideal -> nonideal] follows Fig. 22.6 on p. 900) *** 24-8 (we'll work this in class) * For Quiz 11-12 (problems worked in class) ** prob. 26-33; ex. 24-3; prob. 24-13,50-52; prob. 22-33; prob. 24-37,56,57; ex. 25-1,3 ** Equilibrium calculations: ex. 26-4 (see also Tbl 26.1); ex. 26-12,13 (mostly uses Eq. 26.66, also prob 58), 21,22,29,31,32,62,63 e780ed672ec36a3caff0df09172958d85412b98d File:CO2.xlsx 6 76 363 2015-08-27T21:18:03Z David M. Rogers 2 wikitext text/x-wiki da39a3ee5e6b4b0d3255bfef95601890afd80709 File:Mitosis.png 6 58 366 272 2015-08-28T01:46:07Z David M. Rogers 2 David M. Rogers uploaded a new version of &quot;[[File:Mitosis.png]]&quot; wikitext text/x-wiki Image screen-grabbed from mitosis video at http://brookeborel.com/2011/06/02/363/. 8adc17ace8641ebc6c62d7ca0ee79556ce2e8356 File:LJ.xlsx 6 77 369 2015-09-11T12:45:53Z David M. Rogers 2 wikitext text/x-wiki da39a3ee5e6b4b0d3255bfef95601890afd80709 File:Two state model.xlsx 6 78 370 2015-09-11T12:46:17Z David M. Rogers 2 wikitext text/x-wiki da39a3ee5e6b4b0d3255bfef95601890afd80709 Courses 0 16 372 328 2015-09-18T03:10:00Z David M. Rogers 2 /* Courses */ wikitext text/x-wiki Here's a list of courses with useful online materials: == Courses == * [[PChemFall2015| USF Physical Chemistry I]] * [[GradQuantumFall2013| USF Graduate Quantum Mechanics I]] * [[GradQuantumSpring2014| USF Graduate Quantum Mechanics II]] * [[CompSciFall2014|Introduction to Scientific Computing]] * [http://lambda-the-ultimate.org/classic/Courses.html Functional Programming] == Lecture Series == * [http://www.esqc.org/lectures European Summer School in Quantum Chemistry] == Tutorials == * [[HowTo:Fourier|Fourier transforms]] * [http://www.mathematica-journal.com/2012/02/evaluation-of-gaussian-molecular-integrals Evaluating Matrix Elements] * [http://www.haskell.org/tutorial/ Haskell] * [http://monads.haskell.cz/html/index.html Monads] * [http://www.yosefk.com/blog/my-history-with-forth-stack-machines.html The Forth Language] == Reference Material == * [http://dft.sandia.gov/Quest/DFT_codes.html List of DFT Codes] * [http://docs.python.org/3/tutorial/ Python Tutorial] * [http://www.nwchem-sw.org/index.php/Release62:NWChem_Documentation NWChem Documentation] * [http://www.ebi.ac.uk/pdbe-srv/pdbechem/ PDB Ligand Structures] 45f0bee7d62650087dff872fa6ea888f5c787444 405 372 2016-01-11T16:14:24Z David M. Rogers 2 wikitext text/x-wiki Here's a list of courses with useful online materials: == Courses == * [[PChemFall2015| USF Physical Chemistry I]] * [[GradQuantumFall2013| USF Graduate Quantum Mechanics I]] * [[GradQuantumSpring2014| USF Graduate Quantum Mechanics II]] * [[CompSciSpring2016|Introduction to Scientific Computing (2016)]] * [[CompSciFall2014|Introduction to Scientific Computing (2014)]] * [http://lambda-the-ultimate.org/classic/Courses.html Functional Programming] == Lecture Series == * [http://www.esqc.org/lectures European Summer School in Quantum Chemistry] == Tutorials == * [[HowTo:Fourier|Fourier transforms]] * [http://www.mathematica-journal.com/2012/02/evaluation-of-gaussian-molecular-integrals Evaluating Matrix Elements] * [http://www.haskell.org/tutorial/ Haskell] * [http://monads.haskell.cz/html/index.html Monads] * [http://www.yosefk.com/blog/my-history-with-forth-stack-machines.html The Forth Language] == Reference Material == * [http://dft.sandia.gov/Quest/DFT_codes.html List of DFT Codes] * [http://docs.python.org/3/tutorial/ Python Tutorial] * [http://www.nwchem-sw.org/index.php/Release62:NWChem_Documentation NWChem Documentation] * [http://www.ebi.ac.uk/pdbe-srv/pdbechem/ PDB Ligand Structures] 8e86a070a576f1f1ada72d9c5c8c09bdebb58846 File:Pchem notes.pdf 6 79 376 2015-09-18T03:19:01Z David M. Rogers 2 wikitext text/x-wiki da39a3ee5e6b4b0d3255bfef95601890afd80709 377 376 2015-09-22T23:12:44Z David M. Rogers 2 David M. Rogers uploaded a new version of &quot;[[File:Pchem notes.pdf]]&quot; wikitext text/x-wiki da39a3ee5e6b4b0d3255bfef95601890afd80709 Publications 0 8 378 350 2015-09-23T15:42:09Z David M. Rogers 2 wikitext text/x-wiki {| cellpadding="4" style="border: 1px solid darkgray;" |- style="border: 1px solid darkgray;" || David M. Rogers. "Thermodynamics of Maximum Transition Entropy for Quantum Assemblies." [http://arxiv.org/abs/1503.01232 arXiv:1503.01232 submitted, 2015]. The work presents a new, general, theoretical foundation for the dynamics of ope n quantum systems modeled on the maximum entropy derivation of equilibrium stati stical mechanics. Computational results are presented for three detailed system s to validate and reinforce the theory. It represents a significant advancement for the field, as it lucidly connects the dynamics of a single wavefunction plus environmental noise to the Caldeira-Leggett model for density matrices. |- style="border: 1px solid darkgray;" || David M. Rogers. "Towards a Direct, By-Need Evaluator for Dependently Typed Languages.". This paper describes the implementation of a new interpreted language for distributed parallel computing. It achieves its goal by maintaining pure functional semantics, allowing all terms in the language to be partially evaluated and serialized to network storage at any point during computation. |- style="border: 1px solid darkgray;" || Marielle Soniat, David M. Rogers, and Susan Rempe. "Dispersion- and Exchange-Corrected Density Functional Theory for Sodium Ion Hydration." [http://pubs.acs.org/doi/abs/10.1021/acs.jctc.5b00357 J. Chem. Theory. Comput. 142:074101, 2015]. We studied the influence of dispersion energy corrections on the free energy of formation for sodium-water clusters computed with DFT and wound up discovering that dispersion and split-range exchange functionals can somewhat counter-balance each other. The charged sodium ion pulls on the water's electrons, clearly showing which density functionals over-polarize compared to CCSD. Split-range exchange can reduce this over-polarization, but results in reduced electrostatic interaction. Dispersion can lower the binding energy again to counter-balance. So, functionals fit to experimental formation energies need both effects to avoid lowering energies by over-polarizing. |- style="border: 1px solid darkgray;" || David M. Rogers. "Real-space quadrature: a convenient, efficient representation for multipole expansions." [http://dx.doi.org/10.1063/1.4907404 J. Chem. Phys. 142:074101, 2015]. ([http://predictivestatmech.org/papers/real-poles.pdf Presentation]) I introduce sets of point charges that are able to simultaneously reproduce all multipole (spherical harmonic) expansions up to arbitrary order. The number of points is space-optimal. Translations are described from the usual harmonics and from Cartesian moments (dipole, quadrupole, etc.) on supersymmetric tensors to directional moments using the point weight distribution. Many applications are possible, including trivial implementation of multipoles in molecular mechanics and representing probability distributions over rotation space. |- style="border: 1px solid darkgray;" || David M. Rogers, Michael S. Kent, and Susan B. Rempe, "Molecular basis of endosomal-membrane association for the dengue virus envelope protein." [http://dx.doi.org/10.1016/j.bbamem.2014.12.018 BBA Biomembranes 1848(4):1041-52.] A fully atomistic potential of mean force for association of the viral envelope protein from Dengue virus was compared to a Poisson-Boltzmann electrostatic plus dispersion model. The results are consistent, showing hope for this type of combined scale simulation. |- style="border: 1px solid darkgray;" || Yaqin Fu, Binsong Li, Ying-Bing Jiang, Darren R. Dunphy, Andy Tsai, Siu-Yue Tam, Hongyou Fan, Hongxia Zhan, David Rogers, Susan Rempe, Plamen Atanassov, Joseph L. Cecchi, and C. Jeffrey Brinker "Atomic Layer Deposition of L-Alanine Polypeptide." [http://pubs.acs.org/doi/abs/10.1021/ja5043403 JACS 136(45):15821–4, 2014.] This paper with our experimental collaborators carried out blocked peptide synthesis by vapor-depositing Boc-L-alanine to create a uniform thin film of polypeptides grown on a silica substrate activated by aminopropyltrimethoxysilane. |- style="border: 1px solid darkgray;" || David M. Rogers. "Silmaril, A Functional Language for Distributed Parallel Evaluation." [http://predictivestatmech.org/sil/papers/sil.pdf Submitted version] |- style="border: 1px solid darkgray;" || Mathias B. Andersen, David M. Rogers, Junyu Mai, Benjamin Schudel, Anson V. Hatch, Susan B. Rempe and Ali Mani. "Spatiotemporal pH dynamics in concentration polarization near ion-selective membranes." [http://dx.doi.org/10.1021/la5014297 Langmuir, 30(26):7902–7912, 2014] |- style="border: 1px solid darkgray;" || W. K. Chan, P. L. Lorenzi, A. Anishkin, P. Purwaha, D. M. Rogers, S. Sukharev, S.B. Rempe, and J. N. Weinstein. "The glutaminase activity of l-asparaginase is not required for anticancer activity against ASNS-negative cells." [http://dx.doi.org/10.1182/blood-2013-10-535112 Blood. 123(23):3596-606, 2014]. |- style="border: 1px solid darkgray;" || David M. Rogers, Dian Jiao, Lawrence Pratt, and Susan B. Rempe. "Structural Models and Molecular Thermodynamics of Hydration of Ions and Small Molecules" [http://dx.doi.org/10.1016/B978-0-444-59440-2.00004-1 Annu. Rep. Comp. Chem. 8:71–127, 2012.] |- style="border: 1px solid darkgray;" || David M. Rogers and Susan B. Rempe. "Irreversible Thermodynamics." [http://dx.doi.org/10.1088/1742-6596/402/1/012014 J. Phys.: Conf. Ser. 402:012014, 2012]. |- style="border: 1px solid darkgray;" || David M. Rogers, Thomas L. Beck, and Susan B. Rempe. [[Media:Dmroge_InfoNonequ2011.pdf|"An Information Theory Approach to Nonlinear, Nonequilibrium Thermodynamics."]] [http://dx.doi.org/10.1007/s10955-011-0358-9 J. Stat. Phys. 145(2):385-409, 2011] We show how the interpretation of thermodynamic states as representing system information leads naturally to thermodynamic cycles and the first and second laws of thermodynamics as well as similar formulations for nontrivial nonequilibrium problems. The logical development of the theory also leads naturally to correct indistinguishability factors in the partition function. |- style="border: 1px solid darkgray;" || Sameer Varma, David M. Rogers, Lawrence R. Pratt, and Susan B. Rempe. "Perspectives on Ion Selectivity: Design Principles for K+ Selectivity in Membrane Transport." [http://jgp.rupress.org/content/137/6/479.full J. Gen. Physiol., 137(6):479-488, 2011.] We review the development of models for understanding the physical basis of selectivity for K+ ions over Na+, its sibling only one row behind, in membrane channels and transporters. Although the problem is subtle because of the morass of competing effects, we emphasize work analyzing the systematic influence of the environment on tipping local binding site structure toward selective configurations. |- style="border: 1px solid darkgray;" || David M. Rogers and Susan B. Rempe. [http://www.ncbi.nlm.nih.gov/pmc/articles/PMC3443978/ “Probing the Thermodynamics of Competitive Ion Binding Using Minimum Energy Structures.”] [http://dx.doi.org/10.1021/jp2012864 J. Phys. Chem. B, 115(29):9116-29, 2011]. We presented an extension of the Quasi-Chemical theory for quantifying the impact of local structure on ion complexation thermodynamics. The theory can be simply represented using a set of thermodynamic cycles involving binding site structural and compositional states as reaction intermediates. |- style="border: 1px solid darkgray;" || Susan B. Rempe and David M. Rogers; et. al. “Computational and experimental platform for understanding and optimizing water flux and salt rejection in nanoporous membranes.” [http://prod.sandia.gov/techlib/access-control.cgi/2010/106735.pdf Sandia Technical Report, SAND2010-6735, 2010.] We summarize work on designing polymer coatings for salt exclusion in water transporting nanopores. In this work, I collected available molecular dynamics results for these systems and performed a novel energy efficiency analysis able to relate atomistic and experimental scales as well as identify important design goals and chemical principles for material performance. |- style="border: 1px solid darkgray;" || David M. Rogers, [http://rave.ohiolink.edu/etdc/view?acc_num=ucin1251832030 ''''Using Bayes' Theorem for Free Energy Calculations''''], 2009. We investigated the central quantity of free energies in a Bayesian context and provide estimators for solvation free energies as well as optimal potential of mean force approximations to model polymer coarse-grained dynamics from atomistic simulations. |- style="border: 1px solid darkgray;" || Zhen Zhao, David M. Rogers and Thomas L. Beck. "Polarization and Charge Transfer in the Hydration of Chloride Ions." [http://link.aip.org/link/?JCP/132/014502/1 J. Chem. Phys., 132:014502, 2010.] Dr. Zhao's ab-initio analysis of the charge distribution in water-ion clusters highlighted the importance of many-body water-water interactions and charge transfer effects in determining cluster structural and energetic properties. These are still challenging to represent in modern polarizable forcefields and have implications for anion properties at interfaces. |- style="border: 1px solid darkgray;" || David M. Rogers and Thomas L. Beck. "Quasi-Chemical and Structural Analysis of Polarizable Anion Hydration." [http://link.aip.org/link/?JCP/132/014505/1 J. Chem. Phys., 132:014505, 2010.] The role of polarizability in forcefield-based models of ions and water was examined. Utilizing some of our recent developments on quasi-chemical theory, we have been able to quantify the tightened, asymmetric nature of the ion's local solvation waters induced by increased polarizability as well as the exact effects of polarization on the solvation free energy. The results suggest some potential problems and diagnostics for such models. |- style="border: 1px solid darkgray;" || David M. Rogers and Thomas L. Beck. [http://forcesolve.sourceforge.net/ Force Solve] (Sourceforge, Chicago IL, 2008). This force matching software implements and tests coarse-graining for general molecular systems in a mere 4000 lines of code. It is able to parametrize coarse Hamiltonians from atomic trajectory data given arbitrary definitions of coarse united-atom type models as well as carry out short Langevin Dynamics simulations on the coarse scale. The program's main drawbacks are its slow speed and high memory usage due to its simplistic design, attributable to the interpreted nature of python. |- style="border: 1px solid darkgray;" || David M. Rogers and Thomas L. Beck. "Resolution and Scale Independent Nonparametric Function Matching Using a String Energy Penalized Spline Prior." 2008. [http://arxiv.org/abs/1003.4741 arXiv:1003.4741v1] (stat.ML). Fresh insight is provided into long-standing mathematical issues surrounding computational modeling of continuous functions from a few sampled data points. The present research lays the groundwork for predicting the behavior of complicated many-body systems using advanced regression techniques. |} a229bf1dba4e88d6415c71c3983810909a8c5d7b 379 378 2015-09-23T15:42:29Z David M. Rogers 2 wikitext text/x-wiki {| cellpadding="4" style="border: 1px solid darkgray;" |- style="border: 1px solid darkgray;" || David M. Rogers. "Thermodynamics of Maximum Transition Entropy for Quantum Assemblies." [http://arxiv.org/abs/1503.01232 arXiv:1503.01232 submitted, 2015]. The work presents a new, general, theoretical foundation for the dynamics of ope n quantum systems modeled on the maximum entropy derivation of equilibrium stati stical mechanics. Computational results are presented for three detailed system s to validate and reinforce the theory. It represents a significant advancement for the field, as it lucidly connects the dynamics of a single wavefunction plus environmental noise to the Caldeira-Leggett model for density matrices. |- style="border: 1px solid darkgray;" || David M. Rogers. "Towards a Direct, By-Need Evaluator for Dependently Typed Languages.". This paper describes the implementation of a new interpreted language for distributed parallel computing. It achieves its goal by maintaining pure functional semantics, allowing all terms in the language to be partially evaluated and serialized to network storage at any point during computation. |- style="border: 1px solid darkgray;" || Marielle Soniat, David M. Rogers, and Susan Rempe. "Dispersion- and Exchange-Corrected Density Functional Theory for Sodium Ion Hydration." [http://pubs.acs.org/doi/abs/10.1021/acs.jctc.5b00357 J. Chem. Theory. Comput. 142:074101, 2015]. We studied the influence of dispersion energy corrections on the free energy of formation for sodium-water clusters computed with DFT and wound up discovering that dispersion and split-range exchange functionals can somewhat counter-balance each other. The charged sodium ion pulls on the water's electrons, clearly showing which density functionals over-polarize compared to CCSD. Split-range exchange can reduce this over-polarization, but results in reduced electrostatic interaction. Dispersion can lower the binding energy again to counter-balance. So, functionals fit to experimental formation energies need both effects to avoid lowering energies by over-polarizing. |- style="border: 1px solid darkgray;" || David M. Rogers. "Real-space quadrature: a convenient, efficient representation for multipole expansions." [http://dx.doi.org/10.1063/1.4907404 J. Chem. Phys. 142:074101, 2015]. ([http://predictivestatmech.org/papers/real-poles.pdf Presentation]) I introduce sets of point charges that are able to simultaneously reproduce all multipole (spherical harmonic) expansions up to arbitrary order. The number of points is space-optimal. Translations are described from the usual harmonics and from Cartesian moments (dipole, quadrupole, etc.) on supersymmetric tensors to directional moments using the point weight distribution. Many applications are possible, including trivial implementation of multipoles in molecular mechanics and representing probability distributions over rotation space. |- style="border: 1px solid darkgray;" || David M. Rogers, Michael S. Kent, and Susan B. Rempe, "Molecular basis of endosomal-membrane association for the dengue virus envelope protein." [http://dx.doi.org/10.1016/j.bbamem.2014.12.018 BBA Biomembranes 1848(4):1041-52.] A fully atomistic potential of mean force for association of the viral envelope protein from Dengue virus was compared to a Poisson-Boltzmann electrostatic plus dispersion model. The results are consistent, showing hope for this type of combined scale simulation. |- style="border: 1px solid darkgray;" || Yaqin Fu, Binsong Li, Ying-Bing Jiang, Darren R. Dunphy, Andy Tsai, Siu-Yue Tam, Hongyou Fan, Hongxia Zhan, David Rogers, Susan Rempe, Plamen Atanassov, Joseph L. Cecchi, and C. Jeffrey Brinker "Atomic Layer Deposition of L-Alanine Polypeptide." [http://pubs.acs.org/doi/abs/10.1021/ja5043403 JACS 136(45):15821–4, 2014.] This paper with our experimental collaborators carried out blocked peptide synthesis by vapor-depositing Boc-L-alanine to create a uniform thin film of polypeptides grown on a silica substrate activated by aminopropyltrimethoxysilane. |- style="border: 1px solid darkgray;" || David M. Rogers. "Silmaril, A Functional Language for Distributed Parallel Evaluation." [http://predictivestatmech.org/sil/papers/sil.pdf Submitted version] |- style="border: 1px solid darkgray;" || Mathias B. Andersen, David M. Rogers, Junyu Mai, Benjamin Schudel, Anson V. Hatch, Susan B. Rempe and Ali Mani. "Spatiotemporal pH dynamics in concentration polarization near ion-selective membranes." [http://dx.doi.org/10.1021/la5014297 Langmuir, 30(26):7902–7912, 2014] |- style="border: 1px solid darkgray;" || W. K. Chan, P. L. Lorenzi, A. Anishkin, P. Purwaha, D. M. Rogers, S. Sukharev, S.B. Rempe, and J. N. Weinstein. "The glutaminase activity of l-asparaginase is not required for anticancer activity against ASNS-negative cells." [http://dx.doi.org/10.1182/blood-2013-10-535112 Blood. 123(23):3596-606, 2014]. |- style="border: 1px solid darkgray;" || David M. Rogers, Dian Jiao, Lawrence Pratt, and Susan B. Rempe. "Structural Models and Molecular Thermodynamics of Hydration of Ions and Small Molecules" [http://dx.doi.org/10.1016/B978-0-444-59440-2.00004-1 Annu. Rep. Comp. Chem. 8:71–127, 2012.] |- style="border: 1px solid darkgray;" || David M. Rogers and Susan B. Rempe. "Irreversible Thermodynamics." [http://dx.doi.org/10.1088/1742-6596/402/1/012014 J. Phys.: Conf. Ser. 402:012014, 2012]. |- style="border: 1px solid darkgray;" || David M. Rogers, Thomas L. Beck, and Susan B. Rempe. [[Media:Dmroge_InfoNonequ2011.pdf|"An Information Theory Approach to Nonlinear, Nonequilibrium Thermodynamics."]] [http://dx.doi.org/10.1007/s10955-011-0358-9 J. Stat. Phys. 145(2):385-409, 2011] We show how the interpretation of thermodynamic states as representing system information leads naturally to thermodynamic cycles and the first and second laws of thermodynamics as well as similar formulations for nontrivial nonequilibrium problems. The logical development of the theory also leads naturally to correct indistinguishability factors in the partition function. |- style="border: 1px solid darkgray;" || Sameer Varma, David M. Rogers, Lawrence R. Pratt, and Susan B. Rempe. "Perspectives on Ion Selectivity: Design Principles for K+ Selectivity in Membrane Transport." [http://jgp.rupress.org/content/137/6/479.full J. Gen. Physiol., 137(6):479-488, 2011.] We review the development of models for understanding the physical basis of selectivity for K+ ions over Na+, its sibling only one row behind, in membrane channels and transporters. Although the problem is subtle because of the morass of competing effects, we emphasize work analyzing the systematic influence of the environment on tipping local binding site structure toward selective configurations. |- style="border: 1px solid darkgray;" || David M. Rogers and Susan B. Rempe. [http://www.ncbi.nlm.nih.gov/pmc/articles/PMC3443978/ “Probing the Thermodynamics of Competitive Ion Binding Using Minimum Energy Structures.”] [http://dx.doi.org/10.1021/jp2012864 J. Phys. Chem. B, 115(29):9116-29, 2011]. We presented an extension of the Quasi-Chemical theory for quantifying the impact of local structure on ion complexation thermodynamics. The theory can be simply represented using a set of thermodynamic cycles involving binding site structural and compositional states as reaction intermediates. |- style="border: 1px solid darkgray;" || Susan B. Rempe and David M. Rogers; et. al. “Computational and experimental platform for understanding and optimizing water flux and salt rejection in nanoporous membranes.” [http://prod.sandia.gov/techlib/access-control.cgi/2010/106735.pdf Sandia Technical Report, SAND2010-6735, 2010.] We summarize work on designing polymer coatings for salt exclusion in water transporting nanopores. In this work, I collected available molecular dynamics results for these systems and performed a novel energy efficiency analysis able to relate atomistic and experimental scales as well as identify important design goals and chemical principles for material performance. |- style="border: 1px solid darkgray;" || David M. Rogers, [http://rave.ohiolink.edu/etdc/view?acc_num=ucin1251832030 ''''Using Bayes' Theorem for Free Energy Calculations''''], 2009. We investigated the central quantity of free energies in a Bayesian context and provide estimators for solvation free energies as well as optimal potential of mean force approximations to model polymer coarse-grained dynamics from atomistic simulations. |- style="border: 1px solid darkgray;" || Zhen Zhao, David M. Rogers and Thomas L. Beck. "Polarization and Charge Transfer in the Hydration of Chloride Ions." [http://link.aip.org/link/?JCP/132/014502/1 J. Chem. Phys., 132:014502, 2010.] Dr. Zhao's ab-initio analysis of the charge distribution in water-ion clusters highlighted the importance of many-body water-water interactions and charge transfer effects in determining cluster structural and energetic properties. These are still challenging to represent in modern polarizable forcefields and have implications for anion properties at interfaces. |- style="border: 1px solid darkgray;" || David M. Rogers and Thomas L. Beck. "Quasi-Chemical and Structural Analysis of Polarizable Anion Hydration." [http://link.aip.org/link/?JCP/132/014505/1 J. Chem. Phys., 132:014505, 2010.] The role of polarizability in forcefield-based models of ions and water was examined. Utilizing some of our recent developments on quasi-chemical theory, we have been able to quantify the tightened, asymmetric nature of the ion's local solvation waters induced by increased polarizability as well as the exact effects of polarization on the solvation free energy. The results suggest some potential problems and diagnostics for such models. |- style="border: 1px solid darkgray;" || David M. Rogers and Thomas L. Beck. [http://forcesolve.sourceforge.net/ Force Solve] (Sourceforge, Chicago IL, 2008). This force matching software implements and tests coarse-graining for general molecular systems in a mere 4000 lines of code. It is able to parametrize coarse Hamiltonians from atomic trajectory data given arbitrary definitions of coarse united-atom type models as well as carry out short Langevin Dynamics simulations on the coarse scale. The program's main drawbacks are its slow speed and high memory usage due to its simplistic design, attributable to the interpreted nature of python. |- style="border: 1px solid darkgray;" || David M. Rogers and Thomas L. Beck. "Resolution and Scale Independent Nonparametric Function Matching Using a String Energy Penalized Spline Prior." 2008. [http://arxiv.org/abs/1003.4741 arXiv:1003.4741v1] (stat.ML). Fresh insight is provided into long-standing mathematical issues surrounding computational modeling of continuous functions from a few sampled data points. The present research lays the groundwork for predicting the behavior of complicated many-body systems using advanced regression techniques. |} 800e4529d7ee10a02b06c0621602ae9abe004e6c 380 379 2015-09-24T16:10:28Z David M. Rogers 2 wikitext text/x-wiki {| cellpadding="4" style="border: 1px solid darkgray;" |- style="border: 1px solid darkgray;" || David M. Rogers. "Thermodynamics of Maximum Transition Entropy for Quantum Assemblies." [http://arxiv.org/abs/1503.01232 arXiv:1503.01232 submitted, 2015]. The work presents a new, general, theoretical foundation for the dynamics of ope n quantum systems modeled on the maximum entropy derivation of equilibrium stati stical mechanics. Computational results are presented for three detailed system s to validate and reinforce the theory. It represents a significant advancement for the field, as it lucidly connects the dynamics of a single wavefunction plus environmental noise to the Caldeira-Leggett model for density matrices. |- style="border: 1px solid darkgray;" || David M. Rogers. "Towards a Direct, By-Need Evaluator for Dependently Typed Languages." [http://arxiv.org/abs/1509.07036 arXiv:1509.07036 submitted, 2015]. This paper describes the implementation of a new interpreted language for distributed parallel computing. It achieves its goal by maintaining pure functional semantics, allowing all terms in the language to be partially evaluated and serialized to network storage at any point during computation. |- style="border: 1px solid darkgray;" || Marielle Soniat, David M. Rogers, and Susan Rempe. "Dispersion- and Exchange-Corrected Density Functional Theory for Sodium Ion Hydration." [http://pubs.acs.org/doi/abs/10.1021/acs.jctc.5b00357 J. Chem. Theory. Comput. 142:074101, 2015]. We studied the influence of dispersion energy corrections on the free energy of formation for sodium-water clusters computed with DFT and wound up discovering that dispersion and split-range exchange functionals can somewhat counter-balance each other. The charged sodium ion pulls on the water's electrons, clearly showing which density functionals over-polarize compared to CCSD. Split-range exchange can reduce this over-polarization, but results in reduced electrostatic interaction. Dispersion can lower the binding energy again to counter-balance. So, functionals fit to experimental formation energies need both effects to avoid lowering energies by over-polarizing. |- style="border: 1px solid darkgray;" || David M. Rogers. "Real-space quadrature: a convenient, efficient representation for multipole expansions." [http://dx.doi.org/10.1063/1.4907404 J. Chem. Phys. 142:074101, 2015]. ([http://predictivestatmech.org/papers/real-poles.pdf Presentation]) I introduce sets of point charges that are able to simultaneously reproduce all multipole (spherical harmonic) expansions up to arbitrary order. The number of points is space-optimal. Translations are described from the usual harmonics and from Cartesian moments (dipole, quadrupole, etc.) on supersymmetric tensors to directional moments using the point weight distribution. Many applications are possible, including trivial implementation of multipoles in molecular mechanics and representing probability distributions over rotation space. |- style="border: 1px solid darkgray;" || David M. Rogers, Michael S. Kent, and Susan B. Rempe, "Molecular basis of endosomal-membrane association for the dengue virus envelope protein." [http://dx.doi.org/10.1016/j.bbamem.2014.12.018 BBA Biomembranes 1848(4):1041-52.] A fully atomistic potential of mean force for association of the viral envelope protein from Dengue virus was compared to a Poisson-Boltzmann electrostatic plus dispersion model. The results are consistent, showing hope for this type of combined scale simulation. |- style="border: 1px solid darkgray;" || Yaqin Fu, Binsong Li, Ying-Bing Jiang, Darren R. Dunphy, Andy Tsai, Siu-Yue Tam, Hongyou Fan, Hongxia Zhan, David Rogers, Susan Rempe, Plamen Atanassov, Joseph L. Cecchi, and C. Jeffrey Brinker "Atomic Layer Deposition of L-Alanine Polypeptide." [http://pubs.acs.org/doi/abs/10.1021/ja5043403 JACS 136(45):15821–4, 2014.] This paper with our experimental collaborators carried out blocked peptide synthesis by vapor-depositing Boc-L-alanine to create a uniform thin film of polypeptides grown on a silica substrate activated by aminopropyltrimethoxysilane. |- style="border: 1px solid darkgray;" || David M. Rogers. "Silmaril, A Functional Language for Distributed Parallel Evaluation." [http://predictivestatmech.org/sil/papers/sil.pdf Submitted version] |- style="border: 1px solid darkgray;" || Mathias B. Andersen, David M. Rogers, Junyu Mai, Benjamin Schudel, Anson V. Hatch, Susan B. Rempe and Ali Mani. "Spatiotemporal pH dynamics in concentration polarization near ion-selective membranes." [http://dx.doi.org/10.1021/la5014297 Langmuir, 30(26):7902–7912, 2014] |- style="border: 1px solid darkgray;" || W. K. Chan, P. L. Lorenzi, A. Anishkin, P. Purwaha, D. M. Rogers, S. Sukharev, S.B. Rempe, and J. N. Weinstein. "The glutaminase activity of l-asparaginase is not required for anticancer activity against ASNS-negative cells." [http://dx.doi.org/10.1182/blood-2013-10-535112 Blood. 123(23):3596-606, 2014]. |- style="border: 1px solid darkgray;" || David M. Rogers, Dian Jiao, Lawrence Pratt, and Susan B. Rempe. "Structural Models and Molecular Thermodynamics of Hydration of Ions and Small Molecules" [http://dx.doi.org/10.1016/B978-0-444-59440-2.00004-1 Annu. Rep. Comp. Chem. 8:71–127, 2012.] |- style="border: 1px solid darkgray;" || David M. Rogers and Susan B. Rempe. "Irreversible Thermodynamics." [http://dx.doi.org/10.1088/1742-6596/402/1/012014 J. Phys.: Conf. Ser. 402:012014, 2012]. |- style="border: 1px solid darkgray;" || David M. Rogers, Thomas L. Beck, and Susan B. Rempe. [[Media:Dmroge_InfoNonequ2011.pdf|"An Information Theory Approach to Nonlinear, Nonequilibrium Thermodynamics."]] [http://dx.doi.org/10.1007/s10955-011-0358-9 J. Stat. Phys. 145(2):385-409, 2011] We show how the interpretation of thermodynamic states as representing system information leads naturally to thermodynamic cycles and the first and second laws of thermodynamics as well as similar formulations for nontrivial nonequilibrium problems. The logical development of the theory also leads naturally to correct indistinguishability factors in the partition function. |- style="border: 1px solid darkgray;" || Sameer Varma, David M. Rogers, Lawrence R. Pratt, and Susan B. Rempe. "Perspectives on Ion Selectivity: Design Principles for K+ Selectivity in Membrane Transport." [http://jgp.rupress.org/content/137/6/479.full J. Gen. Physiol., 137(6):479-488, 2011.] We review the development of models for understanding the physical basis of selectivity for K+ ions over Na+, its sibling only one row behind, in membrane channels and transporters. Although the problem is subtle because of the morass of competing effects, we emphasize work analyzing the systematic influence of the environment on tipping local binding site structure toward selective configurations. |- style="border: 1px solid darkgray;" || David M. Rogers and Susan B. Rempe. [http://www.ncbi.nlm.nih.gov/pmc/articles/PMC3443978/ “Probing the Thermodynamics of Competitive Ion Binding Using Minimum Energy Structures.”] [http://dx.doi.org/10.1021/jp2012864 J. Phys. Chem. B, 115(29):9116-29, 2011]. We presented an extension of the Quasi-Chemical theory for quantifying the impact of local structure on ion complexation thermodynamics. The theory can be simply represented using a set of thermodynamic cycles involving binding site structural and compositional states as reaction intermediates. |- style="border: 1px solid darkgray;" || Susan B. Rempe and David M. Rogers; et. al. “Computational and experimental platform for understanding and optimizing water flux and salt rejection in nanoporous membranes.” [http://prod.sandia.gov/techlib/access-control.cgi/2010/106735.pdf Sandia Technical Report, SAND2010-6735, 2010.] We summarize work on designing polymer coatings for salt exclusion in water transporting nanopores. In this work, I collected available molecular dynamics results for these systems and performed a novel energy efficiency analysis able to relate atomistic and experimental scales as well as identify important design goals and chemical principles for material performance. |- style="border: 1px solid darkgray;" || David M. Rogers, [http://rave.ohiolink.edu/etdc/view?acc_num=ucin1251832030 ''''Using Bayes' Theorem for Free Energy Calculations''''], 2009. We investigated the central quantity of free energies in a Bayesian context and provide estimators for solvation free energies as well as optimal potential of mean force approximations to model polymer coarse-grained dynamics from atomistic simulations. |- style="border: 1px solid darkgray;" || Zhen Zhao, David M. Rogers and Thomas L. Beck. "Polarization and Charge Transfer in the Hydration of Chloride Ions." [http://link.aip.org/link/?JCP/132/014502/1 J. Chem. Phys., 132:014502, 2010.] Dr. Zhao's ab-initio analysis of the charge distribution in water-ion clusters highlighted the importance of many-body water-water interactions and charge transfer effects in determining cluster structural and energetic properties. These are still challenging to represent in modern polarizable forcefields and have implications for anion properties at interfaces. |- style="border: 1px solid darkgray;" || David M. Rogers and Thomas L. Beck. "Quasi-Chemical and Structural Analysis of Polarizable Anion Hydration." [http://link.aip.org/link/?JCP/132/014505/1 J. Chem. Phys., 132:014505, 2010.] The role of polarizability in forcefield-based models of ions and water was examined. Utilizing some of our recent developments on quasi-chemical theory, we have been able to quantify the tightened, asymmetric nature of the ion's local solvation waters induced by increased polarizability as well as the exact effects of polarization on the solvation free energy. The results suggest some potential problems and diagnostics for such models. |- style="border: 1px solid darkgray;" || David M. Rogers and Thomas L. Beck. [http://forcesolve.sourceforge.net/ Force Solve] (Sourceforge, Chicago IL, 2008). This force matching software implements and tests coarse-graining for general molecular systems in a mere 4000 lines of code. It is able to parametrize coarse Hamiltonians from atomic trajectory data given arbitrary definitions of coarse united-atom type models as well as carry out short Langevin Dynamics simulations on the coarse scale. The program's main drawbacks are its slow speed and high memory usage due to its simplistic design, attributable to the interpreted nature of python. |- style="border: 1px solid darkgray;" || David M. Rogers and Thomas L. Beck. "Resolution and Scale Independent Nonparametric Function Matching Using a String Energy Penalized Spline Prior." 2008. [http://arxiv.org/abs/1003.4741 arXiv:1003.4741v1] (stat.ML). Fresh insight is provided into long-standing mathematical issues surrounding computational modeling of continuous functions from a few sampled data points. The present research lays the groundwork for predicting the behavior of complicated many-body systems using advanced regression techniques. |} 70c739a0e988d1a9cfa7ef3d988bdc7305a3bb80 401 380 2016-01-04T20:16:00Z David M. Rogers 2 wikitext text/x-wiki {| cellpadding="4" style="border: 1px solid darkgray;" |- style="border: 1px solid darkgray;" || David M. Rogers. "Thermodynamics of Maximum Transition Entropy for Quantum Assemblies." [http://arxiv.org/abs/1503.01232 arXiv:1503.01232 submitted, 2015]. The work presents a new, general, theoretical foundation for the dynamics of ope n quantum systems modeled on the maximum entropy derivation of equilibrium stati stical mechanics. Computational results are presented for three detailed system s to validate and reinforce the theory. It represents a significant advancement for the field, as it lucidly connects the dynamics of a single wavefunction plus environmental noise to the Caldeira-Leggett model for density matrices. |- style="border: 1px solid darkgray;" || Andriy Anishkin, Juan M. Vanegas, David M. Rogers, Philip L. Lorenzi, Wai Kin Chan, Preeti Purwaha, John N. Weinstein, Sergei Sukharev, and Susan B. Rempe. "Catalytic Role of the Substrate Defines Specificity of Therapeutic L-Asparaginase." [http://dx.doi.org/10.1016/j.jmb.2015.06.017 J. Mol. Biol. 427:2867-2885, 2015]. We present an explanation for the (until now controversial) catalytic mechanism of type 2 bacterial L-asparaginase enzymes. By using the carboxylic acid of the substrate (asparagine) as the proton acceptor, this enzyme is able to preferentially carry out deamidation on asparagine more quickly than for the competing substrate, glutamine. The hypothesis, re-discovered from our MD simulations, was first put forward years ago in contested experimental studies, and now finds additional support from our MD and QM calculations. |- style="border: 1px solid darkgray;" || David M. Rogers. "Towards a Direct, By-Need Evaluator for Dependently Typed Languages." [http://arxiv.org/abs/1509.07036 arXiv:1509.07036 submitted, 2015]. This paper describes the implementation of a new interpreted language for distributed parallel computing. It achieves its goal by maintaining pure functional semantics, allowing all terms in the language to be partially evaluated and serialized to network storage at any point during computation. |- style="border: 1px solid darkgray;" || Marielle Soniat, David M. Rogers, and Susan Rempe. "Dispersion- and Exchange-Corrected Density Functional Theory for Sodium Ion Hydration." [http://pubs.acs.org/doi/abs/10.1021/acs.jctc.5b00357 J. Chem. Theory. Comput. 142:074101, 2015]. We studied the influence of dispersion energy corrections on the free energy of formation for sodium-water clusters computed with DFT and wound up discovering that dispersion and split-range exchange functionals can somewhat counter-balance each other. The charged sodium ion pulls on the water's electrons, clearly showing which density functionals over-polarize compared to CCSD. Split-range exchange can reduce this over-polarization, but results in reduced electrostatic interaction. Dispersion can lower the binding energy again to counter-balance. So, functionals fit to experimental formation energies need both effects to avoid lowering energies by over-polarizing. |- style="border: 1px solid darkgray;" || David M. Rogers. "Real-space quadrature: a convenient, efficient representation for multipole expansions." [http://dx.doi.org/10.1063/1.4907404 J. Chem. Phys. 142:074101, 2015]. ([http://predictivestatmech.org/papers/real-poles.pdf Presentation]) I introduce sets of point charges that are able to simultaneously reproduce all multipole (spherical harmonic) expansions up to arbitrary order. The number of points is space-optimal. Translations are described from the usual harmonics and from Cartesian moments (dipole, quadrupole, etc.) on supersymmetric tensors to directional moments using the point weight distribution. Many applications are possible, including trivial implementation of multipoles in molecular mechanics and representing probability distributions over rotation space. |- style="border: 1px solid darkgray;" || David M. Rogers, Michael S. Kent, and Susan B. Rempe, "Molecular basis of endosomal-membrane association for the dengue virus envelope protein." [http://dx.doi.org/10.1016/j.bbamem.2014.12.018 BBA Biomembranes 1848(4):1041-52.] A fully atomistic potential of mean force for association of the viral envelope protein from Dengue virus was compared to a Poisson-Boltzmann electrostatic plus dispersion model. The results are consistent, showing hope for this type of combined scale simulation. |- style="border: 1px solid darkgray;" || Yaqin Fu, Binsong Li, Ying-Bing Jiang, Darren R. Dunphy, Andy Tsai, Siu-Yue Tam, Hongyou Fan, Hongxia Zhan, David Rogers, Susan Rempe, Plamen Atanassov, Joseph L. Cecchi, and C. Jeffrey Brinker "Atomic Layer Deposition of L-Alanine Polypeptide." [http://pubs.acs.org/doi/abs/10.1021/ja5043403 JACS 136(45):15821–4, 2014.] This paper with our experimental collaborators carried out blocked peptide synthesis by vapor-depositing Boc-L-alanine to create a uniform thin film of polypeptides grown on a silica substrate activated by aminopropyltrimethoxysilane. |- style="border: 1px solid darkgray;" || David M. Rogers. "Silmaril, A Functional Language for Distributed Parallel Evaluation." [http://predictivestatmech.org/sil/papers/sil.pdf Submitted version] |- style="border: 1px solid darkgray;" || Mathias B. Andersen, David M. Rogers, Junyu Mai, Benjamin Schudel, Anson V. Hatch, Susan B. Rempe and Ali Mani. "Spatiotemporal pH dynamics in concentration polarization near ion-selective membranes." [http://dx.doi.org/10.1021/la5014297 Langmuir, 30(26):7902–7912, 2014] |- style="border: 1px solid darkgray;" || W. K. Chan, P. L. Lorenzi, A. Anishkin, P. Purwaha, D. M. Rogers, S. Sukharev, S.B. Rempe, and J. N. Weinstein. "The glutaminase activity of l-asparaginase is not required for anticancer activity against ASNS-negative cells." [http://dx.doi.org/10.1182/blood-2013-10-535112 Blood. 123(23):3596-606, 2014]. |- style="border: 1px solid darkgray;" || David M. Rogers, Dian Jiao, Lawrence Pratt, and Susan B. Rempe. "Structural Models and Molecular Thermodynamics of Hydration of Ions and Small Molecules" [http://dx.doi.org/10.1016/B978-0-444-59440-2.00004-1 Annu. Rep. Comp. Chem. 8:71–127, 2012.] |- style="border: 1px solid darkgray;" || David M. Rogers and Susan B. Rempe. "Irreversible Thermodynamics." [http://dx.doi.org/10.1088/1742-6596/402/1/012014 J. Phys.: Conf. Ser. 402:012014, 2012]. |- style="border: 1px solid darkgray;" || David M. Rogers, Thomas L. Beck, and Susan B. Rempe. [[Media:Dmroge_InfoNonequ2011.pdf|"An Information Theory Approach to Nonlinear, Nonequilibrium Thermodynamics."]] [http://dx.doi.org/10.1007/s10955-011-0358-9 J. Stat. Phys. 145(2):385-409, 2011] We show how the interpretation of thermodynamic states as representing system information leads naturally to thermodynamic cycles and the first and second laws of thermodynamics as well as similar formulations for nontrivial nonequilibrium problems. The logical development of the theory also leads naturally to correct indistinguishability factors in the partition function. |- style="border: 1px solid darkgray;" || Sameer Varma, David M. Rogers, Lawrence R. Pratt, and Susan B. Rempe. "Perspectives on Ion Selectivity: Design Principles for K+ Selectivity in Membrane Transport." [http://jgp.rupress.org/content/137/6/479.full J. Gen. Physiol., 137(6):479-488, 2011.] We review the development of models for understanding the physical basis of selectivity for K+ ions over Na+, its sibling only one row behind, in membrane channels and transporters. Although the problem is subtle because of the morass of competing effects, we emphasize work analyzing the systematic influence of the environment on tipping local binding site structure toward selective configurations. |- style="border: 1px solid darkgray;" || David M. Rogers and Susan B. Rempe. [http://www.ncbi.nlm.nih.gov/pmc/articles/PMC3443978/ “Probing the Thermodynamics of Competitive Ion Binding Using Minimum Energy Structures.”] [http://dx.doi.org/10.1021/jp2012864 J. Phys. Chem. B, 115(29):9116-29, 2011]. We presented an extension of the Quasi-Chemical theory for quantifying the impact of local structure on ion complexation thermodynamics. The theory can be simply represented using a set of thermodynamic cycles involving binding site structural and compositional states as reaction intermediates. |- style="border: 1px solid darkgray;" || Susan B. Rempe and David M. Rogers; et. al. “Computational and experimental platform for understanding and optimizing water flux and salt rejection in nanoporous membranes.” [http://prod.sandia.gov/techlib/access-control.cgi/2010/106735.pdf Sandia Technical Report, SAND2010-6735, 2010.] We summarize work on designing polymer coatings for salt exclusion in water transporting nanopores. In this work, I collected available molecular dynamics results for these systems and performed a novel energy efficiency analysis able to relate atomistic and experimental scales as well as identify important design goals and chemical principles for material performance. |- style="border: 1px solid darkgray;" || David M. Rogers, [http://rave.ohiolink.edu/etdc/view?acc_num=ucin1251832030 ''''Using Bayes' Theorem for Free Energy Calculations''''], 2009. We investigated the central quantity of free energies in a Bayesian context and provide estimators for solvation free energies as well as optimal potential of mean force approximations to model polymer coarse-grained dynamics from atomistic simulations. |- style="border: 1px solid darkgray;" || Zhen Zhao, David M. Rogers and Thomas L. Beck. "Polarization and Charge Transfer in the Hydration of Chloride Ions." [http://link.aip.org/link/?JCP/132/014502/1 J. Chem. Phys., 132:014502, 2010.] Dr. Zhao's ab-initio analysis of the charge distribution in water-ion clusters highlighted the importance of many-body water-water interactions and charge transfer effects in determining cluster structural and energetic properties. These are still challenging to represent in modern polarizable forcefields and have implications for anion properties at interfaces. |- style="border: 1px solid darkgray;" || David M. Rogers and Thomas L. Beck. "Quasi-Chemical and Structural Analysis of Polarizable Anion Hydration." [http://link.aip.org/link/?JCP/132/014505/1 J. Chem. Phys., 132:014505, 2010.] The role of polarizability in forcefield-based models of ions and water was examined. Utilizing some of our recent developments on quasi-chemical theory, we have been able to quantify the tightened, asymmetric nature of the ion's local solvation waters induced by increased polarizability as well as the exact effects of polarization on the solvation free energy. The results suggest some potential problems and diagnostics for such models. |- style="border: 1px solid darkgray;" || David M. Rogers and Thomas L. Beck. [http://forcesolve.sourceforge.net/ Force Solve] (Sourceforge, Chicago IL, 2008). This force matching software implements and tests coarse-graining for general molecular systems in a mere 4000 lines of code. It is able to parametrize coarse Hamiltonians from atomic trajectory data given arbitrary definitions of coarse united-atom type models as well as carry out short Langevin Dynamics simulations on the coarse scale. The program's main drawbacks are its slow speed and high memory usage due to its simplistic design, attributable to the interpreted nature of python. |- style="border: 1px solid darkgray;" || David M. Rogers and Thomas L. Beck. "Resolution and Scale Independent Nonparametric Function Matching Using a String Energy Penalized Spline Prior." 2008. [http://arxiv.org/abs/1003.4741 arXiv:1003.4741v1] (stat.ML). Fresh insight is provided into long-standing mathematical issues surrounding computational modeling of continuous functions from a few sampled data points. The present research lays the groundwork for predicting the behavior of complicated many-body systems using advanced regression techniques. |} 994d3d44b7fd1ae721a2176f086907cc36d13499 File:Pchem quiz1-5.pdf 6 80 383 2015-10-01T03:31:18Z David M. Rogers 2 wikitext text/x-wiki da39a3ee5e6b4b0d3255bfef95601890afd80709 File:Pchem bquiz1-5.pdf 6 81 385 2015-10-07T15:00:22Z David M. Rogers 2 wikitext text/x-wiki da39a3ee5e6b4b0d3255bfef95601890afd80709 File:Final hw.pdf 6 82 387 2015-10-15T19:02:05Z David M. Rogers 2 wikitext text/x-wiki da39a3ee5e6b4b0d3255bfef95601890afd80709 388 387 2015-10-15T21:23:17Z David M. Rogers 2 David M. Rogers uploaded a new version of &quot;[[File:Final hw.pdf]]&quot; wikitext text/x-wiki da39a3ee5e6b4b0d3255bfef95601890afd80709 CompSciFall2014 0 38 390 238 2015-10-22T16:58:39Z David M. Rogers 2 wikitext text/x-wiki '''<BIG>Introduction to Scientific Computing</BIG>''' Course Info * Course Numbers CHM 4932/6938, CRN: 94314 * Credit Hours: 3 * Meeting Dates: Aug. 25 - Dec. 3, 2014 ** No Class Sept. 1, Oct. 17, and Nov. 28 * Meeting Times: Mon. and Wed., 12:30-13:45 in SCA 222 ** Lab Session & Office Hours: Fri. 12:30-13:45 in SCA 222 * Assignments: ** [[#Notes & Homework|Weekly Homework]] (60%) ** Midterm Project (20%) *** Topic by Friday, Sept. 19 *** due Friday, Oct. 17, 2014 ** Final Project (20%) *** Topic by Friday, Nov. 14 *** due Friday, Dec. 5, 2014 == Overview == Mathematical models in the natural sciences take many shapes and forms. The moment they become more complicated than tracking a few variables over time, we have to put away our Excel spreadsheets and make use of a solid foundation in computational science. The course establishes this foundation by introducing data structures and algorithms used in everyday scientific computing using examples in the python scripting language. By the end of the Semester, students will be able to navigate the Linux command-line to go from a mathematical model to a numerical solution. Best practices for working with computer code and visualizing data will also be covered. == Textbooks and Resources == * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-0072-7 Beginning Python, Hetland, 2005] (eBook avail. from USF Library) * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-3238-4 Python Algorithms, Hetland, 2010] (eBook avail. from USF Library) * [http://aosabook.org/en/index.html The Architecture of Open Source Applications] * [http://docs.python.org Python Documentation] * [https://developers.google.com/edu/python/ Google Introductory Python Notes] Other (possibly useful) materials: * Chapters 7&8 of Modelling and Simulation, Birta and Arbez, Springer 2007 (eBook avail. from USF Library). * Chapters 4-6 of Models and Algorithms for Intelligent Data Analysis, Runkler, Springer 2012 (eBook avail. from USF Library). * Guide to Scientific Computing in C++, Francis and Whiteley, Springer, 2012. (eBook avail. from USF Library) * Extra info. On the basics: ** Chapters 3 and 7 of Mathematics in Computing, Regan, Springer 2013. (eBook avail. from USF Library) ** Instant feedback graphical programming with [https://www.khanacademy.org/cs/programming/ Khan Academy] * [http://www.meetup.com/python-178/ Local PyBulls Meetings] Code: * [http://carsonfarmer.com/2013/07/essential-python-geo-libraries Python Libraries Useful for Geospatial Problems] * [[Code#Python_Libraries|Python Libraries Useful for Computational Chemistry]] (very small list at present) Interactive Interpreters: * [http://www.codewars.com CodeWars] Recommended for building experience with practice problems. * [http://exercism.io Exercism] A command-line client with a similar learn-through-challenge philosophy. * [http://repl.it repl.it] A read-eval-print loop for several computer languages. * [http://en.cppreference.com/w/cpp/language CppReference] Documentation with an online evaluator for C++ code. == Topics == # Languages #* bash (shell) #* python (scripting) #* stack & register-based machine languages: overview of C and Fortran syntax & compiling with gcc, ‘thread safety’ #* Shared libraries & language inter-operability (FFI) # Algorithms #* Horner’s algorithm for polynomials #* Newton’s root finding algo. #* Overview of general optimization algo-s (example: linear & nonlin. least-squares) #* Numerical integration (scripted, plus gnu ODE) #* Communication (how HTTP get/put works) # Data Structures #* Linked Lists #* Trees (file system hierarchies) #* Graphs #* Arrays (dense & sparse) example: vectors & rotations / transpositions, densities and difference operators # Presentation & visualization #* Flat CSV files (and excel) #* Working with binary data #* Python matplotlib (2D images) #* Binning histograms & weighted averages # Best Practices #* High-level code design (modularity, interface specifications, unit testing, etc.) #* Code audit: open-source libraries, ex. Gnu Scientific Library, qsort in libc, Boost #* Source code versioning (example: git or mercurial) #* gdb & execution profiling #* documentation #* Makefiles === Notes & Homework === * [[CompSciWeek1]] Aug. 25 * [[CompSciWeek2]] Sept. 1 * [[CompSciWeek3]] Sept. 8 * [[CompSciWeek4]] Sept. 15 * [[CompSciWeek5]] Sept. 22 * [[CompSciWeek6]] Sept. 29 * [[CompSciWeek7]] Oct. 6 * [[CompSciWeek8]] Oct. 13 (No class Fri., Oct. 17) * [[CompSciWeek9]] Oct. 20 * [[CompSciWeek10]] Oct. 27 * [[CompSciWeek11]] Nov. 3 * [[CompSciWeek12]] Nov. 10 * [[CompSciWeek13]] Nov. 17 * [[CompSciWeek14-15]] Nov. 24 (No class Fri., Nov. 28) * [[CompSciWeek14-15]] Dec. 1 96be6e844416a0d3d5aa476a0470482fbca212d2 File:Pchem bquiz6-12.pdf 6 83 397 2015-12-08T02:37:03Z David M. Rogers 2 wikitext text/x-wiki da39a3ee5e6b4b0d3255bfef95601890afd80709 File:Pchem quiz6-12.pdf 6 84 399 2015-12-09T03:36:35Z David M. Rogers 2 wikitext text/x-wiki da39a3ee5e6b4b0d3255bfef95601890afd80709 Predictive Chemistry:Current events 4 10 400 349 2016-01-04T15:33:53Z David M. Rogers 2 wikitext text/x-wiki * July 12-16, 2016: David M. Rogers presents "A Molecular Approach to Dispersion Energy", at the TSRC Workshop on Ions in Solution: Biology, Energy, and Environment. * Mar. 13-17, 2016: David M. Rogers presents "The Quantum Andersen Thermostat," at the 2016 ACS Spring Meeting. * Friday, January 15, 2016: David M. Rogers presents "Angle-free methods for boundary element problems on the sphere: The quadrature basis for spherical harmonics," at the USF Mathematics Department Analysis Lecture Series. * Monday, Jan 11, 2016: USF Spring 2016 semester classes begin. * Tuesday, December 15, 2015: David M. Rogers presents "Maximum Transition Entropy - A Causal, Canonical Model for Nonequilibrium Statistical Mechanics," at the 114th Statistical Mechanics Conference at Rutgers, New Brunswick New Jersey. * Monday, September 14, 2015, Invited Presentation, "Understanding the origins of irreversibility: electrical driving and the second law.," Tulane Department of Chemistry. * July 27-30, 2015 Travel to DOE Comp. Sci. Graduate Fellowship Program Review in Arlington, VA. * June, 2015: JCTC Publishes our [http://pubs.acs.org/doi/abs/10.1021/acs.jctc.5b00357 article] on "Dispersion- and Exchange-Corrected Density Functional Theory for Sodium Ion Hydration" * Wednesday, May 13, 2015: David M. Rogers presented "Spatiotemporal Concentration-Polarization Induced pH Changes at Ion-Selective Membranes." at the [https://www.cbdstconference.com/agenda Chemical and Biological Defense Sci. & Tech. conference] in St. Louis, MO. * Friday, May 8, 2015: David M. Rogers presented "Where do Quanta Come From?" at the Florida ACS Meeting and Exhibition ([http://fame2015.fl-acs.org/ataglance.html FAME]). * April, 2015: [http://scitation.aip.org/content/aip/journal/jcp/142/7/10.1063/1.4907404 Real-Space Quadrature paper] was published as a cover article by JCP. * Wednesday, Mar. 4, 2015: David M. Rogers presented "[http://meetings.aps.org/Meeting/MAR15/Session/M44.9 Thermodynamics of Maximum Transition Entropy for Quantum Assemblies]." at the APS March Meeting in San Antonio, TX. * Saturday, Nov. 22 2014: USF and neighboring universities are hosting a [http://predictivestatmech.org/papers/MRI-flyer.pdf Scientific Computing Workshop] for undergraduates. Follow the instructions in the flyer to sign up by Nov. 11! * Thursday, Oct. 16: David M. Rogers presented "[http://predictivestatmech.org/papers/real-poles.pdf Real-space quadrature: A convenient, universal representation for multipole expansions]." at the Southeast Regional Meeting of the ACS in Nashville, TN. * Friday, Aug. 29 2014: Felipe Zapata joins the group * Monday, Aug. 25 2014: USF Autumn Semester First Day of Classes - don't forget to sign up for [[CompSciFall2014|Introduction to Scientific Computing]]! * Monday, Aug. 18 2014: David M. Rogers presented an invited talk "pH Dynamics During Concentration Polarization," to the [http://www.pnnl.gov/computing/cm4/ CM4 Mathematics for Mesoscopic Materials Modeling Group]. * Tuesday, July 8 2014: David M. Rogers presented "What’s Holding Up Multiscale modeling?" at the Telluride, CO workshop for [http://www.telluridescience.org/meetings/workshop-details?wid=404 Ions in Aqueous Solutions and Molecular Biology]. * Friday, May 9 2014: David M. Rogers presented "Jumping from atomistic to continuum simulation of electrochemical driving at interfaces," at the 2014 Florida FAME Conference.[http://www.fame.chem.ufl.edu/computational.html] * January 29th, 2014: David M. Rogers presented "Simulating at the molecular / continuum interface," at the USF Research Computing User's Group Forum [http://www.usf.edu/it/research-computing/featured-researchers/rogersgroup.aspx]. * Monday, Aug. 26 2013: USF Autumn Semester First Day of Classes * Friday, July 12, 2013: Argonne Center for Nanoscale Materials [http://nano.anl.gov/users/call_for_proposals.html Proposal Deadline] * Thursday, July 4, 2013: Independence Day - celebrate by supporting [https://www.eff.org/ EFF] * Thursday, April 11 2013: David M. Rogers presented "Solute Partitioning and Transport through Natural and Biomimetic Membranes," at the 2013 ACS National Meeting. == Calendars == * [http://www.registrar.usf.edu/enroll/regist/calendt.php USF Calendar] 35757e9fd06fc976c1fad9080d0453ab3c05786d CompSciSpring2016 0 85 402 2016-01-08T21:51:41Z David M. Rogers 2 Created page with "'''<BIG>Introduction to Scientific Computing</BIG>''' Course Info * Course Numbers CHM 4932-004/6938-010, CRN: 22347/22348 * Credit Hours: 3 * Meeting Dates: January 22 - Apr..." wikitext text/x-wiki '''<BIG>Introduction to Scientific Computing</BIG>''' Course Info * Course Numbers CHM 4932-004/6938-010, CRN: 22347/22348 * Credit Hours: 3 * Meeting Dates: January 22 - April 27, 2016 ** No Class Jan. 18 or Mar. 14-19 * Meeting Times: Mon. and Wed., 12:30-13:45 in SCA 222 ** Lab Session & Office Hours: Fri. 12:30-13:45 in SCA 222 (or SCA 433) == Grading == '''Grading Scale (out of 400 points possible)''' {| class="wikitable" |- ! Grade ! Undergraduate ! Graduate |- | A | 230 | 300 |- | B | 180 | 230 |- | C | 150 | 180 |- | D | 120 | 150 |} * Points Possible: ** 10 homework assignments (20 points per homework) ** 2 projects / competitions (100 points per project) * Homework Rules ** For work done in groups, credit is divided equally among participants - so the max homework grade for a group of 2 is 10 points each. ** For each homework, 1 re-do at full credit can be sent at any time after the due date, but must present a unique solution to previous work from yourself or others. ** All work must cite co-group members (if any) and the source of any code snippets used online. === Grading Rationale == Homework points will only be awarded for correct, working code and correct algorithmic analysis, while the homework problems will become progressively tougher. Undergraduates should be able to pass the course with an A if they have correctly answered most of the homework, and made a strong attempt at one of the projects. Graduate students should both perform well on the homework and successfully complete one or two projects. Essentially, this means you should do your own homework when possible and may do a project in a small group. The re-grading and group options for homework allow making up for missed assignments, and encourage returning to core concepts at a later point in the class. Students who have completed significant portions of the homework have thus demonstrated programming proficiency, and are qualified for at least B/C grades. == Projects == === Midterm === TBA === Final === TBA == Overview == Mathematical models in the natural sciences take many shapes and forms. The moment they become more complicated than tracking a few variables over time, we have to put away our Excel spreadsheets and make use of a solid foundation in computational science. The course establishes this foundation by introducing data structures and algorithms used in everyday scientific computing using examples in the python scripting language. By the end of the Semester, students will be able to navigate the Linux command-line to go from a mathematical model to a numerical solution. Best practices for working with computer code and visualizing data will also be covered. == Textbooks and Resources == * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-0072-7 Beginning Python, Hetland, 2005] (eBook avail. from USF Library) * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-3238-4 Python Algorithms, Hetland, 2010] (eBook avail. from USF Library) * [http://aosabook.org/en/index.html The Architecture of Open Source Applications] * [http://docs.python.org Python Documentation] * [https://developers.google.com/edu/python/ Google Introductory Python Notes] * [http://huffman.sourceforge.net/tao/tao-of-programming.html Tao of Programming] Other (possibly useful) materials: * Chapters 7&8 of Modelling and Simulation, Birta and Arbez, Springer 2007 (eBook avail. from USF Library). * Chapters 4-6 of Models and Algorithms for Intelligent Data Analysis, Runkler, Springer 2012 (eBook avail. from USF Library). * Guide to Scientific Computing in C++, Francis and Whiteley, Springer, 2012. (eBook avail. from USF Library) * Extra info. On the basics: ** Chapters 3 and 7 of Mathematics in Computing, Regan, Springer 2013. (eBook avail. from USF Library) ** Instant feedback graphical programming with [https://www.khanacademy.org/cs/programming/ Khan Academy] * [http://www.meetup.com/python-178/ Local PyBulls Meetings] Code: * [http://carsonfarmer.com/2013/07/essential-python-geo-libraries Python Libraries Useful for Geospatial Problems] * [[Code#Python_Libraries|Python Libraries Useful for Computational Chemistry]] (very small list at present) Interactive Interpreters: * [http://www.codewars.com CodeWars] Recommended for building experience with practice problems. * [http://exercism.io Exercism] A command-line client with a similar learn-through-challenge philosophy. * [http://repl.it repl.it] A read-eval-print loop for several computer languages. * [http://en.cppreference.com/w/cpp/language CppReference] Documentation with an online evaluator for C++ code. == Topics == # Languages #* bash (shell) #* python (scripting) #* stack & register-based machine languages: overview of C and Fortran syntax & compiling with gcc, ‘thread safety’ #* Shared libraries & language inter-operability (FFI) # Algorithms #* Horner’s algorithm for polynomials #* Newton’s root finding algo. #* Overview of general optimization algo-s (example: linear & nonlin. least-squares) #* Numerical integration (scripted, plus gnu ODE) #* Communication (how HTTP get/put works) # Data Structures #* Linked Lists #* Trees (file system hierarchies) #* Graphs #* Arrays (dense & sparse) example: vectors & rotations / transpositions, densities and difference operators # Presentation & visualization #* Flat CSV files (and excel) #* Working with binary data #* Python matplotlib (2D images) #* Binning histograms & weighted averages # Best Practices #* High-level code design (modularity, interface specifications, unit testing, etc.) #* Code audit: open-source libraries, ex. Gnu Scientific Library, qsort in libc, Boost #* Source code versioning (example: git or mercurial) #* gdb & execution profiling #* documentation #* Makefiles === Notes & Homework === 2d9c196c782c25a8df09da49d4cd6225a69a016b 403 402 2016-01-08T21:52:54Z David M. Rogers 2 wikitext text/x-wiki '''<BIG>Introduction to Scientific Computing</BIG>''' Course Info * Course Numbers CHM 4932-004/6938-010, CRN: 22347/22348 * Credit Hours: 3 * Meeting Dates: January 22 - April 27, 2016 ** No Class Jan. 18 or Mar. 14-19 * Meeting Times: Mon. and Wed., 12:30-13:45 in SCA 222 ** Lab Session & Office Hours: Fri. 12:30-13:45 in SCA 222 (or SCA 433) == Grading == '''Grading Scale (out of 400 points possible)''' {| class="wikitable" |- ! Grade ! Undergraduate ! Graduate |- | A | 230 | 300 |- | B | 180 | 230 |- | C | 150 | 180 |- | D | 120 | 150 |} * Points Possible: ** 10 homework assignments (20 points per homework) ** 2 projects / competitions (100 points per project) * Homework Rules ** For work done in groups, credit is divided equally among participants - so the max homework grade for a group of 2 is 10 points each. ** For each homework, 1 re-do at full credit can be sent at any time after the due date, but must present a unique solution to previous work from yourself or others. ** All work must cite co-group members (if any) and the source of any code snippets used online. === Grading Rationale == Homework points will only be awarded for correct, working code and correct algorithmic analysis, while the homework problems will become progressively tougher. Undergraduates should be able to pass the course with an A if they have correctly answered most of the homework, and made a strong attempt at one of the projects. Graduate students should both perform well on the homework and successfully complete one or two projects. Essentially, this means you should do your own homework when possible and may do a project in a small group. The re-grading and group options for homework allow making up for missed assignments, and encourage returning to core concepts at a later point in the class. Students who have completed significant portions of the homework have thus demonstrated programming proficiency, and are qualified for at least B/C grades. == Projects == === Midterm === TBA === Final === TBA == Overview == Mathematical models in the natural sciences take many shapes and forms. The moment they become more complicated than tracking a few variables over time, we have to put away our Excel spreadsheets and make use of a solid foundation in computational science. The course establishes this foundation by introducing data structures and algorithms used in everyday scientific computing using examples in the python scripting language. By the end of the Semester, students will be able to navigate the Linux command-line to go from a mathematical model to a numerical solution. Best practices for working with computer code and visualizing data will also be covered. == Textbooks and Resources == * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-0072-7 Beginning Python, Hetland, 2005] (eBook avail. from USF Library) * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-3238-4 Python Algorithms, Hetland, 2010] (eBook avail. from USF Library) * [http://aosabook.org/en/index.html The Architecture of Open Source Applications] * [http://docs.python.org Python Documentation] * [https://developers.google.com/edu/python/ Google Introductory Python Notes] * [http://huffman.sourceforge.net/tao/tao-of-programming.html Tao of Programming] Other (possibly useful) materials: * Chapters 7&8 of Modelling and Simulation, Birta and Arbez, Springer 2007 (eBook avail. from USF Library). * Chapters 4-6 of Models and Algorithms for Intelligent Data Analysis, Runkler, Springer 2012 (eBook avail. from USF Library). * Guide to Scientific Computing in C++, Francis and Whiteley, Springer, 2012. (eBook avail. from USF Library) * Extra info. On the basics: ** Chapters 3 and 7 of Mathematics in Computing, Regan, Springer 2013. (eBook avail. from USF Library) ** Instant feedback graphical programming with [https://www.khanacademy.org/cs/programming/ Khan Academy] * [http://www.meetup.com/python-178/ Local PyBulls Meetings] Code: * [http://carsonfarmer.com/2013/07/essential-python-geo-libraries Python Libraries Useful for Geospatial Problems] * [[Code#Python_Libraries|Python Libraries Useful for Computational Chemistry]] (very small list at present) Interactive Interpreters: * [http://www.codewars.com CodeWars] Recommended for building experience with practice problems. * [http://exercism.io Exercism] A command-line client with a similar learn-through-challenge philosophy. * [http://repl.it repl.it] A read-eval-print loop for several computer languages. * [http://en.cppreference.com/w/cpp/language CppReference] Documentation with an online evaluator for C++ code. == Topics == # Languages #* bash (shell) #* python (scripting) #* stack & register-based machine languages: overview of C and Fortran syntax & compiling with gcc, ‘thread safety’ #* Shared libraries & language inter-operability (FFI) # Algorithms #* Horner’s algorithm for polynomials #* Newton’s root finding algo. #* Overview of general optimization algo-s (example: linear & nonlin. least-squares) #* Numerical integration (scripted, plus gnu ODE) #* Communication (how HTTP get/put works) # Data Structures #* Linked Lists #* Trees (file system hierarchies) #* Graphs #* Arrays (dense & sparse) example: vectors & rotations / transpositions, densities and difference operators # Presentation & visualization #* Flat CSV files (and excel) #* Working with binary data #* Python matplotlib (2D images) #* Binning histograms & weighted averages # Best Practices #* High-level code design (modularity, interface specifications, unit testing, etc.) #* Code audit: open-source libraries, ex. Gnu Scientific Library, qsort in libc, Boost #* Source code versioning (example: git or mercurial) #* gdb & execution profiling #* documentation #* Makefiles === Notes & Homework === 933dba9fdc4b80e20452de876b9d6100170a65b6 404 403 2016-01-08T21:53:15Z David M. Rogers 2 /* = Grading Rationale */ wikitext text/x-wiki '''<BIG>Introduction to Scientific Computing</BIG>''' Course Info * Course Numbers CHM 4932-004/6938-010, CRN: 22347/22348 * Credit Hours: 3 * Meeting Dates: January 22 - April 27, 2016 ** No Class Jan. 18 or Mar. 14-19 * Meeting Times: Mon. and Wed., 12:30-13:45 in SCA 222 ** Lab Session & Office Hours: Fri. 12:30-13:45 in SCA 222 (or SCA 433) == Grading == '''Grading Scale (out of 400 points possible)''' {| class="wikitable" |- ! Grade ! Undergraduate ! Graduate |- | A | 230 | 300 |- | B | 180 | 230 |- | C | 150 | 180 |- | D | 120 | 150 |} * Points Possible: ** 10 homework assignments (20 points per homework) ** 2 projects / competitions (100 points per project) * Homework Rules ** For work done in groups, credit is divided equally among participants - so the max homework grade for a group of 2 is 10 points each. ** For each homework, 1 re-do at full credit can be sent at any time after the due date, but must present a unique solution to previous work from yourself or others. ** All work must cite co-group members (if any) and the source of any code snippets used online. === Grading Rationale === Homework points will only be awarded for correct, working code and correct algorithmic analysis, while the homework problems will become progressively tougher. Undergraduates should be able to pass the course with an A if they have correctly answered most of the homework, and made a strong attempt at one of the projects. Graduate students should both perform well on the homework and successfully complete one or two projects. Essentially, this means you should do your own homework when possible and may do a project in a small group. The re-grading and group options for homework allow making up for missed assignments, and encourage returning to core concepts at a later point in the class. Students who have completed significant portions of the homework have thus demonstrated programming proficiency, and are qualified for at least B/C grades. == Projects == === Midterm === TBA === Final === TBA == Overview == Mathematical models in the natural sciences take many shapes and forms. The moment they become more complicated than tracking a few variables over time, we have to put away our Excel spreadsheets and make use of a solid foundation in computational science. The course establishes this foundation by introducing data structures and algorithms used in everyday scientific computing using examples in the python scripting language. By the end of the Semester, students will be able to navigate the Linux command-line to go from a mathematical model to a numerical solution. Best practices for working with computer code and visualizing data will also be covered. == Textbooks and Resources == * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-0072-7 Beginning Python, Hetland, 2005] (eBook avail. from USF Library) * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-3238-4 Python Algorithms, Hetland, 2010] (eBook avail. from USF Library) * [http://aosabook.org/en/index.html The Architecture of Open Source Applications] * [http://docs.python.org Python Documentation] * [https://developers.google.com/edu/python/ Google Introductory Python Notes] * [http://huffman.sourceforge.net/tao/tao-of-programming.html Tao of Programming] Other (possibly useful) materials: * Chapters 7&8 of Modelling and Simulation, Birta and Arbez, Springer 2007 (eBook avail. from USF Library). * Chapters 4-6 of Models and Algorithms for Intelligent Data Analysis, Runkler, Springer 2012 (eBook avail. from USF Library). * Guide to Scientific Computing in C++, Francis and Whiteley, Springer, 2012. (eBook avail. from USF Library) * Extra info. On the basics: ** Chapters 3 and 7 of Mathematics in Computing, Regan, Springer 2013. (eBook avail. from USF Library) ** Instant feedback graphical programming with [https://www.khanacademy.org/cs/programming/ Khan Academy] * [http://www.meetup.com/python-178/ Local PyBulls Meetings] Code: * [http://carsonfarmer.com/2013/07/essential-python-geo-libraries Python Libraries Useful for Geospatial Problems] * [[Code#Python_Libraries|Python Libraries Useful for Computational Chemistry]] (very small list at present) Interactive Interpreters: * [http://www.codewars.com CodeWars] Recommended for building experience with practice problems. * [http://exercism.io Exercism] A command-line client with a similar learn-through-challenge philosophy. * [http://repl.it repl.it] A read-eval-print loop for several computer languages. * [http://en.cppreference.com/w/cpp/language CppReference] Documentation with an online evaluator for C++ code. == Topics == # Languages #* bash (shell) #* python (scripting) #* stack & register-based machine languages: overview of C and Fortran syntax & compiling with gcc, ‘thread safety’ #* Shared libraries & language inter-operability (FFI) # Algorithms #* Horner’s algorithm for polynomials #* Newton’s root finding algo. #* Overview of general optimization algo-s (example: linear & nonlin. least-squares) #* Numerical integration (scripted, plus gnu ODE) #* Communication (how HTTP get/put works) # Data Structures #* Linked Lists #* Trees (file system hierarchies) #* Graphs #* Arrays (dense & sparse) example: vectors & rotations / transpositions, densities and difference operators # Presentation & visualization #* Flat CSV files (and excel) #* Working with binary data #* Python matplotlib (2D images) #* Binning histograms & weighted averages # Best Practices #* High-level code design (modularity, interface specifications, unit testing, etc.) #* Code audit: open-source libraries, ex. Gnu Scientific Library, qsort in libc, Boost #* Source code versioning (example: git or mercurial) #* gdb & execution profiling #* documentation #* Makefiles === Notes & Homework === 4fadb14386331046b6b3e5f7d82f34b447e266be 406 404 2016-01-11T19:09:00Z David M. Rogers 2 wikitext text/x-wiki '''<BIG>Introduction to Scientific Computing</BIG>''' Course Info * Course Numbers CHM 4932-004/6938-010, CRN: 22347/22348 * Credit Hours: 3 * Meeting Dates: January 22 - April 27, 2016 ** No Class Jan. 18 or Mar. 14-19 * Meeting Times: Mon. and Wed., 12:30-13:45 in SCA 222 ** Lab Session & Office Hours: Fri. 12:30-13:45 in SCA 222 (or SCA 433) == Grading == '''Grading Scale (out of 400 points possible)''' {| class="wikitable" |- ! Grade ! Undergraduate ! Graduate |- | A | 230 | 300 |- | B | 180 | 230 |- | C | 150 | 180 |- | D | 120 | 150 |} * Points Possible: ** 10 homework assignments (20 points per homework) ** 2 projects / competitions (100 points per project) * Homework Rules ** For work done in groups, credit is divided equally among participants - so the max homework grade for a group of 2 is 10 points each. ** For each homework, 1 re-do at full credit can be sent at any time after the due date, but must present a unique solution to previous work from yourself or others. ** All work must cite co-group members (if any) and the source of any code snippets used online. === Grading Rationale === Homework points will only be awarded for correct, working code and correct algorithmic analysis, while the homework problems will become progressively tougher. Undergraduates should be able to pass the course with an A if they have correctly answered most of the homework, and made a strong attempt at one of the projects. Graduate students should both perform well on the homework and successfully complete one or two projects. Essentially, this means you should do your own homework when possible and may do a project in a small group. The re-grading and group options for homework allow making up for missed assignments, and encourage returning to core concepts at a later point in the class. Students who have completed significant portions of the homework have thus demonstrated programming proficiency, and are qualified for at least B/C grades. == Projects == === Midterm === TBA === Final === TBA == Overview == Mathematical models in the natural sciences take many shapes and forms. The moment they become more complicated than tracking a few variables over time, we have to put away our Excel spreadsheets and make use of a solid foundation in computational science. The course establishes this foundation by introducing data structures and algorithms used in everyday scientific computing using examples in the python scripting language. By the end of the Semester, students will be able to navigate the Linux command-line to go from a mathematical model to a numerical solution. Best practices for working with computer code and visualizing data will also be covered. == Textbooks and Resources == * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-0072-7 Beginning Python, Hetland, 2005] (eBook avail. from USF Library) * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-3238-4 Python Algorithms, Hetland, 2010] (eBook avail. from USF Library) * [http://aosabook.org/en/index.html The Architecture of Open Source Applications] * [http://docs.python.org Python Documentation] * [https://developers.google.com/edu/python/ Google Introductory Python Notes] * [http://huffman.sourceforge.net/tao/tao-of-programming.html Tao of Programming] Other (possibly useful) materials: * Chapters 7&8 of Modelling and Simulation, Birta and Arbez, Springer 2007 (eBook avail. from USF Library). * Chapters 4-6 of Models and Algorithms for Intelligent Data Analysis, Runkler, Springer 2012 (eBook avail. from USF Library). * Guide to Scientific Computing in C++, Francis and Whiteley, Springer, 2012. (eBook avail. from USF Library) * Extra info. On the basics: ** Chapters 3 and 7 of Mathematics in Computing, Regan, Springer 2013. (eBook avail. from USF Library) ** Instant feedback graphical programming with [https://www.khanacademy.org/cs/programming/ Khan Academy] * [http://www.meetup.com/python-178/ Local PyBulls Meetings] Code: * [http://carsonfarmer.com/2013/07/essential-python-geo-libraries Python Libraries Useful for Geospatial Problems] * [[Code#Python_Libraries|Python Libraries Useful for Computational Chemistry]] (very small list at present) Interactive Interpreters: * [http://www.codewars.com CodeWars] Recommended for building experience with practice problems. * [http://exercism.io Exercism] A command-line client with a similar learn-through-challenge philosophy. * [http://repl.it repl.it] A read-eval-print loop for several computer languages. * [http://en.cppreference.com/w/cpp/language CppReference] Documentation with an online evaluator for C++ code. == Topics == # Languages #* bash (shell) #* python (scripting) #* stack & register-based machine languages: overview of C and Fortran syntax & compiling with gcc, ‘thread safety’ #* Shared libraries & language inter-operability (FFI) # Algorithms #* Horner’s algorithm for polynomials #* Newton’s root finding algo. #* Overview of general optimization algo-s (example: linear & nonlin. least-squares) #* Numerical integration (scripted, plus gnu ODE) #* Communication (how HTTP get/put works) # Data Structures #* Linked Lists #* Trees (file system hierarchies) #* Graphs #* Arrays (dense & sparse) example: vectors & rotations / transpositions, densities and difference operators # Presentation & visualization #* Flat CSV files (and excel) #* Working with binary data #* Python matplotlib (2D images) #* Binning histograms & weighted averages # Best Practices #* High-level code design (modularity, interface specifications, unit testing, etc.) #* Code audit: open-source libraries, ex. Gnu Scientific Library, qsort in libc, Boost #* Source code versioning (example: git or mercurial) #* gdb & execution profiling #* documentation #* Makefiles === Notes & Homework === * [[File:intro.pdf|Notes]] for Week 1 8dc0204eaa948a38a4df947baf2ba8da71c086ce 408 406 2016-01-11T19:10:53Z David M. Rogers 2 wikitext text/x-wiki '''<BIG>Introduction to Scientific Computing</BIG>''' Course Info * Course Numbers CHM 4932-004/6938-010, CRN: 22347/22348 * Credit Hours: 3 * Meeting Dates: January 22 - April 27, 2016 ** No Class Jan. 18 or Mar. 14-19 * Meeting Times: Mon. and Wed., 12:30-13:45 in SCA 222 ** Lab Session & Office Hours: Fri. 12:30-13:45 in SCA 222 (or SCA 433) == Grading == '''Grading Scale (out of 400 points possible)''' {| class="wikitable" |- ! Grade ! Undergraduate ! Graduate |- | A | 230 | 300 |- | B | 180 | 230 |- | C | 150 | 180 |- | D | 120 | 150 |} * Points Possible: ** 10 homework assignments (20 points per homework) ** 2 projects / competitions (100 points per project) * Homework Rules ** For work done in groups, credit is divided equally among participants - so the max homework grade for a group of 2 is 10 points each. ** For each homework, 1 re-do at full credit can be sent at any time after the due date, but must present a unique solution to previous work from yourself or others. ** All work must cite co-group members (if any) and the source of any code snippets used online. === Grading Rationale === Homework points will only be awarded for correct, working code and correct algorithmic analysis, while the homework problems will become progressively tougher. Undergraduates should be able to pass the course with an A if they have correctly answered most of the homework, and made a strong attempt at one of the projects. Graduate students should both perform well on the homework and successfully complete one or two projects. Essentially, this means you should do your own homework when possible and may do a project in a small group. The re-grading and group options for homework allow making up for missed assignments, and encourage returning to core concepts at a later point in the class. Students who have completed significant portions of the homework have thus demonstrated programming proficiency, and are qualified for at least B/C grades. == Projects == === Midterm === TBA === Final === TBA == Overview == Mathematical models in the natural sciences take many shapes and forms. The moment they become more complicated than tracking a few variables over time, we have to put away our Excel spreadsheets and make use of a solid foundation in computational science. The course establishes this foundation by introducing data structures and algorithms used in everyday scientific computing using examples in the python scripting language. By the end of the Semester, students will be able to navigate the Linux command-line to go from a mathematical model to a numerical solution. Best practices for working with computer code and visualizing data will also be covered. == Textbooks and Resources == * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-0072-7 Beginning Python, Hetland, 2005] (eBook avail. from USF Library) * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-3238-4 Python Algorithms, Hetland, 2010] (eBook avail. from USF Library) * [http://aosabook.org/en/index.html The Architecture of Open Source Applications] * [http://docs.python.org Python Documentation] * [https://developers.google.com/edu/python/ Google Introductory Python Notes] * [http://huffman.sourceforge.net/tao/tao-of-programming.html Tao of Programming] Other (possibly useful) materials: * Chapters 7&8 of Modelling and Simulation, Birta and Arbez, Springer 2007 (eBook avail. from USF Library). * Chapters 4-6 of Models and Algorithms for Intelligent Data Analysis, Runkler, Springer 2012 (eBook avail. from USF Library). * Guide to Scientific Computing in C++, Francis and Whiteley, Springer, 2012. (eBook avail. from USF Library) * Extra info. On the basics: ** Chapters 3 and 7 of Mathematics in Computing, Regan, Springer 2013. (eBook avail. from USF Library) ** Instant feedback graphical programming with [https://www.khanacademy.org/cs/programming/ Khan Academy] * [http://www.meetup.com/python-178/ Local PyBulls Meetings] Code: * [http://carsonfarmer.com/2013/07/essential-python-geo-libraries Python Libraries Useful for Geospatial Problems] * [[Code#Python_Libraries|Python Libraries Useful for Computational Chemistry]] (very small list at present) Interactive Interpreters: * [http://www.codewars.com CodeWars] Recommended for building experience with practice problems. * [http://exercism.io Exercism] A command-line client with a similar learn-through-challenge philosophy. * [http://repl.it repl.it] A read-eval-print loop for several computer languages. * [http://en.cppreference.com/w/cpp/language CppReference] Documentation with an online evaluator for C++ code. == Topics == # Languages #* bash (shell) #* python (scripting) #* stack & register-based machine languages: overview of C and Fortran syntax & compiling with gcc, ‘thread safety’ #* Shared libraries & language inter-operability (FFI) # Algorithms #* Horner’s algorithm for polynomials #* Newton’s root finding algo. #* Overview of general optimization algo-s (example: linear & nonlin. least-squares) #* Numerical integration (scripted, plus gnu ODE) #* Communication (how HTTP get/put works) # Data Structures #* Linked Lists #* Trees (file system hierarchies) #* Graphs #* Arrays (dense & sparse) example: vectors & rotations / transpositions, densities and difference operators # Presentation & visualization #* Flat CSV files (and excel) #* Working with binary data #* Python matplotlib (2D images) #* Binning histograms & weighted averages # Best Practices #* High-level code design (modularity, interface specifications, unit testing, etc.) #* Code audit: open-source libraries, ex. Gnu Scientific Library, qsort in libc, Boost #* Source code versioning (example: git or mercurial) #* gdb & execution profiling #* documentation #* Makefiles === Notes & Homework === * [[File:intro.pdf|Notes]] for Week 1 ** Over the first two weeks or so, we'll be practicing the basics - so read through Chapters 1-3 during this time. 10765e5c8bce0c4b9f81fdd7508cd7681098abb7 409 408 2016-01-11T19:12:12Z David M. Rogers 2 wikitext text/x-wiki '''<BIG>Introduction to Scientific Computing</BIG>''' Course Info * Course Numbers CHM 4932-004/6938-010, CRN: 22347/22348 * Credit Hours: 3 * Meeting Dates: January 22 - April 27, 2016 ** No Class Jan. 18 or Mar. 14-19 * Meeting Times: Mon. and Wed., 12:30-13:45 in SCA 222 ** Lab Session & Office Hours: Fri. 12:30-13:45 in SCA 222 (or SCA 433) == Grading == '''Grading Scale (out of 400 points possible)''' {| class="wikitable" |- ! Grade ! Undergraduate ! Graduate |- | A | 230 | 300 |- | B | 180 | 230 |- | C | 150 | 180 |- | D | 120 | 150 |} * Points Possible: ** 10 homework assignments (20 points per homework) ** 2 projects / competitions (100 points per project) * Homework Rules ** For work done in groups, credit is divided equally among participants - so the max homework grade for a group of 2 is 10 points each. ** For each homework, 1 re-do at full credit can be sent at any time after the due date, but must present a unique solution to previous work from yourself or others. ** All work must cite co-group members (if any) and the source of any code snippets used online. === Grading Rationale === Homework points will only be awarded for correct, working code and correct algorithmic analysis, while the homework problems will become progressively tougher. Undergraduates should be able to pass the course with an A if they have correctly answered most of the homework, and made a strong attempt at one of the projects. Graduate students should both perform well on the homework and successfully complete one or two projects. Essentially, this means you should do your own homework when possible and may do a project in a small group. The re-grading and group options for homework allow making up for missed assignments, and encourage returning to core concepts at a later point in the class. Students who have completed significant portions of the homework have thus demonstrated programming proficiency, and are qualified for at least B/C grades. == Projects == === Midterm === TBA === Final === TBA == Overview == Mathematical models in the natural sciences take many shapes and forms. The moment they become more complicated than tracking a few variables over time, we have to put away our Excel spreadsheets and make use of a solid foundation in computational science. The course establishes this foundation by introducing data structures and algorithms used in everyday scientific computing using examples in the python scripting language. By the end of the Semester, students will be able to navigate the Linux command-line to go from a mathematical model to a numerical solution. Best practices for working with computer code and visualizing data will also be covered. == Textbooks and Resources == * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-0072-7 Beginning Python, Hetland, 2005] (eBook avail. from USF Library) * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-3238-4 Python Algorithms, Hetland, 2010] (eBook avail. from USF Library) * [http://aosabook.org/en/index.html The Architecture of Open Source Applications] * [http://docs.python.org Python Documentation] * [https://developers.google.com/edu/python/ Google Introductory Python Notes] * [http://huffman.sourceforge.net/tao/tao-of-programming.html Tao of Programming] Other (possibly useful) materials: * Chapters 7&8 of Modelling and Simulation, Birta and Arbez, Springer 2007 (eBook avail. from USF Library). * Chapters 4-6 of Models and Algorithms for Intelligent Data Analysis, Runkler, Springer 2012 (eBook avail. from USF Library). * Guide to Scientific Computing in C++, Francis and Whiteley, Springer, 2012. (eBook avail. from USF Library) * Extra info. On the basics: ** Chapters 3 and 7 of Mathematics in Computing, Regan, Springer 2013. (eBook avail. from USF Library) ** Instant feedback graphical programming with [https://www.khanacademy.org/cs/programming/ Khan Academy] * [http://www.meetup.com/python-178/ Local PyBulls Meetings] Code: * [http://carsonfarmer.com/2013/07/essential-python-geo-libraries Python Libraries Useful for Geospatial Problems] * [[Code#Python_Libraries|Python Libraries Useful for Computational Chemistry]] (very small list at present) Interactive Interpreters: * [http://www.codewars.com CodeWars] Recommended for building experience with practice problems. * [http://exercism.io Exercism] A command-line client with a similar learn-through-challenge philosophy. * [http://repl.it repl.it] A read-eval-print loop for several computer languages. * [http://en.cppreference.com/w/cpp/language CppReference] Documentation with an online evaluator for C++ code. == Topics == # Languages #* bash (shell) #* python (scripting) #* stack & register-based machine languages: overview of C and Fortran syntax & compiling with gcc, ‘thread safety’ #* Shared libraries & language inter-operability (FFI) # Algorithms #* Horner’s algorithm for polynomials #* Newton’s root finding algo. #* Overview of general optimization algo-s (example: linear & nonlin. least-squares) #* Numerical integration (scripted, plus gnu ODE) #* Communication (how HTTP get/put works) # Data Structures #* Linked Lists #* Trees (file system hierarchies) #* Graphs #* Arrays (dense & sparse) example: vectors & rotations / transpositions, densities and difference operators # Presentation & visualization #* Flat CSV files (and excel) #* Working with binary data #* Python matplotlib (2D images) #* Binning histograms & weighted averages # Best Practices #* High-level code design (modularity, interface specifications, unit testing, etc.) #* Code audit: open-source libraries, ex. Gnu Scientific Library, qsort in libc, Boost #* Source code versioning (example: git or mercurial) #* gdb & execution profiling #* documentation #* Makefiles === Notes & Homework === * [[Media:intro.pdf|Notes]] for Week 1 ** Over the first two weeks or so, we'll be practicing the basics - so read through Chapters 1-3 during this time. a1309a88c6677ec438138eecd74329ef2bf24448 410 409 2016-01-11T20:47:09Z David M. Rogers 2 wikitext text/x-wiki '''<BIG>Introduction to Scientific Computing</BIG>''' Course Info * Course Numbers CHM 4932-004/6938-010, CRN: 22347/22348 * Credit Hours: 3 * Meeting Dates: January 22 - April 27, 2016 ** No Class Jan. 18 or Mar. 14-19 * Meeting Times: Mon. and Wed., 12:30-13:45 in SCA 222 ** Lab Session & Office Hours: Fri. 12:30-13:45 in SCA 222 (or SCA 433) == Overview == Mathematical models in the natural sciences take many shapes and forms. The moment they become more complicated than tracking a few variables over time, we have to put away our Excel spreadsheets and make use of a solid foundation in computational science. The course establishes this foundation by introducing data structures and algorithms used in everyday scientific computing using examples in the python scripting language. By the end of the Semester, students will be able to navigate the Linux command-line to go from a mathematical model to a numerical solution. Best practices for working with computer code and visualizing data will also be covered. == Topics == # Languages #* bash (shell) #* python (scripting) #* stack & register-based machine languages: overview of C and Fortran syntax & compiling with gcc, ‘thread safety’ #* Shared libraries & language inter-operability (FFI) # Algorithms #* Horner’s algorithm for polynomials #* Newton’s root finding algo. #* Overview of general optimization algo-s (example: linear & nonlin. least-squares) #* Numerical integration (scripted, plus gnu ODE) #* Communication (how HTTP get/put works) # Data Structures #* Linked Lists #* Trees (file system hierarchies) #* Graphs #* Arrays (dense & sparse) example: vectors & rotations / transpositions, densities and difference operators # Presentation & visualization #* Flat CSV files (and excel) #* Working with binary data #* Python matplotlib (2D images) #* Binning histograms & weighted averages # Best Practices #* High-level code design (modularity, interface specifications, unit testing, etc.) #* Code audit: open-source libraries, ex. Gnu Scientific Library, qsort in libc, Boost #* Source code versioning (example: git or mercurial) #* gdb & execution profiling #* documentation #* Makefiles == Grading == '''Grading Scale (out of 400 points possible)''' {| class="wikitable" |- ! Grade ! Undergraduate ! Graduate |- | A | 230 | 300 |- | B | 180 | 230 |- | C | 150 | 180 |- | D | 120 | 150 |} * Points Possible: ** 10 homework assignments (20 points per homework) ** 2 projects / competitions (100 points per project) * Homework Rules ** For work done in groups, credit is divided equally among participants - so the max homework grade for a group of 2 is 10 points each. ** For each homework, 1 re-do at full credit can be sent at any time after the due date, but must present a unique solution to previous work from yourself or others. ** All work must cite co-group members (if any) and the source of any code snippets used online. === Grading Rationale === Homework points will only be awarded for correct, working code and correct algorithmic analysis, while the homework problems will become progressively tougher. Undergraduates should be able to pass the course with an A if they have correctly answered most of the homework, and made a strong attempt at one of the projects. Graduate students should both perform well on the homework and successfully complete one or two projects. Essentially, this means you should do your own homework when possible and may do a project in a small group. The re-grading and group options for homework allow making up for missed assignments, and encourage returning to core concepts at a later point in the class. Students who have completed significant portions of the homework have thus demonstrated programming proficiency, and are qualified for at least B/C grades. == Projects == === Midterm === TBA === Final === TBA == Textbooks and Resources == * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-0072-7 Beginning Python, Hetland, 2005] (eBook avail. from USF Library) * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-3238-4 Python Algorithms, Hetland, 2010] (eBook avail. from USF Library) * [http://aosabook.org/en/index.html The Architecture of Open Source Applications] * [http://docs.python.org Python Documentation] * [https://developers.google.com/edu/python/ Google Introductory Python Notes] * [http://huffman.sourceforge.net/tao/tao-of-programming.html Tao of Programming] Other (possibly useful) materials: * Chapters 7&8 of Modelling and Simulation, Birta and Arbez, Springer 2007 (eBook avail. from USF Library). * Chapters 4-6 of Models and Algorithms for Intelligent Data Analysis, Runkler, Springer 2012 (eBook avail. from USF Library). * Guide to Scientific Computing in C++, Francis and Whiteley, Springer, 2012. (eBook avail. from USF Library) * Extra info. On the basics: ** Chapters 3 and 7 of Mathematics in Computing, Regan, Springer 2013. (eBook avail. from USF Library) ** Instant feedback graphical programming with [https://www.khanacademy.org/cs/programming/ Khan Academy] * [http://www.meetup.com/python-178/ Local PyBulls Meetings] Code: * [http://carsonfarmer.com/2013/07/essential-python-geo-libraries Python Libraries Useful for Geospatial Problems] * [[Code#Python_Libraries|Python Libraries Useful for Computational Chemistry]] (very small list at present) Interactive Interpreters: * [http://www.codewars.com CodeWars] Recommended for building experience with practice problems. * [http://exercism.io Exercism] A command-line client with a similar learn-through-challenge philosophy. * [http://repl.it repl.it] A read-eval-print loop for several computer languages. * [http://en.cppreference.com/w/cpp/language CppReference] Documentation with an online evaluator for C++ code. === Notes & Homework === * [[Media:intro.pdf|Notes]] for Week 1 ** Over the first two weeks or so, we'll be practicing the basics - so read through Chapters 1-3 during this time. 98dead1468b7dc2b5fff12cbe585a05f2bf10438 File:Intro.pdf 6 86 407 2016-01-11T19:09:32Z David M. Rogers 2 wikitext text/x-wiki da39a3ee5e6b4b0d3255bfef95601890afd80709 CompSciHW1 0 87 411 2016-01-12T22:38:24Z David M. Rogers 2 Created page with "Homework 1 (due Wednesday, Jan. 20, 2016) Use the 7 forms to write code performing the following: # Create a variable named '''x''' holding the string "Hello World!" # Creat..." wikitext text/x-wiki Homework 1 (due Wednesday, Jan. 20, 2016) Use the 7 forms to write code performing the following: # Create a variable named '''x''' holding the string "Hello World!" # Create a (length 8) list containing the pattern below: #* 3 8 15 24 35 48 63 80 #* Each element should use an arithmetic expression (calculator form). #* assign the list to the variable '''y''' # Print a greeting displaying the variable '''x''' followed by element 4 of the list above. # Assign the variable '''z''' to element 4 of '''y''' if element 4 of '''y''' is larger than 42. Otherwise, set '''z''' equal to element 5 of '''y'''. # Call the function '''x.__add__''' with one argument, " World! World!". # Re-write your answer to the last question by sending a variable as an argument, instead of directly writing "World! World!". # Write a description of what the following program does. #* How would you modify the code to eliminate all the '''i = len(x)-1''' lines? #* Re-write the code, abstracting out the numbers 61 and 900 into variables '''a''' and '''m'''. <source lang="python"> x = [541] i = len(x)-1 x.append(x[i]*61 % 900) i = len(x)-1 x.append(x[i]*61 % 900) i = len(x)-1 x.append(x[i]*61 % 900) i = len(x)-1 x.append(x[i]*61 % 900) i = len(x)-1 x.append(x[i]*61 % 900) print len(x) print x </source> 41697b2c68855d8cc4060d7a58a2c8d226da88a8 413 411 2016-01-13T13:56:15Z David M. Rogers 2 wikitext text/x-wiki Homework 1 (due Monday, Jan. 25, 2016) Use the 7 forms to write code performing the following: # Create a variable named '''x''' holding the string "Hello World!" # Create a (length 8) list containing the pattern below: #* 3 8 15 24 35 48 63 80 #* Each element should use an arithmetic expression (calculator form). #* assign the list to the variable '''y''' # Print a greeting displaying the variable '''x''' followed by element 4 of the list above. # Assign the variable '''z''' to element 4 of '''y''' if element 4 of '''y''' is larger than 42. Otherwise, set '''z''' equal to element 5 of '''y'''. # Call the function '''x.__add__''' with one argument, " World! World!". # Re-write your answer to the last question by sending a variable as an argument, instead of directly writing "World! World!". # Write a description of what the following program does. #* How would you modify the code to eliminate all the '''i = len(x)-1''' lines? #* Re-write the code, abstracting out the numbers 61 and 900 into variables '''a''' and '''m'''. <source lang="python"> x = [541] i = len(x)-1 x.append(x[i]*61 % 900) i = len(x)-1 x.append(x[i]*61 % 900) i = len(x)-1 x.append(x[i]*61 % 900) i = len(x)-1 x.append(x[i]*61 % 900) i = len(x)-1 x.append(x[i]*61 % 900) print len(x) print x </source> 74ffadb9f5074e03260436f909768a2ad41a1420 CompSciSpring2016 0 85 412 410 2016-01-13T13:55:22Z David M. Rogers 2 /* Notes & Homework */ wikitext text/x-wiki '''<BIG>Introduction to Scientific Computing</BIG>''' Course Info * Course Numbers CHM 4932-004/6938-010, CRN: 22347/22348 * Credit Hours: 3 * Meeting Dates: January 22 - April 27, 2016 ** No Class Jan. 18 or Mar. 14-19 * Meeting Times: Mon. and Wed., 12:30-13:45 in SCA 222 ** Lab Session & Office Hours: Fri. 12:30-13:45 in SCA 222 (or SCA 433) == Overview == Mathematical models in the natural sciences take many shapes and forms. The moment they become more complicated than tracking a few variables over time, we have to put away our Excel spreadsheets and make use of a solid foundation in computational science. The course establishes this foundation by introducing data structures and algorithms used in everyday scientific computing using examples in the python scripting language. By the end of the Semester, students will be able to navigate the Linux command-line to go from a mathematical model to a numerical solution. Best practices for working with computer code and visualizing data will also be covered. == Topics == # Languages #* bash (shell) #* python (scripting) #* stack & register-based machine languages: overview of C and Fortran syntax & compiling with gcc, ‘thread safety’ #* Shared libraries & language inter-operability (FFI) # Algorithms #* Horner’s algorithm for polynomials #* Newton’s root finding algo. #* Overview of general optimization algo-s (example: linear & nonlin. least-squares) #* Numerical integration (scripted, plus gnu ODE) #* Communication (how HTTP get/put works) # Data Structures #* Linked Lists #* Trees (file system hierarchies) #* Graphs #* Arrays (dense & sparse) example: vectors & rotations / transpositions, densities and difference operators # Presentation & visualization #* Flat CSV files (and excel) #* Working with binary data #* Python matplotlib (2D images) #* Binning histograms & weighted averages # Best Practices #* High-level code design (modularity, interface specifications, unit testing, etc.) #* Code audit: open-source libraries, ex. Gnu Scientific Library, qsort in libc, Boost #* Source code versioning (example: git or mercurial) #* gdb & execution profiling #* documentation #* Makefiles == Grading == '''Grading Scale (out of 400 points possible)''' {| class="wikitable" |- ! Grade ! Undergraduate ! Graduate |- | A | 230 | 300 |- | B | 180 | 230 |- | C | 150 | 180 |- | D | 120 | 150 |} * Points Possible: ** 10 homework assignments (20 points per homework) ** 2 projects / competitions (100 points per project) * Homework Rules ** For work done in groups, credit is divided equally among participants - so the max homework grade for a group of 2 is 10 points each. ** For each homework, 1 re-do at full credit can be sent at any time after the due date, but must present a unique solution to previous work from yourself or others. ** All work must cite co-group members (if any) and the source of any code snippets used online. === Grading Rationale === Homework points will only be awarded for correct, working code and correct algorithmic analysis, while the homework problems will become progressively tougher. Undergraduates should be able to pass the course with an A if they have correctly answered most of the homework, and made a strong attempt at one of the projects. Graduate students should both perform well on the homework and successfully complete one or two projects. Essentially, this means you should do your own homework when possible and may do a project in a small group. The re-grading and group options for homework allow making up for missed assignments, and encourage returning to core concepts at a later point in the class. Students who have completed significant portions of the homework have thus demonstrated programming proficiency, and are qualified for at least B/C grades. == Projects == === Midterm === TBA === Final === TBA == Textbooks and Resources == * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-0072-7 Beginning Python, Hetland, 2005] (eBook avail. from USF Library) * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-3238-4 Python Algorithms, Hetland, 2010] (eBook avail. from USF Library) * [http://aosabook.org/en/index.html The Architecture of Open Source Applications] * [http://docs.python.org Python Documentation] * [https://developers.google.com/edu/python/ Google Introductory Python Notes] * [http://huffman.sourceforge.net/tao/tao-of-programming.html Tao of Programming] Other (possibly useful) materials: * Chapters 7&8 of Modelling and Simulation, Birta and Arbez, Springer 2007 (eBook avail. from USF Library). * Chapters 4-6 of Models and Algorithms for Intelligent Data Analysis, Runkler, Springer 2012 (eBook avail. from USF Library). * Guide to Scientific Computing in C++, Francis and Whiteley, Springer, 2012. (eBook avail. from USF Library) * Extra info. On the basics: ** Chapters 3 and 7 of Mathematics in Computing, Regan, Springer 2013. (eBook avail. from USF Library) ** Instant feedback graphical programming with [https://www.khanacademy.org/cs/programming/ Khan Academy] * [http://www.meetup.com/python-178/ Local PyBulls Meetings] Code: * [http://carsonfarmer.com/2013/07/essential-python-geo-libraries Python Libraries Useful for Geospatial Problems] * [[Code#Python_Libraries|Python Libraries Useful for Computational Chemistry]] (very small list at present) Interactive Interpreters: * [http://www.codewars.com CodeWars] Recommended for building experience with practice problems. * [http://exercism.io Exercism] A command-line client with a similar learn-through-challenge philosophy. * [http://repl.it repl.it] A read-eval-print loop for several computer languages. * [http://en.cppreference.com/w/cpp/language CppReference] Documentation with an online evaluator for C++ code. === Notes & Homework === * [[Media:intro.pdf|Notes]] for Week 1 ** Over the first two weeks or so, we'll be practicing the basics - so read through Chapters 1-3 of Hetland's Beginning Python during this time. ** [[PythonTranslated|Important Definitions]] ** [[CompSciHW1|Homework 1]] is due Monday, January 25. 8c93e932ee0c3c21cc9640ab4490fd17c3d38398 415 412 2016-01-13T17:09:37Z David M. Rogers 2 /* Textbooks and Resources */ wikitext text/x-wiki '''<BIG>Introduction to Scientific Computing</BIG>''' Course Info * Course Numbers CHM 4932-004/6938-010, CRN: 22347/22348 * Credit Hours: 3 * Meeting Dates: January 22 - April 27, 2016 ** No Class Jan. 18 or Mar. 14-19 * Meeting Times: Mon. and Wed., 12:30-13:45 in SCA 222 ** Lab Session & Office Hours: Fri. 12:30-13:45 in SCA 222 (or SCA 433) == Overview == Mathematical models in the natural sciences take many shapes and forms. The moment they become more complicated than tracking a few variables over time, we have to put away our Excel spreadsheets and make use of a solid foundation in computational science. The course establishes this foundation by introducing data structures and algorithms used in everyday scientific computing using examples in the python scripting language. By the end of the Semester, students will be able to navigate the Linux command-line to go from a mathematical model to a numerical solution. Best practices for working with computer code and visualizing data will also be covered. == Topics == # Languages #* bash (shell) #* python (scripting) #* stack & register-based machine languages: overview of C and Fortran syntax & compiling with gcc, ‘thread safety’ #* Shared libraries & language inter-operability (FFI) # Algorithms #* Horner’s algorithm for polynomials #* Newton’s root finding algo. #* Overview of general optimization algo-s (example: linear & nonlin. least-squares) #* Numerical integration (scripted, plus gnu ODE) #* Communication (how HTTP get/put works) # Data Structures #* Linked Lists #* Trees (file system hierarchies) #* Graphs #* Arrays (dense & sparse) example: vectors & rotations / transpositions, densities and difference operators # Presentation & visualization #* Flat CSV files (and excel) #* Working with binary data #* Python matplotlib (2D images) #* Binning histograms & weighted averages # Best Practices #* High-level code design (modularity, interface specifications, unit testing, etc.) #* Code audit: open-source libraries, ex. Gnu Scientific Library, qsort in libc, Boost #* Source code versioning (example: git or mercurial) #* gdb & execution profiling #* documentation #* Makefiles == Grading == '''Grading Scale (out of 400 points possible)''' {| class="wikitable" |- ! Grade ! Undergraduate ! Graduate |- | A | 230 | 300 |- | B | 180 | 230 |- | C | 150 | 180 |- | D | 120 | 150 |} * Points Possible: ** 10 homework assignments (20 points per homework) ** 2 projects / competitions (100 points per project) * Homework Rules ** For work done in groups, credit is divided equally among participants - so the max homework grade for a group of 2 is 10 points each. ** For each homework, 1 re-do at full credit can be sent at any time after the due date, but must present a unique solution to previous work from yourself or others. ** All work must cite co-group members (if any) and the source of any code snippets used online. === Grading Rationale === Homework points will only be awarded for correct, working code and correct algorithmic analysis, while the homework problems will become progressively tougher. Undergraduates should be able to pass the course with an A if they have correctly answered most of the homework, and made a strong attempt at one of the projects. Graduate students should both perform well on the homework and successfully complete one or two projects. Essentially, this means you should do your own homework when possible and may do a project in a small group. The re-grading and group options for homework allow making up for missed assignments, and encourage returning to core concepts at a later point in the class. Students who have completed significant portions of the homework have thus demonstrated programming proficiency, and are qualified for at least B/C grades. == Projects == === Midterm === TBA === Final === TBA == Textbooks and Resources == * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-0072-7 Beginning Python, Hetland, 2005] (eBook avail. from USF Library) * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-3238-4 Python Algorithms, Hetland, 2010] (eBook avail. from USF Library) * [http://aosabook.org/en/index.html The Architecture of Open Source Applications] * [http://docs.python.org Python Documentation] * [https://developers.google.com/edu/python/ Google Introductory Python Notes] * [http://huffman.sourceforge.net/tao/tao-of-programming.html Tao of Programming] Other (possibly useful) materials: * [http://hackersdictionary.com/html/entry/larval-stage.html The Jargon File] * Chapters 7&8 of Modelling and Simulation, Birta and Arbez, Springer 2007 (eBook avail. from USF Library). * Chapters 4-6 of Models and Algorithms for Intelligent Data Analysis, Runkler, Springer 2012 (eBook avail. from USF Library). * Guide to Scientific Computing in C++, Francis and Whiteley, Springer, 2012. (eBook avail. from USF Library) * Extra info. On the basics: ** Chapters 3 and 7 of Mathematics in Computing, Regan, Springer 2013. (eBook avail. from USF Library) ** Instant feedback graphical programming with [https://www.khanacademy.org/cs/programming/ Khan Academy] * [http://www.meetup.com/python-178/ Local PyBulls Meetings] Code: * [http://carsonfarmer.com/2013/07/essential-python-geo-libraries Python Libraries Useful for Geospatial Problems] * [[Code#Python_Libraries|Python Libraries Useful for Computational Chemistry]] (very small list at present) Interactive Interpreters: * [http://www.codewars.com CodeWars] Recommended for building experience with practice problems. * [http://exercism.io Exercism] A command-line client with a similar learn-through-challenge philosophy. * [http://repl.it repl.it] A read-eval-print loop for several computer languages. * [http://en.cppreference.com/w/cpp/language CppReference] Documentation with an online evaluator for C++ code. === Notes & Homework === * [[Media:intro.pdf|Notes]] for Week 1 ** Over the first two weeks or so, we'll be practicing the basics - so read through Chapters 1-3 of Hetland's Beginning Python during this time. ** [[PythonTranslated|Important Definitions]] ** [[CompSciHW1|Homework 1]] is due Monday, January 25. e8d2ed9e68dd1a4febdb4a8fe2956069a4339f0a 417 415 2016-01-20T17:20:22Z David M. Rogers 2 /* Notes & Homework */ wikitext text/x-wiki '''<BIG>Introduction to Scientific Computing</BIG>''' Course Info * Course Numbers CHM 4932-004/6938-010, CRN: 22347/22348 * Credit Hours: 3 * Meeting Dates: January 22 - April 27, 2016 ** No Class Jan. 18 or Mar. 14-19 * Meeting Times: Mon. and Wed., 12:30-13:45 in SCA 222 ** Lab Session & Office Hours: Fri. 12:30-13:45 in SCA 222 (or SCA 433) == Overview == Mathematical models in the natural sciences take many shapes and forms. The moment they become more complicated than tracking a few variables over time, we have to put away our Excel spreadsheets and make use of a solid foundation in computational science. The course establishes this foundation by introducing data structures and algorithms used in everyday scientific computing using examples in the python scripting language. By the end of the Semester, students will be able to navigate the Linux command-line to go from a mathematical model to a numerical solution. Best practices for working with computer code and visualizing data will also be covered. == Topics == # Languages #* bash (shell) #* python (scripting) #* stack & register-based machine languages: overview of C and Fortran syntax & compiling with gcc, ‘thread safety’ #* Shared libraries & language inter-operability (FFI) # Algorithms #* Horner’s algorithm for polynomials #* Newton’s root finding algo. #* Overview of general optimization algo-s (example: linear & nonlin. least-squares) #* Numerical integration (scripted, plus gnu ODE) #* Communication (how HTTP get/put works) # Data Structures #* Linked Lists #* Trees (file system hierarchies) #* Graphs #* Arrays (dense & sparse) example: vectors & rotations / transpositions, densities and difference operators # Presentation & visualization #* Flat CSV files (and excel) #* Working with binary data #* Python matplotlib (2D images) #* Binning histograms & weighted averages # Best Practices #* High-level code design (modularity, interface specifications, unit testing, etc.) #* Code audit: open-source libraries, ex. Gnu Scientific Library, qsort in libc, Boost #* Source code versioning (example: git or mercurial) #* gdb & execution profiling #* documentation #* Makefiles == Grading == '''Grading Scale (out of 400 points possible)''' {| class="wikitable" |- ! Grade ! Undergraduate ! Graduate |- | A | 230 | 300 |- | B | 180 | 230 |- | C | 150 | 180 |- | D | 120 | 150 |} * Points Possible: ** 10 homework assignments (20 points per homework) ** 2 projects / competitions (100 points per project) * Homework Rules ** For work done in groups, credit is divided equally among participants - so the max homework grade for a group of 2 is 10 points each. ** For each homework, 1 re-do at full credit can be sent at any time after the due date, but must present a unique solution to previous work from yourself or others. ** All work must cite co-group members (if any) and the source of any code snippets used online. === Grading Rationale === Homework points will only be awarded for correct, working code and correct algorithmic analysis, while the homework problems will become progressively tougher. Undergraduates should be able to pass the course with an A if they have correctly answered most of the homework, and made a strong attempt at one of the projects. Graduate students should both perform well on the homework and successfully complete one or two projects. Essentially, this means you should do your own homework when possible and may do a project in a small group. The re-grading and group options for homework allow making up for missed assignments, and encourage returning to core concepts at a later point in the class. Students who have completed significant portions of the homework have thus demonstrated programming proficiency, and are qualified for at least B/C grades. == Projects == === Midterm === TBA === Final === TBA == Textbooks and Resources == * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-0072-7 Beginning Python, Hetland, 2005] (eBook avail. from USF Library) * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-3238-4 Python Algorithms, Hetland, 2010] (eBook avail. from USF Library) * [http://aosabook.org/en/index.html The Architecture of Open Source Applications] * [http://docs.python.org Python Documentation] * [https://developers.google.com/edu/python/ Google Introductory Python Notes] * [http://huffman.sourceforge.net/tao/tao-of-programming.html Tao of Programming] Other (possibly useful) materials: * [http://hackersdictionary.com/html/entry/larval-stage.html The Jargon File] * Chapters 7&8 of Modelling and Simulation, Birta and Arbez, Springer 2007 (eBook avail. from USF Library). * Chapters 4-6 of Models and Algorithms for Intelligent Data Analysis, Runkler, Springer 2012 (eBook avail. from USF Library). * Guide to Scientific Computing in C++, Francis and Whiteley, Springer, 2012. (eBook avail. from USF Library) * Extra info. On the basics: ** Chapters 3 and 7 of Mathematics in Computing, Regan, Springer 2013. (eBook avail. from USF Library) ** Instant feedback graphical programming with [https://www.khanacademy.org/cs/programming/ Khan Academy] * [http://www.meetup.com/python-178/ Local PyBulls Meetings] Code: * [http://carsonfarmer.com/2013/07/essential-python-geo-libraries Python Libraries Useful for Geospatial Problems] * [[Code#Python_Libraries|Python Libraries Useful for Computational Chemistry]] (very small list at present) Interactive Interpreters: * [http://www.codewars.com CodeWars] Recommended for building experience with practice problems. * [http://exercism.io Exercism] A command-line client with a similar learn-through-challenge philosophy. * [http://repl.it repl.it] A read-eval-print loop for several computer languages. * [http://en.cppreference.com/w/cpp/language CppReference] Documentation with an online evaluator for C++ code. === Notes & Homework === * [[Media:intro.pdf|Notes]] for Week 1 ** Over the first two weeks or so, we'll be practicing the basics - so read through Chapters 1-3 of Hetland's Beginning Python during this time. ** [[PythonTranslated|Important Definitions]] ** [[CompSciHW1|Homework 1]] is due Monday, January 25. * [[Media:Week2.pdf|Week2]] for Week 2 0545094f4c793308ef1837a16e1fddadcea12f84 419 417 2016-01-20T19:12:42Z David M. Rogers 2 /* Notes & Homework */ wikitext text/x-wiki '''<BIG>Introduction to Scientific Computing</BIG>''' Course Info * Course Numbers CHM 4932-004/6938-010, CRN: 22347/22348 * Credit Hours: 3 * Meeting Dates: January 22 - April 27, 2016 ** No Class Jan. 18 or Mar. 14-19 * Meeting Times: Mon. and Wed., 12:30-13:45 in SCA 222 ** Lab Session & Office Hours: Fri. 12:30-13:45 in SCA 222 (or SCA 433) == Overview == Mathematical models in the natural sciences take many shapes and forms. The moment they become more complicated than tracking a few variables over time, we have to put away our Excel spreadsheets and make use of a solid foundation in computational science. The course establishes this foundation by introducing data structures and algorithms used in everyday scientific computing using examples in the python scripting language. By the end of the Semester, students will be able to navigate the Linux command-line to go from a mathematical model to a numerical solution. Best practices for working with computer code and visualizing data will also be covered. == Topics == # Languages #* bash (shell) #* python (scripting) #* stack & register-based machine languages: overview of C and Fortran syntax & compiling with gcc, ‘thread safety’ #* Shared libraries & language inter-operability (FFI) # Algorithms #* Horner’s algorithm for polynomials #* Newton’s root finding algo. #* Overview of general optimization algo-s (example: linear & nonlin. least-squares) #* Numerical integration (scripted, plus gnu ODE) #* Communication (how HTTP get/put works) # Data Structures #* Linked Lists #* Trees (file system hierarchies) #* Graphs #* Arrays (dense & sparse) example: vectors & rotations / transpositions, densities and difference operators # Presentation & visualization #* Flat CSV files (and excel) #* Working with binary data #* Python matplotlib (2D images) #* Binning histograms & weighted averages # Best Practices #* High-level code design (modularity, interface specifications, unit testing, etc.) #* Code audit: open-source libraries, ex. Gnu Scientific Library, qsort in libc, Boost #* Source code versioning (example: git or mercurial) #* gdb & execution profiling #* documentation #* Makefiles == Grading == '''Grading Scale (out of 400 points possible)''' {| class="wikitable" |- ! Grade ! Undergraduate ! Graduate |- | A | 230 | 300 |- | B | 180 | 230 |- | C | 150 | 180 |- | D | 120 | 150 |} * Points Possible: ** 10 homework assignments (20 points per homework) ** 2 projects / competitions (100 points per project) * Homework Rules ** For work done in groups, credit is divided equally among participants - so the max homework grade for a group of 2 is 10 points each. ** For each homework, 1 re-do at full credit can be sent at any time after the due date, but must present a unique solution to previous work from yourself or others. ** All work must cite co-group members (if any) and the source of any code snippets used online. === Grading Rationale === Homework points will only be awarded for correct, working code and correct algorithmic analysis, while the homework problems will become progressively tougher. Undergraduates should be able to pass the course with an A if they have correctly answered most of the homework, and made a strong attempt at one of the projects. Graduate students should both perform well on the homework and successfully complete one or two projects. Essentially, this means you should do your own homework when possible and may do a project in a small group. The re-grading and group options for homework allow making up for missed assignments, and encourage returning to core concepts at a later point in the class. Students who have completed significant portions of the homework have thus demonstrated programming proficiency, and are qualified for at least B/C grades. == Projects == === Midterm === TBA === Final === TBA == Textbooks and Resources == * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-0072-7 Beginning Python, Hetland, 2005] (eBook avail. from USF Library) * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-3238-4 Python Algorithms, Hetland, 2010] (eBook avail. from USF Library) * [http://aosabook.org/en/index.html The Architecture of Open Source Applications] * [http://docs.python.org Python Documentation] * [https://developers.google.com/edu/python/ Google Introductory Python Notes] * [http://huffman.sourceforge.net/tao/tao-of-programming.html Tao of Programming] Other (possibly useful) materials: * [http://hackersdictionary.com/html/entry/larval-stage.html The Jargon File] * Chapters 7&8 of Modelling and Simulation, Birta and Arbez, Springer 2007 (eBook avail. from USF Library). * Chapters 4-6 of Models and Algorithms for Intelligent Data Analysis, Runkler, Springer 2012 (eBook avail. from USF Library). * Guide to Scientific Computing in C++, Francis and Whiteley, Springer, 2012. (eBook avail. from USF Library) * Extra info. On the basics: ** Chapters 3 and 7 of Mathematics in Computing, Regan, Springer 2013. (eBook avail. from USF Library) ** Instant feedback graphical programming with [https://www.khanacademy.org/cs/programming/ Khan Academy] * [http://www.meetup.com/python-178/ Local PyBulls Meetings] Code: * [http://carsonfarmer.com/2013/07/essential-python-geo-libraries Python Libraries Useful for Geospatial Problems] * [[Code#Python_Libraries|Python Libraries Useful for Computational Chemistry]] (very small list at present) Interactive Interpreters: * [http://www.codewars.com CodeWars] Recommended for building experience with practice problems. * [http://exercism.io Exercism] A command-line client with a similar learn-through-challenge philosophy. * [http://repl.it repl.it] A read-eval-print loop for several computer languages. * [http://en.cppreference.com/w/cpp/language CppReference] Documentation with an online evaluator for C++ code. === Notes & Homework === * [[Media:intro.pdf|Notes]] for Week 1 ** Over the first two weeks or so, we'll be practicing the basics - so read through Chapters 1-3 of Hetland's Beginning Python during this time. ** [[PythonTranslated|Important Definitions]] ** [[CompSciHW1|Homework 1]] is due Monday, January 25. * [[Media:Week2.pdf|Notes]] for Week 2 ** [[Code:Oware|Oware code]] 1d189f79f8d14dcaf73025ce95ae5b5f88b6c6d9 422 419 2016-01-20T19:23:37Z David M. Rogers 2 /* Notes & Homework */ wikitext text/x-wiki '''<BIG>Introduction to Scientific Computing</BIG>''' Course Info * Course Numbers CHM 4932-004/6938-010, CRN: 22347/22348 * Credit Hours: 3 * Meeting Dates: January 22 - April 27, 2016 ** No Class Jan. 18 or Mar. 14-19 * Meeting Times: Mon. and Wed., 12:30-13:45 in SCA 222 ** Lab Session & Office Hours: Fri. 12:30-13:45 in SCA 222 (or SCA 433) == Overview == Mathematical models in the natural sciences take many shapes and forms. The moment they become more complicated than tracking a few variables over time, we have to put away our Excel spreadsheets and make use of a solid foundation in computational science. The course establishes this foundation by introducing data structures and algorithms used in everyday scientific computing using examples in the python scripting language. By the end of the Semester, students will be able to navigate the Linux command-line to go from a mathematical model to a numerical solution. Best practices for working with computer code and visualizing data will also be covered. == Topics == # Languages #* bash (shell) #* python (scripting) #* stack & register-based machine languages: overview of C and Fortran syntax & compiling with gcc, ‘thread safety’ #* Shared libraries & language inter-operability (FFI) # Algorithms #* Horner’s algorithm for polynomials #* Newton’s root finding algo. #* Overview of general optimization algo-s (example: linear & nonlin. least-squares) #* Numerical integration (scripted, plus gnu ODE) #* Communication (how HTTP get/put works) # Data Structures #* Linked Lists #* Trees (file system hierarchies) #* Graphs #* Arrays (dense & sparse) example: vectors & rotations / transpositions, densities and difference operators # Presentation & visualization #* Flat CSV files (and excel) #* Working with binary data #* Python matplotlib (2D images) #* Binning histograms & weighted averages # Best Practices #* High-level code design (modularity, interface specifications, unit testing, etc.) #* Code audit: open-source libraries, ex. Gnu Scientific Library, qsort in libc, Boost #* Source code versioning (example: git or mercurial) #* gdb & execution profiling #* documentation #* Makefiles == Grading == '''Grading Scale (out of 400 points possible)''' {| class="wikitable" |- ! Grade ! Undergraduate ! Graduate |- | A | 230 | 300 |- | B | 180 | 230 |- | C | 150 | 180 |- | D | 120 | 150 |} * Points Possible: ** 10 homework assignments (20 points per homework) ** 2 projects / competitions (100 points per project) * Homework Rules ** For work done in groups, credit is divided equally among participants - so the max homework grade for a group of 2 is 10 points each. ** For each homework, 1 re-do at full credit can be sent at any time after the due date, but must present a unique solution to previous work from yourself or others. ** All work must cite co-group members (if any) and the source of any code snippets used online. === Grading Rationale === Homework points will only be awarded for correct, working code and correct algorithmic analysis, while the homework problems will become progressively tougher. Undergraduates should be able to pass the course with an A if they have correctly answered most of the homework, and made a strong attempt at one of the projects. Graduate students should both perform well on the homework and successfully complete one or two projects. Essentially, this means you should do your own homework when possible and may do a project in a small group. The re-grading and group options for homework allow making up for missed assignments, and encourage returning to core concepts at a later point in the class. Students who have completed significant portions of the homework have thus demonstrated programming proficiency, and are qualified for at least B/C grades. == Projects == === Midterm === TBA === Final === TBA == Textbooks and Resources == * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-0072-7 Beginning Python, Hetland, 2005] (eBook avail. from USF Library) * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-3238-4 Python Algorithms, Hetland, 2010] (eBook avail. from USF Library) * [http://aosabook.org/en/index.html The Architecture of Open Source Applications] * [http://docs.python.org Python Documentation] * [https://developers.google.com/edu/python/ Google Introductory Python Notes] * [http://huffman.sourceforge.net/tao/tao-of-programming.html Tao of Programming] Other (possibly useful) materials: * [http://hackersdictionary.com/html/entry/larval-stage.html The Jargon File] * Chapters 7&8 of Modelling and Simulation, Birta and Arbez, Springer 2007 (eBook avail. from USF Library). * Chapters 4-6 of Models and Algorithms for Intelligent Data Analysis, Runkler, Springer 2012 (eBook avail. from USF Library). * Guide to Scientific Computing in C++, Francis and Whiteley, Springer, 2012. (eBook avail. from USF Library) * Extra info. On the basics: ** Chapters 3 and 7 of Mathematics in Computing, Regan, Springer 2013. (eBook avail. from USF Library) ** Instant feedback graphical programming with [https://www.khanacademy.org/cs/programming/ Khan Academy] * [http://www.meetup.com/python-178/ Local PyBulls Meetings] Code: * [http://carsonfarmer.com/2013/07/essential-python-geo-libraries Python Libraries Useful for Geospatial Problems] * [[Code#Python_Libraries|Python Libraries Useful for Computational Chemistry]] (very small list at present) Interactive Interpreters: * [http://www.codewars.com CodeWars] Recommended for building experience with practice problems. * [http://exercism.io Exercism] A command-line client with a similar learn-through-challenge philosophy. * [http://repl.it repl.it] A read-eval-print loop for several computer languages. * [http://en.cppreference.com/w/cpp/language CppReference] Documentation with an online evaluator for C++ code. === Notes & Homework === * [[Media:intro.pdf|Notes]] for Week 1 ** Over the first two weeks or so, we'll be practicing the basics - so read through Chapters 1-3 of Hetland's Beginning Python during this time. ** [[PythonTranslated|Important Definitions]] ** [[CompSciHW1|Homework 1]] is due Monday, January 25. * [[Media:Week2.pdf|Notes]] for Week 2 ** [[Code:Oware|Oware code]] ** Solutions for some problems in Week 2's notes: <source lang="python"> # simple data types "a string" # : str x = [1, 2, 3] # : [int] # compound data type (1, "name", (x, x)) # : (int, str, ([int], [int])) # add_one : int -> int # str.__add__ : str -> str -> str # str.split : str -> [str] # str.__mod__ : str -> (Objects) -> str </source> 219e0ab6988302e755438af1d533e23dd508a8f1 423 422 2016-01-25T15:57:10Z David M. Rogers 2 /* Notes & Homework */ wikitext text/x-wiki '''<BIG>Introduction to Scientific Computing</BIG>''' Course Info * Course Numbers CHM 4932-004/6938-010, CRN: 22347/22348 * Credit Hours: 3 * Meeting Dates: January 22 - April 27, 2016 ** No Class Jan. 18 or Mar. 14-19 * Meeting Times: Mon. and Wed., 12:30-13:45 in SCA 222 ** Lab Session & Office Hours: Fri. 12:30-13:45 in SCA 222 (or SCA 433) == Overview == Mathematical models in the natural sciences take many shapes and forms. The moment they become more complicated than tracking a few variables over time, we have to put away our Excel spreadsheets and make use of a solid foundation in computational science. The course establishes this foundation by introducing data structures and algorithms used in everyday scientific computing using examples in the python scripting language. By the end of the Semester, students will be able to navigate the Linux command-line to go from a mathematical model to a numerical solution. Best practices for working with computer code and visualizing data will also be covered. == Topics == # Languages #* bash (shell) #* python (scripting) #* stack & register-based machine languages: overview of C and Fortran syntax & compiling with gcc, ‘thread safety’ #* Shared libraries & language inter-operability (FFI) # Algorithms #* Horner’s algorithm for polynomials #* Newton’s root finding algo. #* Overview of general optimization algo-s (example: linear & nonlin. least-squares) #* Numerical integration (scripted, plus gnu ODE) #* Communication (how HTTP get/put works) # Data Structures #* Linked Lists #* Trees (file system hierarchies) #* Graphs #* Arrays (dense & sparse) example: vectors & rotations / transpositions, densities and difference operators # Presentation & visualization #* Flat CSV files (and excel) #* Working with binary data #* Python matplotlib (2D images) #* Binning histograms & weighted averages # Best Practices #* High-level code design (modularity, interface specifications, unit testing, etc.) #* Code audit: open-source libraries, ex. Gnu Scientific Library, qsort in libc, Boost #* Source code versioning (example: git or mercurial) #* gdb & execution profiling #* documentation #* Makefiles == Grading == '''Grading Scale (out of 400 points possible)''' {| class="wikitable" |- ! Grade ! Undergraduate ! Graduate |- | A | 230 | 300 |- | B | 180 | 230 |- | C | 150 | 180 |- | D | 120 | 150 |} * Points Possible: ** 10 homework assignments (20 points per homework) ** 2 projects / competitions (100 points per project) * Homework Rules ** For work done in groups, credit is divided equally among participants - so the max homework grade for a group of 2 is 10 points each. ** For each homework, 1 re-do at full credit can be sent at any time after the due date, but must present a unique solution to previous work from yourself or others. ** All work must cite co-group members (if any) and the source of any code snippets used online. === Grading Rationale === Homework points will only be awarded for correct, working code and correct algorithmic analysis, while the homework problems will become progressively tougher. Undergraduates should be able to pass the course with an A if they have correctly answered most of the homework, and made a strong attempt at one of the projects. Graduate students should both perform well on the homework and successfully complete one or two projects. Essentially, this means you should do your own homework when possible and may do a project in a small group. The re-grading and group options for homework allow making up for missed assignments, and encourage returning to core concepts at a later point in the class. Students who have completed significant portions of the homework have thus demonstrated programming proficiency, and are qualified for at least B/C grades. == Projects == === Midterm === TBA === Final === TBA == Textbooks and Resources == * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-0072-7 Beginning Python, Hetland, 2005] (eBook avail. from USF Library) * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-3238-4 Python Algorithms, Hetland, 2010] (eBook avail. from USF Library) * [http://aosabook.org/en/index.html The Architecture of Open Source Applications] * [http://docs.python.org Python Documentation] * [https://developers.google.com/edu/python/ Google Introductory Python Notes] * [http://huffman.sourceforge.net/tao/tao-of-programming.html Tao of Programming] Other (possibly useful) materials: * [http://hackersdictionary.com/html/entry/larval-stage.html The Jargon File] * Chapters 7&8 of Modelling and Simulation, Birta and Arbez, Springer 2007 (eBook avail. from USF Library). * Chapters 4-6 of Models and Algorithms for Intelligent Data Analysis, Runkler, Springer 2012 (eBook avail. from USF Library). * Guide to Scientific Computing in C++, Francis and Whiteley, Springer, 2012. (eBook avail. from USF Library) * Extra info. On the basics: ** Chapters 3 and 7 of Mathematics in Computing, Regan, Springer 2013. (eBook avail. from USF Library) ** Instant feedback graphical programming with [https://www.khanacademy.org/cs/programming/ Khan Academy] * [http://www.meetup.com/python-178/ Local PyBulls Meetings] Code: * [http://carsonfarmer.com/2013/07/essential-python-geo-libraries Python Libraries Useful for Geospatial Problems] * [[Code#Python_Libraries|Python Libraries Useful for Computational Chemistry]] (very small list at present) Interactive Interpreters: * [http://www.codewars.com CodeWars] Recommended for building experience with practice problems. * [http://exercism.io Exercism] A command-line client with a similar learn-through-challenge philosophy. * [http://repl.it repl.it] A read-eval-print loop for several computer languages. * [http://en.cppreference.com/w/cpp/language CppReference] Documentation with an online evaluator for C++ code. === Notes === * [[Media:intro.pdf|Notes]] for Week 1 ** Over the first two weeks or so, we'll be practicing the basics - so read through Chapters 1-3 of Hetland's Beginning Python during this time. ** [[PythonTranslated|Important Definitions]] * [[Media:Week2.pdf|Notes]] for Week 2 ** [[Code:Oware|Oware code]] ** Solutions for some problems in Week 2's notes: <source lang="python"> # simple data types "a string" # : str x = [1, 2, 3] # : [int] # compound data type (1, "name", (x, x)) # : (int, str, ([int], [int])) # add_one : int -> int # str.__add__ : str -> str -> str # str.split : str -> [str] # str.__mod__ : str -> (Objects) -> str </source> * [[Media:Week3.pdf|Notes]] for Week 3 === Homework === * [[CompSciHW1|Homework 1]] is due Monday, January 25. * [[CompSciHW2|Homework 2]] is due Monday, February 1. 68809dfe94926124d4b2dedf94d765f882cc395a 425 423 2016-01-25T19:29:35Z David M. Rogers 2 /* Notes */ wikitext text/x-wiki '''<BIG>Introduction to Scientific Computing</BIG>''' Course Info * Course Numbers CHM 4932-004/6938-010, CRN: 22347/22348 * Credit Hours: 3 * Meeting Dates: January 22 - April 27, 2016 ** No Class Jan. 18 or Mar. 14-19 * Meeting Times: Mon. and Wed., 12:30-13:45 in SCA 222 ** Lab Session & Office Hours: Fri. 12:30-13:45 in SCA 222 (or SCA 433) == Overview == Mathematical models in the natural sciences take many shapes and forms. The moment they become more complicated than tracking a few variables over time, we have to put away our Excel spreadsheets and make use of a solid foundation in computational science. The course establishes this foundation by introducing data structures and algorithms used in everyday scientific computing using examples in the python scripting language. By the end of the Semester, students will be able to navigate the Linux command-line to go from a mathematical model to a numerical solution. Best practices for working with computer code and visualizing data will also be covered. == Topics == # Languages #* bash (shell) #* python (scripting) #* stack & register-based machine languages: overview of C and Fortran syntax & compiling with gcc, ‘thread safety’ #* Shared libraries & language inter-operability (FFI) # Algorithms #* Horner’s algorithm for polynomials #* Newton’s root finding algo. #* Overview of general optimization algo-s (example: linear & nonlin. least-squares) #* Numerical integration (scripted, plus gnu ODE) #* Communication (how HTTP get/put works) # Data Structures #* Linked Lists #* Trees (file system hierarchies) #* Graphs #* Arrays (dense & sparse) example: vectors & rotations / transpositions, densities and difference operators # Presentation & visualization #* Flat CSV files (and excel) #* Working with binary data #* Python matplotlib (2D images) #* Binning histograms & weighted averages # Best Practices #* High-level code design (modularity, interface specifications, unit testing, etc.) #* Code audit: open-source libraries, ex. Gnu Scientific Library, qsort in libc, Boost #* Source code versioning (example: git or mercurial) #* gdb & execution profiling #* documentation #* Makefiles == Grading == '''Grading Scale (out of 400 points possible)''' {| class="wikitable" |- ! Grade ! Undergraduate ! Graduate |- | A | 230 | 300 |- | B | 180 | 230 |- | C | 150 | 180 |- | D | 120 | 150 |} * Points Possible: ** 10 homework assignments (20 points per homework) ** 2 projects / competitions (100 points per project) * Homework Rules ** For work done in groups, credit is divided equally among participants - so the max homework grade for a group of 2 is 10 points each. ** For each homework, 1 re-do at full credit can be sent at any time after the due date, but must present a unique solution to previous work from yourself or others. ** All work must cite co-group members (if any) and the source of any code snippets used online. === Grading Rationale === Homework points will only be awarded for correct, working code and correct algorithmic analysis, while the homework problems will become progressively tougher. Undergraduates should be able to pass the course with an A if they have correctly answered most of the homework, and made a strong attempt at one of the projects. Graduate students should both perform well on the homework and successfully complete one or two projects. Essentially, this means you should do your own homework when possible and may do a project in a small group. The re-grading and group options for homework allow making up for missed assignments, and encourage returning to core concepts at a later point in the class. Students who have completed significant portions of the homework have thus demonstrated programming proficiency, and are qualified for at least B/C grades. == Projects == === Midterm === TBA === Final === TBA == Textbooks and Resources == * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-0072-7 Beginning Python, Hetland, 2005] (eBook avail. from USF Library) * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-3238-4 Python Algorithms, Hetland, 2010] (eBook avail. from USF Library) * [http://aosabook.org/en/index.html The Architecture of Open Source Applications] * [http://docs.python.org Python Documentation] * [https://developers.google.com/edu/python/ Google Introductory Python Notes] * [http://huffman.sourceforge.net/tao/tao-of-programming.html Tao of Programming] Other (possibly useful) materials: * [http://hackersdictionary.com/html/entry/larval-stage.html The Jargon File] * Chapters 7&8 of Modelling and Simulation, Birta and Arbez, Springer 2007 (eBook avail. from USF Library). * Chapters 4-6 of Models and Algorithms for Intelligent Data Analysis, Runkler, Springer 2012 (eBook avail. from USF Library). * Guide to Scientific Computing in C++, Francis and Whiteley, Springer, 2012. (eBook avail. from USF Library) * Extra info. On the basics: ** Chapters 3 and 7 of Mathematics in Computing, Regan, Springer 2013. (eBook avail. from USF Library) ** Instant feedback graphical programming with [https://www.khanacademy.org/cs/programming/ Khan Academy] * [http://www.meetup.com/python-178/ Local PyBulls Meetings] Code: * [http://carsonfarmer.com/2013/07/essential-python-geo-libraries Python Libraries Useful for Geospatial Problems] * [[Code#Python_Libraries|Python Libraries Useful for Computational Chemistry]] (very small list at present) Interactive Interpreters: * [http://www.codewars.com CodeWars] Recommended for building experience with practice problems. * [http://exercism.io Exercism] A command-line client with a similar learn-through-challenge philosophy. * [http://repl.it repl.it] A read-eval-print loop for several computer languages. * [http://en.cppreference.com/w/cpp/language CppReference] Documentation with an online evaluator for C++ code. === Notes === * [[Media:intro.pdf|Notes]] for Week 1 ** Over the first two weeks or so, we'll be practicing the basics - so read through Chapters 1-3 of Hetland's Beginning Python during this time. ** [[PythonTranslated|Important Definitions]] * [[Media:Week2.pdf|Notes]] for Week 2 ** [[Code:Oware|Oware code]] ** Solutions for some problems in Week 2's notes: <source lang="python"> # simple data types "a string" # : str x = [1, 2, 3] # : [int] # compound data type (1, "name", (x, x)) # : (int, str, ([int], [int])) # add_one : int -> int # str.__add__ : str -> str -> str # str.split : str -> [str] # str.__mod__ : str -> (Objects) -> str </source> * [[Media:Week3.pdf|Notes]] for Week 3 ** [[Code:for_patterns|Abstracting patterns]] in for loops. === Homework === * [[CompSciHW1|Homework 1]] is due Monday, January 25. * [[CompSciHW2|Homework 2]] is due Monday, February 1. 5e220affe9b55ec198f6c6851a2e396c57b5b8bf 430 425 2016-01-27T18:18:01Z David M. Rogers 2 /* Homework */ wikitext text/x-wiki '''<BIG>Introduction to Scientific Computing</BIG>''' Course Info * Course Numbers CHM 4932-004/6938-010, CRN: 22347/22348 * Credit Hours: 3 * Meeting Dates: January 22 - April 27, 2016 ** No Class Jan. 18 or Mar. 14-19 * Meeting Times: Mon. and Wed., 12:30-13:45 in SCA 222 ** Lab Session & Office Hours: Fri. 12:30-13:45 in SCA 222 (or SCA 433) == Overview == Mathematical models in the natural sciences take many shapes and forms. The moment they become more complicated than tracking a few variables over time, we have to put away our Excel spreadsheets and make use of a solid foundation in computational science. The course establishes this foundation by introducing data structures and algorithms used in everyday scientific computing using examples in the python scripting language. By the end of the Semester, students will be able to navigate the Linux command-line to go from a mathematical model to a numerical solution. Best practices for working with computer code and visualizing data will also be covered. == Topics == # Languages #* bash (shell) #* python (scripting) #* stack & register-based machine languages: overview of C and Fortran syntax & compiling with gcc, ‘thread safety’ #* Shared libraries & language inter-operability (FFI) # Algorithms #* Horner’s algorithm for polynomials #* Newton’s root finding algo. #* Overview of general optimization algo-s (example: linear & nonlin. least-squares) #* Numerical integration (scripted, plus gnu ODE) #* Communication (how HTTP get/put works) # Data Structures #* Linked Lists #* Trees (file system hierarchies) #* Graphs #* Arrays (dense & sparse) example: vectors & rotations / transpositions, densities and difference operators # Presentation & visualization #* Flat CSV files (and excel) #* Working with binary data #* Python matplotlib (2D images) #* Binning histograms & weighted averages # Best Practices #* High-level code design (modularity, interface specifications, unit testing, etc.) #* Code audit: open-source libraries, ex. Gnu Scientific Library, qsort in libc, Boost #* Source code versioning (example: git or mercurial) #* gdb & execution profiling #* documentation #* Makefiles == Grading == '''Grading Scale (out of 400 points possible)''' {| class="wikitable" |- ! Grade ! Undergraduate ! Graduate |- | A | 230 | 300 |- | B | 180 | 230 |- | C | 150 | 180 |- | D | 120 | 150 |} * Points Possible: ** 10 homework assignments (20 points per homework) ** 2 projects / competitions (100 points per project) * Homework Rules ** For work done in groups, credit is divided equally among participants - so the max homework grade for a group of 2 is 10 points each. ** For each homework, 1 re-do at full credit can be sent at any time after the due date, but must present a unique solution to previous work from yourself or others. ** All work must cite co-group members (if any) and the source of any code snippets used online. === Grading Rationale === Homework points will only be awarded for correct, working code and correct algorithmic analysis, while the homework problems will become progressively tougher. Undergraduates should be able to pass the course with an A if they have correctly answered most of the homework, and made a strong attempt at one of the projects. Graduate students should both perform well on the homework and successfully complete one or two projects. Essentially, this means you should do your own homework when possible and may do a project in a small group. The re-grading and group options for homework allow making up for missed assignments, and encourage returning to core concepts at a later point in the class. Students who have completed significant portions of the homework have thus demonstrated programming proficiency, and are qualified for at least B/C grades. == Projects == === Midterm === TBA === Final === TBA == Textbooks and Resources == * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-0072-7 Beginning Python, Hetland, 2005] (eBook avail. from USF Library) * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-3238-4 Python Algorithms, Hetland, 2010] (eBook avail. from USF Library) * [http://aosabook.org/en/index.html The Architecture of Open Source Applications] * [http://docs.python.org Python Documentation] * [https://developers.google.com/edu/python/ Google Introductory Python Notes] * [http://huffman.sourceforge.net/tao/tao-of-programming.html Tao of Programming] Other (possibly useful) materials: * [http://hackersdictionary.com/html/entry/larval-stage.html The Jargon File] * Chapters 7&8 of Modelling and Simulation, Birta and Arbez, Springer 2007 (eBook avail. from USF Library). * Chapters 4-6 of Models and Algorithms for Intelligent Data Analysis, Runkler, Springer 2012 (eBook avail. from USF Library). * Guide to Scientific Computing in C++, Francis and Whiteley, Springer, 2012. (eBook avail. from USF Library) * Extra info. On the basics: ** Chapters 3 and 7 of Mathematics in Computing, Regan, Springer 2013. (eBook avail. from USF Library) ** Instant feedback graphical programming with [https://www.khanacademy.org/cs/programming/ Khan Academy] * [http://www.meetup.com/python-178/ Local PyBulls Meetings] Code: * [http://carsonfarmer.com/2013/07/essential-python-geo-libraries Python Libraries Useful for Geospatial Problems] * [[Code#Python_Libraries|Python Libraries Useful for Computational Chemistry]] (very small list at present) Interactive Interpreters: * [http://www.codewars.com CodeWars] Recommended for building experience with practice problems. * [http://exercism.io Exercism] A command-line client with a similar learn-through-challenge philosophy. * [http://repl.it repl.it] A read-eval-print loop for several computer languages. * [http://en.cppreference.com/w/cpp/language CppReference] Documentation with an online evaluator for C++ code. === Notes === * [[Media:intro.pdf|Notes]] for Week 1 ** Over the first two weeks or so, we'll be practicing the basics - so read through Chapters 1-3 of Hetland's Beginning Python during this time. ** [[PythonTranslated|Important Definitions]] * [[Media:Week2.pdf|Notes]] for Week 2 ** [[Code:Oware|Oware code]] ** Solutions for some problems in Week 2's notes: <source lang="python"> # simple data types "a string" # : str x = [1, 2, 3] # : [int] # compound data type (1, "name", (x, x)) # : (int, str, ([int], [int])) # add_one : int -> int # str.__add__ : str -> str -> str # str.split : str -> [str] # str.__mod__ : str -> (Objects) -> str </source> * [[Media:Week3.pdf|Notes]] for Week 3 ** [[Code:for_patterns|Abstracting patterns]] in for loops. === Homework === * [[CompSciHW1|Homework 1]] is due Monday, January 25. * [[CompSciHW2|Homework 2]] is due Monday, February 8. 10eeaeae829129d53e094f81f063b7faf6f0ddd9 433 430 2016-01-29T17:31:32Z David M. Rogers 2 /* Notes */ wikitext text/x-wiki '''<BIG>Introduction to Scientific Computing</BIG>''' Course Info * Course Numbers CHM 4932-004/6938-010, CRN: 22347/22348 * Credit Hours: 3 * Meeting Dates: January 22 - April 27, 2016 ** No Class Jan. 18 or Mar. 14-19 * Meeting Times: Mon. and Wed., 12:30-13:45 in SCA 222 ** Lab Session & Office Hours: Fri. 12:30-13:45 in SCA 222 (or SCA 433) == Overview == Mathematical models in the natural sciences take many shapes and forms. The moment they become more complicated than tracking a few variables over time, we have to put away our Excel spreadsheets and make use of a solid foundation in computational science. The course establishes this foundation by introducing data structures and algorithms used in everyday scientific computing using examples in the python scripting language. By the end of the Semester, students will be able to navigate the Linux command-line to go from a mathematical model to a numerical solution. Best practices for working with computer code and visualizing data will also be covered. == Topics == # Languages #* bash (shell) #* python (scripting) #* stack & register-based machine languages: overview of C and Fortran syntax & compiling with gcc, ‘thread safety’ #* Shared libraries & language inter-operability (FFI) # Algorithms #* Horner’s algorithm for polynomials #* Newton’s root finding algo. #* Overview of general optimization algo-s (example: linear & nonlin. least-squares) #* Numerical integration (scripted, plus gnu ODE) #* Communication (how HTTP get/put works) # Data Structures #* Linked Lists #* Trees (file system hierarchies) #* Graphs #* Arrays (dense & sparse) example: vectors & rotations / transpositions, densities and difference operators # Presentation & visualization #* Flat CSV files (and excel) #* Working with binary data #* Python matplotlib (2D images) #* Binning histograms & weighted averages # Best Practices #* High-level code design (modularity, interface specifications, unit testing, etc.) #* Code audit: open-source libraries, ex. Gnu Scientific Library, qsort in libc, Boost #* Source code versioning (example: git or mercurial) #* gdb & execution profiling #* documentation #* Makefiles == Grading == '''Grading Scale (out of 400 points possible)''' {| class="wikitable" |- ! Grade ! Undergraduate ! Graduate |- | A | 230 | 300 |- | B | 180 | 230 |- | C | 150 | 180 |- | D | 120 | 150 |} * Points Possible: ** 10 homework assignments (20 points per homework) ** 2 projects / competitions (100 points per project) * Homework Rules ** For work done in groups, credit is divided equally among participants - so the max homework grade for a group of 2 is 10 points each. ** For each homework, 1 re-do at full credit can be sent at any time after the due date, but must present a unique solution to previous work from yourself or others. ** All work must cite co-group members (if any) and the source of any code snippets used online. === Grading Rationale === Homework points will only be awarded for correct, working code and correct algorithmic analysis, while the homework problems will become progressively tougher. Undergraduates should be able to pass the course with an A if they have correctly answered most of the homework, and made a strong attempt at one of the projects. Graduate students should both perform well on the homework and successfully complete one or two projects. Essentially, this means you should do your own homework when possible and may do a project in a small group. The re-grading and group options for homework allow making up for missed assignments, and encourage returning to core concepts at a later point in the class. Students who have completed significant portions of the homework have thus demonstrated programming proficiency, and are qualified for at least B/C grades. == Projects == === Midterm === TBA === Final === TBA == Textbooks and Resources == * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-0072-7 Beginning Python, Hetland, 2005] (eBook avail. from USF Library) * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-3238-4 Python Algorithms, Hetland, 2010] (eBook avail. from USF Library) * [http://aosabook.org/en/index.html The Architecture of Open Source Applications] * [http://docs.python.org Python Documentation] * [https://developers.google.com/edu/python/ Google Introductory Python Notes] * [http://huffman.sourceforge.net/tao/tao-of-programming.html Tao of Programming] Other (possibly useful) materials: * [http://hackersdictionary.com/html/entry/larval-stage.html The Jargon File] * Chapters 7&8 of Modelling and Simulation, Birta and Arbez, Springer 2007 (eBook avail. from USF Library). * Chapters 4-6 of Models and Algorithms for Intelligent Data Analysis, Runkler, Springer 2012 (eBook avail. from USF Library). * Guide to Scientific Computing in C++, Francis and Whiteley, Springer, 2012. (eBook avail. from USF Library) * Extra info. On the basics: ** Chapters 3 and 7 of Mathematics in Computing, Regan, Springer 2013. (eBook avail. from USF Library) ** Instant feedback graphical programming with [https://www.khanacademy.org/cs/programming/ Khan Academy] * [http://www.meetup.com/python-178/ Local PyBulls Meetings] Code: * [http://carsonfarmer.com/2013/07/essential-python-geo-libraries Python Libraries Useful for Geospatial Problems] * [[Code#Python_Libraries|Python Libraries Useful for Computational Chemistry]] (very small list at present) Interactive Interpreters: * [http://www.codewars.com CodeWars] Recommended for building experience with practice problems. * [http://exercism.io Exercism] A command-line client with a similar learn-through-challenge philosophy. * [http://repl.it repl.it] A read-eval-print loop for several computer languages. * [http://en.cppreference.com/w/cpp/language CppReference] Documentation with an online evaluator for C++ code. === Notes === * [[Media:intro.pdf|Notes]] for Week 1 ** Over the first two weeks or so, we'll be practicing the basics - so read through Chapters 1-3 of Hetland's Beginning Python during this time. ** [[PythonTranslated|Important Definitions]] * [[Media:Week2.pdf|Notes]] for Week 2 ** [[Code:Oware|Oware code]] ** Solutions for some problems in Week 2's notes: <source lang="python"> # simple data types "a string" # : str x = [1, 2, 3] # : [int] # compound data type (1, "name", (x, x)) # : (int, str, ([int], [int])) # add_one : int -> int # str.__add__ : str -> str -> str # str.split : str -> [str] # str.__mod__ : str -> (Objects) -> str </source> * [[Media:Week3.pdf|Notes]] for Week 3 ** Reading assignment - read through Chapter 5 and 6 (and practice dictionaries from Ch. 4) ** [[Code:for_patterns|Abstracting patterns]] in for loops. === Homework === * [[CompSciHW1|Homework 1]] is due Monday, January 25. * [[CompSciHW2|Homework 2]] is due Monday, February 8. 5319769d8ddf50af07d06f92b37235b65b5753ca 437 433 2016-02-08T16:05:12Z David M. Rogers 2 /* Notes */ wikitext text/x-wiki '''<BIG>Introduction to Scientific Computing</BIG>''' Course Info * Course Numbers CHM 4932-004/6938-010, CRN: 22347/22348 * Credit Hours: 3 * Meeting Dates: January 22 - April 27, 2016 ** No Class Jan. 18 or Mar. 14-19 * Meeting Times: Mon. and Wed., 12:30-13:45 in SCA 222 ** Lab Session & Office Hours: Fri. 12:30-13:45 in SCA 222 (or SCA 433) == Overview == Mathematical models in the natural sciences take many shapes and forms. The moment they become more complicated than tracking a few variables over time, we have to put away our Excel spreadsheets and make use of a solid foundation in computational science. The course establishes this foundation by introducing data structures and algorithms used in everyday scientific computing using examples in the python scripting language. By the end of the Semester, students will be able to navigate the Linux command-line to go from a mathematical model to a numerical solution. Best practices for working with computer code and visualizing data will also be covered. == Topics == # Languages #* bash (shell) #* python (scripting) #* stack & register-based machine languages: overview of C and Fortran syntax & compiling with gcc, ‘thread safety’ #* Shared libraries & language inter-operability (FFI) # Algorithms #* Horner’s algorithm for polynomials #* Newton’s root finding algo. #* Overview of general optimization algo-s (example: linear & nonlin. least-squares) #* Numerical integration (scripted, plus gnu ODE) #* Communication (how HTTP get/put works) # Data Structures #* Linked Lists #* Trees (file system hierarchies) #* Graphs #* Arrays (dense & sparse) example: vectors & rotations / transpositions, densities and difference operators # Presentation & visualization #* Flat CSV files (and excel) #* Working with binary data #* Python matplotlib (2D images) #* Binning histograms & weighted averages # Best Practices #* High-level code design (modularity, interface specifications, unit testing, etc.) #* Code audit: open-source libraries, ex. Gnu Scientific Library, qsort in libc, Boost #* Source code versioning (example: git or mercurial) #* gdb & execution profiling #* documentation #* Makefiles == Grading == '''Grading Scale (out of 400 points possible)''' {| class="wikitable" |- ! Grade ! Undergraduate ! Graduate |- | A | 230 | 300 |- | B | 180 | 230 |- | C | 150 | 180 |- | D | 120 | 150 |} * Points Possible: ** 10 homework assignments (20 points per homework) ** 2 projects / competitions (100 points per project) * Homework Rules ** For work done in groups, credit is divided equally among participants - so the max homework grade for a group of 2 is 10 points each. ** For each homework, 1 re-do at full credit can be sent at any time after the due date, but must present a unique solution to previous work from yourself or others. ** All work must cite co-group members (if any) and the source of any code snippets used online. === Grading Rationale === Homework points will only be awarded for correct, working code and correct algorithmic analysis, while the homework problems will become progressively tougher. Undergraduates should be able to pass the course with an A if they have correctly answered most of the homework, and made a strong attempt at one of the projects. Graduate students should both perform well on the homework and successfully complete one or two projects. Essentially, this means you should do your own homework when possible and may do a project in a small group. The re-grading and group options for homework allow making up for missed assignments, and encourage returning to core concepts at a later point in the class. Students who have completed significant portions of the homework have thus demonstrated programming proficiency, and are qualified for at least B/C grades. == Projects == === Midterm === TBA === Final === TBA == Textbooks and Resources == * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-0072-7 Beginning Python, Hetland, 2005] (eBook avail. from USF Library) * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-3238-4 Python Algorithms, Hetland, 2010] (eBook avail. from USF Library) * [http://aosabook.org/en/index.html The Architecture of Open Source Applications] * [http://docs.python.org Python Documentation] * [https://developers.google.com/edu/python/ Google Introductory Python Notes] * [http://huffman.sourceforge.net/tao/tao-of-programming.html Tao of Programming] Other (possibly useful) materials: * [http://hackersdictionary.com/html/entry/larval-stage.html The Jargon File] * Chapters 7&8 of Modelling and Simulation, Birta and Arbez, Springer 2007 (eBook avail. from USF Library). * Chapters 4-6 of Models and Algorithms for Intelligent Data Analysis, Runkler, Springer 2012 (eBook avail. from USF Library). * Guide to Scientific Computing in C++, Francis and Whiteley, Springer, 2012. (eBook avail. from USF Library) * Extra info. On the basics: ** Chapters 3 and 7 of Mathematics in Computing, Regan, Springer 2013. (eBook avail. from USF Library) ** Instant feedback graphical programming with [https://www.khanacademy.org/cs/programming/ Khan Academy] * [http://www.meetup.com/python-178/ Local PyBulls Meetings] Code: * [http://carsonfarmer.com/2013/07/essential-python-geo-libraries Python Libraries Useful for Geospatial Problems] * [[Code#Python_Libraries|Python Libraries Useful for Computational Chemistry]] (very small list at present) Interactive Interpreters: * [http://www.codewars.com CodeWars] Recommended for building experience with practice problems. * [http://exercism.io Exercism] A command-line client with a similar learn-through-challenge philosophy. * [http://repl.it repl.it] A read-eval-print loop for several computer languages. * [http://en.cppreference.com/w/cpp/language CppReference] Documentation with an online evaluator for C++ code. === Notes === * [[Media:intro.pdf|Notes]] for Week 1 ** Over the first two weeks or so, we'll be practicing the basics - so read through Chapters 1-3 of Hetland's Beginning Python during this time. ** [[PythonTranslated|Important Definitions]] * [[Media:Week2.pdf|Notes]] for Week 2 ** [[Code:Oware|Oware code]] ** Solutions for some problems in Week 2's notes: <source lang="python"> # simple data types "a string" # : str x = [1, 2, 3] # : [int] # compound data type (1, "name", (x, x)) # : (int, str, ([int], [int])) # add_one : int -> int # str.__add__ : str -> str -> str # str.split : str -> [str] # str.__mod__ : str -> (Objects) -> str </source> * [[Media:Week3.pdf|Notes]] for Week 3-4 ** Reading assignment - read through Chapter 5 and 6 (and practice dictionaries from Ch. 4) ** [[Code:for_patterns|Abstracting patterns]] in for loops. * [[Media:Week5.pdf|Notes]] for Week 5-6 ** Reading assignment - Read Chapter 10-11 (and refer to Ch. 4) === Homework === * [[CompSciHW1|Homework 1]] is due Monday, January 25. * [[CompSciHW2|Homework 2]] is due Monday, February 8. 4d541daeb3009ea0cf5a325e5bcf14d24ee4d9f4 440 437 2016-02-10T17:20:36Z David M. Rogers 2 /* Notes */ wikitext text/x-wiki '''<BIG>Introduction to Scientific Computing</BIG>''' Course Info * Course Numbers CHM 4932-004/6938-010, CRN: 22347/22348 * Credit Hours: 3 * Meeting Dates: January 22 - April 27, 2016 ** No Class Jan. 18 or Mar. 14-19 * Meeting Times: Mon. and Wed., 12:30-13:45 in SCA 222 ** Lab Session & Office Hours: Fri. 12:30-13:45 in SCA 222 (or SCA 433) == Overview == Mathematical models in the natural sciences take many shapes and forms. The moment they become more complicated than tracking a few variables over time, we have to put away our Excel spreadsheets and make use of a solid foundation in computational science. The course establishes this foundation by introducing data structures and algorithms used in everyday scientific computing using examples in the python scripting language. By the end of the Semester, students will be able to navigate the Linux command-line to go from a mathematical model to a numerical solution. Best practices for working with computer code and visualizing data will also be covered. == Topics == # Languages #* bash (shell) #* python (scripting) #* stack & register-based machine languages: overview of C and Fortran syntax & compiling with gcc, ‘thread safety’ #* Shared libraries & language inter-operability (FFI) # Algorithms #* Horner’s algorithm for polynomials #* Newton’s root finding algo. #* Overview of general optimization algo-s (example: linear & nonlin. least-squares) #* Numerical integration (scripted, plus gnu ODE) #* Communication (how HTTP get/put works) # Data Structures #* Linked Lists #* Trees (file system hierarchies) #* Graphs #* Arrays (dense & sparse) example: vectors & rotations / transpositions, densities and difference operators # Presentation & visualization #* Flat CSV files (and excel) #* Working with binary data #* Python matplotlib (2D images) #* Binning histograms & weighted averages # Best Practices #* High-level code design (modularity, interface specifications, unit testing, etc.) #* Code audit: open-source libraries, ex. Gnu Scientific Library, qsort in libc, Boost #* Source code versioning (example: git or mercurial) #* gdb & execution profiling #* documentation #* Makefiles == Grading == '''Grading Scale (out of 400 points possible)''' {| class="wikitable" |- ! Grade ! Undergraduate ! Graduate |- | A | 230 | 300 |- | B | 180 | 230 |- | C | 150 | 180 |- | D | 120 | 150 |} * Points Possible: ** 10 homework assignments (20 points per homework) ** 2 projects / competitions (100 points per project) * Homework Rules ** For work done in groups, credit is divided equally among participants - so the max homework grade for a group of 2 is 10 points each. ** For each homework, 1 re-do at full credit can be sent at any time after the due date, but must present a unique solution to previous work from yourself or others. ** All work must cite co-group members (if any) and the source of any code snippets used online. === Grading Rationale === Homework points will only be awarded for correct, working code and correct algorithmic analysis, while the homework problems will become progressively tougher. Undergraduates should be able to pass the course with an A if they have correctly answered most of the homework, and made a strong attempt at one of the projects. Graduate students should both perform well on the homework and successfully complete one or two projects. Essentially, this means you should do your own homework when possible and may do a project in a small group. The re-grading and group options for homework allow making up for missed assignments, and encourage returning to core concepts at a later point in the class. Students who have completed significant portions of the homework have thus demonstrated programming proficiency, and are qualified for at least B/C grades. == Projects == === Midterm === TBA === Final === TBA == Textbooks and Resources == * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-0072-7 Beginning Python, Hetland, 2005] (eBook avail. from USF Library) * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-3238-4 Python Algorithms, Hetland, 2010] (eBook avail. from USF Library) * [http://aosabook.org/en/index.html The Architecture of Open Source Applications] * [http://docs.python.org Python Documentation] * [https://developers.google.com/edu/python/ Google Introductory Python Notes] * [http://huffman.sourceforge.net/tao/tao-of-programming.html Tao of Programming] Other (possibly useful) materials: * [http://hackersdictionary.com/html/entry/larval-stage.html The Jargon File] * Chapters 7&8 of Modelling and Simulation, Birta and Arbez, Springer 2007 (eBook avail. from USF Library). * Chapters 4-6 of Models and Algorithms for Intelligent Data Analysis, Runkler, Springer 2012 (eBook avail. from USF Library). * Guide to Scientific Computing in C++, Francis and Whiteley, Springer, 2012. (eBook avail. from USF Library) * Extra info. On the basics: ** Chapters 3 and 7 of Mathematics in Computing, Regan, Springer 2013. (eBook avail. from USF Library) ** Instant feedback graphical programming with [https://www.khanacademy.org/cs/programming/ Khan Academy] * [http://www.meetup.com/python-178/ Local PyBulls Meetings] Code: * [http://carsonfarmer.com/2013/07/essential-python-geo-libraries Python Libraries Useful for Geospatial Problems] * [[Code#Python_Libraries|Python Libraries Useful for Computational Chemistry]] (very small list at present) Interactive Interpreters: * [http://www.codewars.com CodeWars] Recommended for building experience with practice problems. * [http://exercism.io Exercism] A command-line client with a similar learn-through-challenge philosophy. * [http://repl.it repl.it] A read-eval-print loop for several computer languages. * [http://en.cppreference.com/w/cpp/language CppReference] Documentation with an online evaluator for C++ code. === Notes === * [[Media:intro.pdf|Notes]] for Week 1 ** Over the first two weeks or so, we'll be practicing the basics - so read through Chapters 1-3 of Hetland's Beginning Python during this time. ** [[PythonTranslated|Important Definitions]] * [[Media:Week2.pdf|Notes]] for Week 2 ** [[Code:Oware|Oware code]] ** Solutions for some problems in Week 2's notes: <source lang="python"> # simple data types "a string" # : str x = [1, 2, 3] # : [int] # compound data type (1, "name", (x, x)) # : (int, str, ([int], [int])) * By this point, we've covered all the basics: ** base types: str, int, float, [a] ** variables and substitution: j vs "4" vs 4 ** indexing and slicing into lists / strings: x[1:4] or x[i:j] ** control flow: if and for syntax ** functions implementing patterns: def next(r, x): return r*x*(1-x) * You should be able to use these for: ** finding and abstracting the pattern ** naming the type of a function ** determining which variable names are in scope * All that's left is learning common uses, patterns and even more syntax! # add_one : int -> int # str.__add__ : str -> str -> str # str.split : str -> [str] # str.__mod__ : str -> (Objects) -> str </source> * [[Media:Week3.pdf|Notes]] for Week 3-4 ** Reading assignment - read through Chapter 5 and 6 (and practice dictionaries from Ch. 4) ** [[Code:for_patterns|Abstracting patterns]] in for loops. * [[Media:Week5.pdf|Notes]] for Week 5-6 ** Reading assignment - Read Chapter 10-11 (and refer to Ch. 4) === Homework === * [[CompSciHW1|Homework 1]] is due Monday, January 25. * [[CompSciHW2|Homework 2]] is due Monday, February 8. d71067aad757b9039e45ac9fe3cd7df250b73f8e 441 440 2016-02-10T17:21:21Z David M. Rogers 2 /* Notes */ wikitext text/x-wiki '''<BIG>Introduction to Scientific Computing</BIG>''' Course Info * Course Numbers CHM 4932-004/6938-010, CRN: 22347/22348 * Credit Hours: 3 * Meeting Dates: January 22 - April 27, 2016 ** No Class Jan. 18 or Mar. 14-19 * Meeting Times: Mon. and Wed., 12:30-13:45 in SCA 222 ** Lab Session & Office Hours: Fri. 12:30-13:45 in SCA 222 (or SCA 433) == Overview == Mathematical models in the natural sciences take many shapes and forms. The moment they become more complicated than tracking a few variables over time, we have to put away our Excel spreadsheets and make use of a solid foundation in computational science. The course establishes this foundation by introducing data structures and algorithms used in everyday scientific computing using examples in the python scripting language. By the end of the Semester, students will be able to navigate the Linux command-line to go from a mathematical model to a numerical solution. Best practices for working with computer code and visualizing data will also be covered. == Topics == # Languages #* bash (shell) #* python (scripting) #* stack & register-based machine languages: overview of C and Fortran syntax & compiling with gcc, ‘thread safety’ #* Shared libraries & language inter-operability (FFI) # Algorithms #* Horner’s algorithm for polynomials #* Newton’s root finding algo. #* Overview of general optimization algo-s (example: linear & nonlin. least-squares) #* Numerical integration (scripted, plus gnu ODE) #* Communication (how HTTP get/put works) # Data Structures #* Linked Lists #* Trees (file system hierarchies) #* Graphs #* Arrays (dense & sparse) example: vectors & rotations / transpositions, densities and difference operators # Presentation & visualization #* Flat CSV files (and excel) #* Working with binary data #* Python matplotlib (2D images) #* Binning histograms & weighted averages # Best Practices #* High-level code design (modularity, interface specifications, unit testing, etc.) #* Code audit: open-source libraries, ex. Gnu Scientific Library, qsort in libc, Boost #* Source code versioning (example: git or mercurial) #* gdb & execution profiling #* documentation #* Makefiles == Grading == '''Grading Scale (out of 400 points possible)''' {| class="wikitable" |- ! Grade ! Undergraduate ! Graduate |- | A | 230 | 300 |- | B | 180 | 230 |- | C | 150 | 180 |- | D | 120 | 150 |} * Points Possible: ** 10 homework assignments (20 points per homework) ** 2 projects / competitions (100 points per project) * Homework Rules ** For work done in groups, credit is divided equally among participants - so the max homework grade for a group of 2 is 10 points each. ** For each homework, 1 re-do at full credit can be sent at any time after the due date, but must present a unique solution to previous work from yourself or others. ** All work must cite co-group members (if any) and the source of any code snippets used online. === Grading Rationale === Homework points will only be awarded for correct, working code and correct algorithmic analysis, while the homework problems will become progressively tougher. Undergraduates should be able to pass the course with an A if they have correctly answered most of the homework, and made a strong attempt at one of the projects. Graduate students should both perform well on the homework and successfully complete one or two projects. Essentially, this means you should do your own homework when possible and may do a project in a small group. The re-grading and group options for homework allow making up for missed assignments, and encourage returning to core concepts at a later point in the class. Students who have completed significant portions of the homework have thus demonstrated programming proficiency, and are qualified for at least B/C grades. == Projects == === Midterm === TBA === Final === TBA == Textbooks and Resources == * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-0072-7 Beginning Python, Hetland, 2005] (eBook avail. from USF Library) * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-3238-4 Python Algorithms, Hetland, 2010] (eBook avail. from USF Library) * [http://aosabook.org/en/index.html The Architecture of Open Source Applications] * [http://docs.python.org Python Documentation] * [https://developers.google.com/edu/python/ Google Introductory Python Notes] * [http://huffman.sourceforge.net/tao/tao-of-programming.html Tao of Programming] Other (possibly useful) materials: * [http://hackersdictionary.com/html/entry/larval-stage.html The Jargon File] * Chapters 7&8 of Modelling and Simulation, Birta and Arbez, Springer 2007 (eBook avail. from USF Library). * Chapters 4-6 of Models and Algorithms for Intelligent Data Analysis, Runkler, Springer 2012 (eBook avail. from USF Library). * Guide to Scientific Computing in C++, Francis and Whiteley, Springer, 2012. (eBook avail. from USF Library) * Extra info. On the basics: ** Chapters 3 and 7 of Mathematics in Computing, Regan, Springer 2013. (eBook avail. from USF Library) ** Instant feedback graphical programming with [https://www.khanacademy.org/cs/programming/ Khan Academy] * [http://www.meetup.com/python-178/ Local PyBulls Meetings] Code: * [http://carsonfarmer.com/2013/07/essential-python-geo-libraries Python Libraries Useful for Geospatial Problems] * [[Code#Python_Libraries|Python Libraries Useful for Computational Chemistry]] (very small list at present) Interactive Interpreters: * [http://www.codewars.com CodeWars] Recommended for building experience with practice problems. * [http://exercism.io Exercism] A command-line client with a similar learn-through-challenge philosophy. * [http://repl.it repl.it] A read-eval-print loop for several computer languages. * [http://en.cppreference.com/w/cpp/language CppReference] Documentation with an online evaluator for C++ code. === Notes === * [[Media:intro.pdf|Notes]] for Week 1 ** Over the first two weeks or so, we'll be practicing the basics - so read through Chapters 1-3 of Hetland's Beginning Python during this time. ** [[PythonTranslated|Important Definitions]] * [[Media:Week2.pdf|Notes]] for Week 2 ** [[Code:Oware|Oware code]] ** Solutions for some problems in Week 2's notes: <source lang="python"> # simple data types "a string" # : str x = [1, 2, 3] # : [int] # compound data type (1, "name", (x, x)) # : (int, str, ([int], [int])) # add_one : int -> int # str.__add__ : str -> str -> str # str.split : str -> [str] # str.__mod__ : str -> (Objects) -> str </source> * [[Media:Week3.pdf|Notes]] for Week 3-4 ** Reading assignment - read through Chapter 5 and 6 (and practice dictionaries from Ch. 4) ** [[Code:for_patterns|Abstracting patterns]] in for loops. * [[Media:Week5.pdf|Notes]] for Week 5-6 ** Reading assignment - Read Chapter 10-11 (and refer to Ch. 4) * By this point, we've covered all the basics: ** base types: str, int, float, [a] ** variables and substitution: j vs "4" vs 4 ** indexing and slicing into lists / strings: x[1:4] or x[i:j] ** control flow: if and for syntax ** functions implementing patterns: def next(r, x): return r*x*(1-x) * You should be able to use these for: ** finding and abstracting the pattern ** naming the type of a function ** determining which variable names are in scope * All that's left is learning common uses, patterns and even more syntax! === Homework === * [[CompSciHW1|Homework 1]] is due Monday, January 25. * [[CompSciHW2|Homework 2]] is due Monday, February 8. 2589732bae2f1d58391001a72645d1a9126373e2 443 441 2016-02-12T15:14:10Z David M. Rogers 2 /* Homework */ wikitext text/x-wiki '''<BIG>Introduction to Scientific Computing</BIG>''' Course Info * Course Numbers CHM 4932-004/6938-010, CRN: 22347/22348 * Credit Hours: 3 * Meeting Dates: January 22 - April 27, 2016 ** No Class Jan. 18 or Mar. 14-19 * Meeting Times: Mon. and Wed., 12:30-13:45 in SCA 222 ** Lab Session & Office Hours: Fri. 12:30-13:45 in SCA 222 (or SCA 433) == Overview == Mathematical models in the natural sciences take many shapes and forms. The moment they become more complicated than tracking a few variables over time, we have to put away our Excel spreadsheets and make use of a solid foundation in computational science. The course establishes this foundation by introducing data structures and algorithms used in everyday scientific computing using examples in the python scripting language. By the end of the Semester, students will be able to navigate the Linux command-line to go from a mathematical model to a numerical solution. Best practices for working with computer code and visualizing data will also be covered. == Topics == # Languages #* bash (shell) #* python (scripting) #* stack & register-based machine languages: overview of C and Fortran syntax & compiling with gcc, ‘thread safety’ #* Shared libraries & language inter-operability (FFI) # Algorithms #* Horner’s algorithm for polynomials #* Newton’s root finding algo. #* Overview of general optimization algo-s (example: linear & nonlin. least-squares) #* Numerical integration (scripted, plus gnu ODE) #* Communication (how HTTP get/put works) # Data Structures #* Linked Lists #* Trees (file system hierarchies) #* Graphs #* Arrays (dense & sparse) example: vectors & rotations / transpositions, densities and difference operators # Presentation & visualization #* Flat CSV files (and excel) #* Working with binary data #* Python matplotlib (2D images) #* Binning histograms & weighted averages # Best Practices #* High-level code design (modularity, interface specifications, unit testing, etc.) #* Code audit: open-source libraries, ex. Gnu Scientific Library, qsort in libc, Boost #* Source code versioning (example: git or mercurial) #* gdb & execution profiling #* documentation #* Makefiles == Grading == '''Grading Scale (out of 400 points possible)''' {| class="wikitable" |- ! Grade ! Undergraduate ! Graduate |- | A | 230 | 300 |- | B | 180 | 230 |- | C | 150 | 180 |- | D | 120 | 150 |} * Points Possible: ** 10 homework assignments (20 points per homework) ** 2 projects / competitions (100 points per project) * Homework Rules ** For work done in groups, credit is divided equally among participants - so the max homework grade for a group of 2 is 10 points each. ** For each homework, 1 re-do at full credit can be sent at any time after the due date, but must present a unique solution to previous work from yourself or others. ** All work must cite co-group members (if any) and the source of any code snippets used online. === Grading Rationale === Homework points will only be awarded for correct, working code and correct algorithmic analysis, while the homework problems will become progressively tougher. Undergraduates should be able to pass the course with an A if they have correctly answered most of the homework, and made a strong attempt at one of the projects. Graduate students should both perform well on the homework and successfully complete one or two projects. Essentially, this means you should do your own homework when possible and may do a project in a small group. The re-grading and group options for homework allow making up for missed assignments, and encourage returning to core concepts at a later point in the class. Students who have completed significant portions of the homework have thus demonstrated programming proficiency, and are qualified for at least B/C grades. == Projects == === Midterm === TBA === Final === TBA == Textbooks and Resources == * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-0072-7 Beginning Python, Hetland, 2005] (eBook avail. from USF Library) * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-3238-4 Python Algorithms, Hetland, 2010] (eBook avail. from USF Library) * [http://aosabook.org/en/index.html The Architecture of Open Source Applications] * [http://docs.python.org Python Documentation] * [https://developers.google.com/edu/python/ Google Introductory Python Notes] * [http://huffman.sourceforge.net/tao/tao-of-programming.html Tao of Programming] Other (possibly useful) materials: * [http://hackersdictionary.com/html/entry/larval-stage.html The Jargon File] * Chapters 7&8 of Modelling and Simulation, Birta and Arbez, Springer 2007 (eBook avail. from USF Library). * Chapters 4-6 of Models and Algorithms for Intelligent Data Analysis, Runkler, Springer 2012 (eBook avail. from USF Library). * Guide to Scientific Computing in C++, Francis and Whiteley, Springer, 2012. (eBook avail. from USF Library) * Extra info. On the basics: ** Chapters 3 and 7 of Mathematics in Computing, Regan, Springer 2013. (eBook avail. from USF Library) ** Instant feedback graphical programming with [https://www.khanacademy.org/cs/programming/ Khan Academy] * [http://www.meetup.com/python-178/ Local PyBulls Meetings] Code: * [http://carsonfarmer.com/2013/07/essential-python-geo-libraries Python Libraries Useful for Geospatial Problems] * [[Code#Python_Libraries|Python Libraries Useful for Computational Chemistry]] (very small list at present) Interactive Interpreters: * [http://www.codewars.com CodeWars] Recommended for building experience with practice problems. * [http://exercism.io Exercism] A command-line client with a similar learn-through-challenge philosophy. * [http://repl.it repl.it] A read-eval-print loop for several computer languages. * [http://en.cppreference.com/w/cpp/language CppReference] Documentation with an online evaluator for C++ code. === Notes === * [[Media:intro.pdf|Notes]] for Week 1 ** Over the first two weeks or so, we'll be practicing the basics - so read through Chapters 1-3 of Hetland's Beginning Python during this time. ** [[PythonTranslated|Important Definitions]] * [[Media:Week2.pdf|Notes]] for Week 2 ** [[Code:Oware|Oware code]] ** Solutions for some problems in Week 2's notes: <source lang="python"> # simple data types "a string" # : str x = [1, 2, 3] # : [int] # compound data type (1, "name", (x, x)) # : (int, str, ([int], [int])) # add_one : int -> int # str.__add__ : str -> str -> str # str.split : str -> [str] # str.__mod__ : str -> (Objects) -> str </source> * [[Media:Week3.pdf|Notes]] for Week 3-4 ** Reading assignment - read through Chapter 5 and 6 (and practice dictionaries from Ch. 4) ** [[Code:for_patterns|Abstracting patterns]] in for loops. * [[Media:Week5.pdf|Notes]] for Week 5-6 ** Reading assignment - Read Chapter 10-11 (and refer to Ch. 4) * By this point, we've covered all the basics: ** base types: str, int, float, [a] ** variables and substitution: j vs "4" vs 4 ** indexing and slicing into lists / strings: x[1:4] or x[i:j] ** control flow: if and for syntax ** functions implementing patterns: def next(r, x): return r*x*(1-x) * You should be able to use these for: ** finding and abstracting the pattern ** naming the type of a function ** determining which variable names are in scope * All that's left is learning common uses, patterns and even more syntax! === Homework === * [[CompSciHW1|Homework 1]] is due Monday, January 25. * [[CompSciHW2|Homework 2]] is due Monday, February 8. * [[CompSciHW3|Homework 3]] is due Friday, February 19. cac9730fd66937e0c5cc57852a29f7d5bbe7627a 445 443 2016-02-15T17:33:07Z David M. Rogers 2 wikitext 446 445 2016-02-15T18:55:30Z David M. Rogers 2 /* Group Assignments */ wikitext 448 446 2016-02-16T15:50:43Z David M. Rogers 2 rv - better groups wikitext text/x-wiki '''<BIG>Introduction to Scientific Computing</BIG>''' Course Info * Course Numbers CHM 4932-004/6938-010, CRN: 22347/22348 * Credit Hours: 3 * Meeting Dates: January 22 - April 27, 2016 ** No Class Jan. 18 or Mar. 14-19 * Meeting Times: Mon. and Wed., 12:30-13:45 in SCA 222 ** Lab Session & Office Hours: Fri. 12:30-13:45 in SCA 222 (or SCA 433) == Overview == Mathematical models in the natural sciences take many shapes and forms. The moment they become more complicated than tracking a few variables over time, we have to put away our Excel spreadsheets and make use of a solid foundation in computational science. The course establishes this foundation by introducing data structures and algorithms used in everyday scientific computing using examples in the python scripting language. By the end of the Semester, students will be able to navigate the Linux command-line to go from a mathematical model to a numerical solution. Best practices for working with computer code and visualizing data will also be covered. == Topics == # Languages #* bash (shell) #* python (scripting) #* stack & register-based machine languages: overview of C and Fortran syntax & compiling with gcc, ‘thread safety’ #* Shared libraries & language inter-operability (FFI) # Algorithms #* Horner’s algorithm for polynomials #* Newton’s root finding algo. #* Overview of general optimization algo-s (example: linear & nonlin. least-squares) #* Numerical integration (scripted, plus gnu ODE) #* Communication (how HTTP get/put works) # Data Structures #* Linked Lists #* Trees (file system hierarchies) #* Graphs #* Arrays (dense & sparse) example: vectors & rotations / transpositions, densities and difference operators # Presentation & visualization #* Flat CSV files (and excel) #* Working with binary data #* Python matplotlib (2D images) #* Binning histograms & weighted averages # Best Practices #* High-level code design (modularity, interface specifications, unit testing, etc.) #* Code audit: open-source libraries, ex. Gnu Scientific Library, qsort in libc, Boost #* Source code versioning (example: git or mercurial) #* gdb & execution profiling #* documentation #* Makefiles == Grading == '''Grading Scale (out of 400 points possible)''' {| class="wikitable" |- ! Grade ! Undergraduate ! Graduate |- | A | 230 | 300 |- | B | 180 | 230 |- | C | 150 | 180 |- | D | 120 | 150 |} * Points Possible: ** 10 homework assignments (20 points per homework) ** 2 projects / competitions (100 points per project) * Homework Rules ** For work done in groups, credit is divided equally among participants - so the max homework grade for a group of 2 is 10 points each. ** For each homework, 1 re-do at full credit can be sent at any time after the due date, but must present a unique solution to previous work from yourself or others. ** All work must cite co-group members (if any) and the source of any code snippets used online. === Grading Rationale === Homework points will only be awarded for correct, working code and correct algorithmic analysis, while the homework problems will become progressively tougher. Undergraduates should be able to pass the course with an A if they have correctly answered most of the homework, and made a strong attempt at one of the projects. Graduate students should both perform well on the homework and successfully complete one or two projects. Essentially, this means you should do your own homework when possible and may do a project in a small group. The re-grading and group options for homework allow making up for missed assignments, and encourage returning to core concepts at a later point in the class. Students who have completed significant portions of the homework have thus demonstrated programming proficiency, and are qualified for at least B/C grades. == Projects == === Midterm === TBA === Final === TBA == Textbooks and Resources == * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-0072-7 Beginning Python, Hetland, 2005] (eBook avail. from USF Library) * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-3238-4 Python Algorithms, Hetland, 2010] (eBook avail. from USF Library) * [http://aosabook.org/en/index.html The Architecture of Open Source Applications] * [http://docs.python.org Python Documentation] * [https://developers.google.com/edu/python/ Google Introductory Python Notes] * [http://huffman.sourceforge.net/tao/tao-of-programming.html Tao of Programming] Other (possibly useful) materials: * [http://hackersdictionary.com/html/entry/larval-stage.html The Jargon File] * Chapters 7&8 of Modelling and Simulation, Birta and Arbez, Springer 2007 (eBook avail. from USF Library). * Chapters 4-6 of Models and Algorithms for Intelligent Data Analysis, Runkler, Springer 2012 (eBook avail. from USF Library). * Guide to Scientific Computing in C++, Francis and Whiteley, Springer, 2012. (eBook avail. from USF Library) * Extra info. On the basics: ** Chapters 3 and 7 of Mathematics in Computing, Regan, Springer 2013. (eBook avail. from USF Library) ** Instant feedback graphical programming with [https://www.khanacademy.org/cs/programming/ Khan Academy] * [http://www.meetup.com/python-178/ Local PyBulls Meetings] Code: * [http://carsonfarmer.com/2013/07/essential-python-geo-libraries Python Libraries Useful for Geospatial Problems] * [[Code#Python_Libraries|Python Libraries Useful for Computational Chemistry]] (very small list at present) Interactive Interpreters: * [http://www.codewars.com CodeWars] Recommended for building experience with practice problems. * [http://exercism.io Exercism] A command-line client with a similar learn-through-challenge philosophy. * [http://repl.it repl.it] A read-eval-print loop for several computer languages. * [http://en.cppreference.com/w/cpp/language CppReference] Documentation with an online evaluator for C++ code. === Notes === * [[Media:intro.pdf|Notes]] for Week 1 ** Over the first two weeks or so, we'll be practicing the basics - so read through Chapters 1-3 of Hetland's Beginning Python during this time. ** [[PythonTranslated|Important Definitions]] * [[Media:Week2.pdf|Notes]] for Week 2 ** [[Code:Oware|Oware code]] ** Solutions for some problems in Week 2's notes: <source lang="python"> # simple data types "a string" # : str x = [1, 2, 3] # : [int] # compound data type (1, "name", (x, x)) # : (int, str, ([int], [int])) # add_one : int -> int # str.__add__ : str -> str -> str # str.split : str -> [str] # str.__mod__ : str -> (Objects) -> str </source> * [[Media:Week3.pdf|Notes]] for Week 3-4 ** Reading assignment - read through Chapter 5 and 6 (and practice dictionaries from Ch. 4) ** [[Code:for_patterns|Abstracting patterns]] in for loops. * [[Media:Week5.pdf|Notes]] for Week 5-6 ** Reading assignment - Read Chapter 10-11 (and refer to Ch. 4) * By this point, we've covered all the basics: ** base types: str, int, float, [a] ** variables and substitution: j vs "4" vs 4 ** indexing and slicing into lists / strings: x[1:4] or x[i:j] ** control flow: if and for syntax ** functions implementing patterns: def next(r, x): return r*x*(1-x) * You should be able to use these for: ** finding and abstracting the pattern ** naming the type of a function ** determining which variable names are in scope * All that's left is learning common uses, patterns and even more syntax! === Homework === * [[CompSciHW1|Homework 1]] is due Monday, January 25. * [[CompSciHW2|Homework 2]] is due Monday, February 8. * [[CompSciHW3|Homework 3]] is due Friday, February 19. == Group Work Pages == Group 1 [https://docs.google.com/document/d/1k6vruCx78aV0pL8Kw7WWtsw_-6zgdoeP0OvujSzbsh0/edit?usp=sharing]: Group 2 [https://docs.google.com/document/d/1MgpVly2D1h9Xt_lFh5ywa3b70Ul9ES6OQZtg5l_n0NM/edit?usp=sharing] Group 3 [https://docs.google.com/document/d/1LT_J-vObN9tPa1JoQ1B_h04ENsL5Ko2xeFeRMp-99f8/edit?usp=sharing] Group 4 [https://docs.google.com/document/d/1hGlNlg1w7_3qCo6LE-y9rSZx1Chwc0FBUoxK6cyzWW8/edit?usp=sharing] Substitution problem notes: <pre> Requirements: 1. Python object representing a spreadsheet 2. Ability to show the whole sheet (formulas) 3. Ability to compute the whole sheet (values) 4. Ability to update formula stored in a cell Cells: Example Cell Content: "A1 - B2*C2" A B C 1 A1 B1 C1 2 A2 B2 C2 3 A3 B3 C3 Hint 1: use str.replace : str -> str -> str -> str * fixed replacement order: A1, B1, C1, A2, B2, C2, ... "A1 - B2*C2".replace("A1", "5") Hint 2: use eval : str -> Object eval("5*3 - 4") vals = ["3", "4", "5", "A1", "A1 - 2*A2", "5", "", "", ""] vals = {"" : "3", } #? Hint 3: OK to print the easy way -- A1 = 5 + 2 A2 = A1*4 A3 = A1 - A2 Hint 4: Compute values in a separate sheet object. formulas -> values -- values["A1"] = formulas["A1"] values["B1"] = formulas["B1"].replace("A1", values["A1"]) values["C1"] = formulas["C1"].replace("B1", values["B1"]) values["C1"] = values["C1"].replace("A1", values["A1"]) values["A2"] = formulas["A2"] values["A2"] = values["A2"].replace("C1", values["C1"]) values["A2"] = values["A2"].replace("B1", values["B1"]) values["A2"] = values["A2"].replace("A1", values["A1"]) # Build the value of B2 from its formula. values["B2"] = formulas["B2"] values["B2"] = values["B2"].replace("A2", values["A2"]) values["B2"] = values["B2"].replace("C1", values["C1"]) values["B2"] = values["B2"].replace("B1", values["B1"]) values["B2"] = values["B2"].replace("A1", values["A1"]) </pre> 77830fd0e77281b6c85168db7fdb4adab8a9dc68 450 448 2016-02-17T17:17:26Z David M. Rogers 2 /* Midterm */ wikitext text/x-wiki '''<BIG>Introduction to Scientific Computing</BIG>''' Course Info * Course Numbers CHM 4932-004/6938-010, CRN: 22347/22348 * Credit Hours: 3 * Meeting Dates: January 22 - April 27, 2016 ** No Class Jan. 18 or Mar. 14-19 * Meeting Times: Mon. and Wed., 12:30-13:45 in SCA 222 ** Lab Session & Office Hours: Fri. 12:30-13:45 in SCA 222 (or SCA 433) == Overview == Mathematical models in the natural sciences take many shapes and forms. The moment they become more complicated than tracking a few variables over time, we have to put away our Excel spreadsheets and make use of a solid foundation in computational science. The course establishes this foundation by introducing data structures and algorithms used in everyday scientific computing using examples in the python scripting language. By the end of the Semester, students will be able to navigate the Linux command-line to go from a mathematical model to a numerical solution. Best practices for working with computer code and visualizing data will also be covered. == Topics == # Languages #* bash (shell) #* python (scripting) #* stack & register-based machine languages: overview of C and Fortran syntax & compiling with gcc, ‘thread safety’ #* Shared libraries & language inter-operability (FFI) # Algorithms #* Horner’s algorithm for polynomials #* Newton’s root finding algo. #* Overview of general optimization algo-s (example: linear & nonlin. least-squares) #* Numerical integration (scripted, plus gnu ODE) #* Communication (how HTTP get/put works) # Data Structures #* Linked Lists #* Trees (file system hierarchies) #* Graphs #* Arrays (dense & sparse) example: vectors & rotations / transpositions, densities and difference operators # Presentation & visualization #* Flat CSV files (and excel) #* Working with binary data #* Python matplotlib (2D images) #* Binning histograms & weighted averages # Best Practices #* High-level code design (modularity, interface specifications, unit testing, etc.) #* Code audit: open-source libraries, ex. Gnu Scientific Library, qsort in libc, Boost #* Source code versioning (example: git or mercurial) #* gdb & execution profiling #* documentation #* Makefiles == Grading == '''Grading Scale (out of 400 points possible)''' {| class="wikitable" |- ! Grade ! Undergraduate ! Graduate |- | A | 230 | 300 |- | B | 180 | 230 |- | C | 150 | 180 |- | D | 120 | 150 |} * Points Possible: ** 10 homework assignments (20 points per homework) ** 2 projects / competitions (100 points per project) * Homework Rules ** For work done in groups, credit is divided equally among participants - so the max homework grade for a group of 2 is 10 points each. ** For each homework, 1 re-do at full credit can be sent at any time after the due date, but must present a unique solution to previous work from yourself or others. ** All work must cite co-group members (if any) and the source of any code snippets used online. === Grading Rationale === Homework points will only be awarded for correct, working code and correct algorithmic analysis, while the homework problems will become progressively tougher. Undergraduates should be able to pass the course with an A if they have correctly answered most of the homework, and made a strong attempt at one of the projects. Graduate students should both perform well on the homework and successfully complete one or two projects. Essentially, this means you should do your own homework when possible and may do a project in a small group. The re-grading and group options for homework allow making up for missed assignments, and encourage returning to core concepts at a later point in the class. Students who have completed significant portions of the homework have thus demonstrated programming proficiency, and are qualified for at least B/C grades. == Projects == === Midterm === A description for the midterm project is now available [[File:midterm.pdf|here]]. The MD section will be updated as we discuss it in class. The due date for the midterm will be Friday, March 11. === Final === TBA == Textbooks and Resources == * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-0072-7 Beginning Python, Hetland, 2005] (eBook avail. from USF Library) * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-3238-4 Python Algorithms, Hetland, 2010] (eBook avail. from USF Library) * [http://aosabook.org/en/index.html The Architecture of Open Source Applications] * [http://docs.python.org Python Documentation] * [https://developers.google.com/edu/python/ Google Introductory Python Notes] * [http://huffman.sourceforge.net/tao/tao-of-programming.html Tao of Programming] Other (possibly useful) materials: * [http://hackersdictionary.com/html/entry/larval-stage.html The Jargon File] * Chapters 7&8 of Modelling and Simulation, Birta and Arbez, Springer 2007 (eBook avail. from USF Library). * Chapters 4-6 of Models and Algorithms for Intelligent Data Analysis, Runkler, Springer 2012 (eBook avail. from USF Library). * Guide to Scientific Computing in C++, Francis and Whiteley, Springer, 2012. (eBook avail. from USF Library) * Extra info. On the basics: ** Chapters 3 and 7 of Mathematics in Computing, Regan, Springer 2013. (eBook avail. from USF Library) ** Instant feedback graphical programming with [https://www.khanacademy.org/cs/programming/ Khan Academy] * [http://www.meetup.com/python-178/ Local PyBulls Meetings] Code: * [http://carsonfarmer.com/2013/07/essential-python-geo-libraries Python Libraries Useful for Geospatial Problems] * [[Code#Python_Libraries|Python Libraries Useful for Computational Chemistry]] (very small list at present) Interactive Interpreters: * [http://www.codewars.com CodeWars] Recommended for building experience with practice problems. * [http://exercism.io Exercism] A command-line client with a similar learn-through-challenge philosophy. * [http://repl.it repl.it] A read-eval-print loop for several computer languages. * [http://en.cppreference.com/w/cpp/language CppReference] Documentation with an online evaluator for C++ code. === Notes === * [[Media:intro.pdf|Notes]] for Week 1 ** Over the first two weeks or so, we'll be practicing the basics - so read through Chapters 1-3 of Hetland's Beginning Python during this time. ** [[PythonTranslated|Important Definitions]] * [[Media:Week2.pdf|Notes]] for Week 2 ** [[Code:Oware|Oware code]] ** Solutions for some problems in Week 2's notes: <source lang="python"> # simple data types "a string" # : str x = [1, 2, 3] # : [int] # compound data type (1, "name", (x, x)) # : (int, str, ([int], [int])) # add_one : int -> int # str.__add__ : str -> str -> str # str.split : str -> [str] # str.__mod__ : str -> (Objects) -> str </source> * [[Media:Week3.pdf|Notes]] for Week 3-4 ** Reading assignment - read through Chapter 5 and 6 (and practice dictionaries from Ch. 4) ** [[Code:for_patterns|Abstracting patterns]] in for loops. * [[Media:Week5.pdf|Notes]] for Week 5-6 ** Reading assignment - Read Chapter 10-11 (and refer to Ch. 4) * By this point, we've covered all the basics: ** base types: str, int, float, [a] ** variables and substitution: j vs "4" vs 4 ** indexing and slicing into lists / strings: x[1:4] or x[i:j] ** control flow: if and for syntax ** functions implementing patterns: def next(r, x): return r*x*(1-x) * You should be able to use these for: ** finding and abstracting the pattern ** naming the type of a function ** determining which variable names are in scope * All that's left is learning common uses, patterns and even more syntax! === Homework === * [[CompSciHW1|Homework 1]] is due Monday, January 25. * [[CompSciHW2|Homework 2]] is due Monday, February 8. * [[CompSciHW3|Homework 3]] is due Friday, February 19. == Group Work Pages == Group 1 [https://docs.google.com/document/d/1k6vruCx78aV0pL8Kw7WWtsw_-6zgdoeP0OvujSzbsh0/edit?usp=sharing]: Group 2 [https://docs.google.com/document/d/1MgpVly2D1h9Xt_lFh5ywa3b70Ul9ES6OQZtg5l_n0NM/edit?usp=sharing] Group 3 [https://docs.google.com/document/d/1LT_J-vObN9tPa1JoQ1B_h04ENsL5Ko2xeFeRMp-99f8/edit?usp=sharing] Group 4 [https://docs.google.com/document/d/1hGlNlg1w7_3qCo6LE-y9rSZx1Chwc0FBUoxK6cyzWW8/edit?usp=sharing] Substitution problem notes: <pre> Requirements: 1. Python object representing a spreadsheet 2. Ability to show the whole sheet (formulas) 3. Ability to compute the whole sheet (values) 4. Ability to update formula stored in a cell Cells: Example Cell Content: "A1 - B2*C2" A B C 1 A1 B1 C1 2 A2 B2 C2 3 A3 B3 C3 Hint 1: use str.replace : str -> str -> str -> str * fixed replacement order: A1, B1, C1, A2, B2, C2, ... "A1 - B2*C2".replace("A1", "5") Hint 2: use eval : str -> Object eval("5*3 - 4") vals = ["3", "4", "5", "A1", "A1 - 2*A2", "5", "", "", ""] vals = {"" : "3", } #? Hint 3: OK to print the easy way -- A1 = 5 + 2 A2 = A1*4 A3 = A1 - A2 Hint 4: Compute values in a separate sheet object. formulas -> values -- values["A1"] = formulas["A1"] values["B1"] = formulas["B1"].replace("A1", values["A1"]) values["C1"] = formulas["C1"].replace("B1", values["B1"]) values["C1"] = values["C1"].replace("A1", values["A1"]) values["A2"] = formulas["A2"] values["A2"] = values["A2"].replace("C1", values["C1"]) values["A2"] = values["A2"].replace("B1", values["B1"]) values["A2"] = values["A2"].replace("A1", values["A1"]) # Build the value of B2 from its formula. values["B2"] = formulas["B2"] values["B2"] = values["B2"].replace("A2", values["A2"]) values["B2"] = values["B2"].replace("C1", values["C1"]) values["B2"] = values["B2"].replace("B1", values["B1"]) values["B2"] = values["B2"].replace("A1", values["A1"]) </pre> 6a7244b2386d5a60f4d8ab9b891d3687b19760fe 451 450 2016-02-17T17:18:00Z David M. Rogers 2 /* Midterm */ wikitext text/x-wiki '''<BIG>Introduction to Scientific Computing</BIG>''' Course Info * Course Numbers CHM 4932-004/6938-010, CRN: 22347/22348 * Credit Hours: 3 * Meeting Dates: January 22 - April 27, 2016 ** No Class Jan. 18 or Mar. 14-19 * Meeting Times: Mon. and Wed., 12:30-13:45 in SCA 222 ** Lab Session & Office Hours: Fri. 12:30-13:45 in SCA 222 (or SCA 433) == Overview == Mathematical models in the natural sciences take many shapes and forms. The moment they become more complicated than tracking a few variables over time, we have to put away our Excel spreadsheets and make use of a solid foundation in computational science. The course establishes this foundation by introducing data structures and algorithms used in everyday scientific computing using examples in the python scripting language. By the end of the Semester, students will be able to navigate the Linux command-line to go from a mathematical model to a numerical solution. Best practices for working with computer code and visualizing data will also be covered. == Topics == # Languages #* bash (shell) #* python (scripting) #* stack & register-based machine languages: overview of C and Fortran syntax & compiling with gcc, ‘thread safety’ #* Shared libraries & language inter-operability (FFI) # Algorithms #* Horner’s algorithm for polynomials #* Newton’s root finding algo. #* Overview of general optimization algo-s (example: linear & nonlin. least-squares) #* Numerical integration (scripted, plus gnu ODE) #* Communication (how HTTP get/put works) # Data Structures #* Linked Lists #* Trees (file system hierarchies) #* Graphs #* Arrays (dense & sparse) example: vectors & rotations / transpositions, densities and difference operators # Presentation & visualization #* Flat CSV files (and excel) #* Working with binary data #* Python matplotlib (2D images) #* Binning histograms & weighted averages # Best Practices #* High-level code design (modularity, interface specifications, unit testing, etc.) #* Code audit: open-source libraries, ex. Gnu Scientific Library, qsort in libc, Boost #* Source code versioning (example: git or mercurial) #* gdb & execution profiling #* documentation #* Makefiles == Grading == '''Grading Scale (out of 400 points possible)''' {| class="wikitable" |- ! Grade ! Undergraduate ! Graduate |- | A | 230 | 300 |- | B | 180 | 230 |- | C | 150 | 180 |- | D | 120 | 150 |} * Points Possible: ** 10 homework assignments (20 points per homework) ** 2 projects / competitions (100 points per project) * Homework Rules ** For work done in groups, credit is divided equally among participants - so the max homework grade for a group of 2 is 10 points each. ** For each homework, 1 re-do at full credit can be sent at any time after the due date, but must present a unique solution to previous work from yourself or others. ** All work must cite co-group members (if any) and the source of any code snippets used online. === Grading Rationale === Homework points will only be awarded for correct, working code and correct algorithmic analysis, while the homework problems will become progressively tougher. Undergraduates should be able to pass the course with an A if they have correctly answered most of the homework, and made a strong attempt at one of the projects. Graduate students should both perform well on the homework and successfully complete one or two projects. Essentially, this means you should do your own homework when possible and may do a project in a small group. The re-grading and group options for homework allow making up for missed assignments, and encourage returning to core concepts at a later point in the class. Students who have completed significant portions of the homework have thus demonstrated programming proficiency, and are qualified for at least B/C grades. == Projects == === Midterm === A description for the midterm project is now available [[Media:midterm.pdf|here]]. The MD section will be updated as we discuss it in class. The due date for the midterm will be Friday, March 11. === Final === TBA == Textbooks and Resources == * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-0072-7 Beginning Python, Hetland, 2005] (eBook avail. from USF Library) * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-3238-4 Python Algorithms, Hetland, 2010] (eBook avail. from USF Library) * [http://aosabook.org/en/index.html The Architecture of Open Source Applications] * [http://docs.python.org Python Documentation] * [https://developers.google.com/edu/python/ Google Introductory Python Notes] * [http://huffman.sourceforge.net/tao/tao-of-programming.html Tao of Programming] Other (possibly useful) materials: * [http://hackersdictionary.com/html/entry/larval-stage.html The Jargon File] * Chapters 7&8 of Modelling and Simulation, Birta and Arbez, Springer 2007 (eBook avail. from USF Library). * Chapters 4-6 of Models and Algorithms for Intelligent Data Analysis, Runkler, Springer 2012 (eBook avail. from USF Library). * Guide to Scientific Computing in C++, Francis and Whiteley, Springer, 2012. (eBook avail. from USF Library) * Extra info. On the basics: ** Chapters 3 and 7 of Mathematics in Computing, Regan, Springer 2013. (eBook avail. from USF Library) ** Instant feedback graphical programming with [https://www.khanacademy.org/cs/programming/ Khan Academy] * [http://www.meetup.com/python-178/ Local PyBulls Meetings] Code: * [http://carsonfarmer.com/2013/07/essential-python-geo-libraries Python Libraries Useful for Geospatial Problems] * [[Code#Python_Libraries|Python Libraries Useful for Computational Chemistry]] (very small list at present) Interactive Interpreters: * [http://www.codewars.com CodeWars] Recommended for building experience with practice problems. * [http://exercism.io Exercism] A command-line client with a similar learn-through-challenge philosophy. * [http://repl.it repl.it] A read-eval-print loop for several computer languages. * [http://en.cppreference.com/w/cpp/language CppReference] Documentation with an online evaluator for C++ code. === Notes === * [[Media:intro.pdf|Notes]] for Week 1 ** Over the first two weeks or so, we'll be practicing the basics - so read through Chapters 1-3 of Hetland's Beginning Python during this time. ** [[PythonTranslated|Important Definitions]] * [[Media:Week2.pdf|Notes]] for Week 2 ** [[Code:Oware|Oware code]] ** Solutions for some problems in Week 2's notes: <source lang="python"> # simple data types "a string" # : str x = [1, 2, 3] # : [int] # compound data type (1, "name", (x, x)) # : (int, str, ([int], [int])) # add_one : int -> int # str.__add__ : str -> str -> str # str.split : str -> [str] # str.__mod__ : str -> (Objects) -> str </source> * [[Media:Week3.pdf|Notes]] for Week 3-4 ** Reading assignment - read through Chapter 5 and 6 (and practice dictionaries from Ch. 4) ** [[Code:for_patterns|Abstracting patterns]] in for loops. * [[Media:Week5.pdf|Notes]] for Week 5-6 ** Reading assignment - Read Chapter 10-11 (and refer to Ch. 4) * By this point, we've covered all the basics: ** base types: str, int, float, [a] ** variables and substitution: j vs "4" vs 4 ** indexing and slicing into lists / strings: x[1:4] or x[i:j] ** control flow: if and for syntax ** functions implementing patterns: def next(r, x): return r*x*(1-x) * You should be able to use these for: ** finding and abstracting the pattern ** naming the type of a function ** determining which variable names are in scope * All that's left is learning common uses, patterns and even more syntax! === Homework === * [[CompSciHW1|Homework 1]] is due Monday, January 25. * [[CompSciHW2|Homework 2]] is due Monday, February 8. * [[CompSciHW3|Homework 3]] is due Friday, February 19. == Group Work Pages == Group 1 [https://docs.google.com/document/d/1k6vruCx78aV0pL8Kw7WWtsw_-6zgdoeP0OvujSzbsh0/edit?usp=sharing]: Group 2 [https://docs.google.com/document/d/1MgpVly2D1h9Xt_lFh5ywa3b70Ul9ES6OQZtg5l_n0NM/edit?usp=sharing] Group 3 [https://docs.google.com/document/d/1LT_J-vObN9tPa1JoQ1B_h04ENsL5Ko2xeFeRMp-99f8/edit?usp=sharing] Group 4 [https://docs.google.com/document/d/1hGlNlg1w7_3qCo6LE-y9rSZx1Chwc0FBUoxK6cyzWW8/edit?usp=sharing] Substitution problem notes: <pre> Requirements: 1. Python object representing a spreadsheet 2. Ability to show the whole sheet (formulas) 3. Ability to compute the whole sheet (values) 4. Ability to update formula stored in a cell Cells: Example Cell Content: "A1 - B2*C2" A B C 1 A1 B1 C1 2 A2 B2 C2 3 A3 B3 C3 Hint 1: use str.replace : str -> str -> str -> str * fixed replacement order: A1, B1, C1, A2, B2, C2, ... "A1 - B2*C2".replace("A1", "5") Hint 2: use eval : str -> Object eval("5*3 - 4") vals = ["3", "4", "5", "A1", "A1 - 2*A2", "5", "", "", ""] vals = {"" : "3", } #? Hint 3: OK to print the easy way -- A1 = 5 + 2 A2 = A1*4 A3 = A1 - A2 Hint 4: Compute values in a separate sheet object. formulas -> values -- values["A1"] = formulas["A1"] values["B1"] = formulas["B1"].replace("A1", values["A1"]) values["C1"] = formulas["C1"].replace("B1", values["B1"]) values["C1"] = values["C1"].replace("A1", values["A1"]) values["A2"] = formulas["A2"] values["A2"] = values["A2"].replace("C1", values["C1"]) values["A2"] = values["A2"].replace("B1", values["B1"]) values["A2"] = values["A2"].replace("A1", values["A1"]) # Build the value of B2 from its formula. values["B2"] = formulas["B2"] values["B2"] = values["B2"].replace("A2", values["A2"]) values["B2"] = values["B2"].replace("C1", values["C1"]) values["B2"] = values["B2"].replace("B1", values["B1"]) values["B2"] = values["B2"].replace("A1", values["A1"]) </pre> 70674f098f4eb156fae96639101d7d042d845c8d 452 451 2016-02-19T18:53:13Z David M. Rogers 2 /* Homework */ wikitext text/x-wiki '''<BIG>Introduction to Scientific Computing</BIG>''' Course Info * Course Numbers CHM 4932-004/6938-010, CRN: 22347/22348 * Credit Hours: 3 * Meeting Dates: January 22 - April 27, 2016 ** No Class Jan. 18 or Mar. 14-19 * Meeting Times: Mon. and Wed., 12:30-13:45 in SCA 222 ** Lab Session & Office Hours: Fri. 12:30-13:45 in SCA 222 (or SCA 433) == Overview == Mathematical models in the natural sciences take many shapes and forms. The moment they become more complicated than tracking a few variables over time, we have to put away our Excel spreadsheets and make use of a solid foundation in computational science. The course establishes this foundation by introducing data structures and algorithms used in everyday scientific computing using examples in the python scripting language. By the end of the Semester, students will be able to navigate the Linux command-line to go from a mathematical model to a numerical solution. Best practices for working with computer code and visualizing data will also be covered. == Topics == # Languages #* bash (shell) #* python (scripting) #* stack & register-based machine languages: overview of C and Fortran syntax & compiling with gcc, ‘thread safety’ #* Shared libraries & language inter-operability (FFI) # Algorithms #* Horner’s algorithm for polynomials #* Newton’s root finding algo. #* Overview of general optimization algo-s (example: linear & nonlin. least-squares) #* Numerical integration (scripted, plus gnu ODE) #* Communication (how HTTP get/put works) # Data Structures #* Linked Lists #* Trees (file system hierarchies) #* Graphs #* Arrays (dense & sparse) example: vectors & rotations / transpositions, densities and difference operators # Presentation & visualization #* Flat CSV files (and excel) #* Working with binary data #* Python matplotlib (2D images) #* Binning histograms & weighted averages # Best Practices #* High-level code design (modularity, interface specifications, unit testing, etc.) #* Code audit: open-source libraries, ex. Gnu Scientific Library, qsort in libc, Boost #* Source code versioning (example: git or mercurial) #* gdb & execution profiling #* documentation #* Makefiles == Grading == '''Grading Scale (out of 400 points possible)''' {| class="wikitable" |- ! Grade ! Undergraduate ! Graduate |- | A | 230 | 300 |- | B | 180 | 230 |- | C | 150 | 180 |- | D | 120 | 150 |} * Points Possible: ** 10 homework assignments (20 points per homework) ** 2 projects / competitions (100 points per project) * Homework Rules ** For work done in groups, credit is divided equally among participants - so the max homework grade for a group of 2 is 10 points each. ** For each homework, 1 re-do at full credit can be sent at any time after the due date, but must present a unique solution to previous work from yourself or others. ** All work must cite co-group members (if any) and the source of any code snippets used online. === Grading Rationale === Homework points will only be awarded for correct, working code and correct algorithmic analysis, while the homework problems will become progressively tougher. Undergraduates should be able to pass the course with an A if they have correctly answered most of the homework, and made a strong attempt at one of the projects. Graduate students should both perform well on the homework and successfully complete one or two projects. Essentially, this means you should do your own homework when possible and may do a project in a small group. The re-grading and group options for homework allow making up for missed assignments, and encourage returning to core concepts at a later point in the class. Students who have completed significant portions of the homework have thus demonstrated programming proficiency, and are qualified for at least B/C grades. == Projects == === Midterm === A description for the midterm project is now available [[Media:midterm.pdf|here]]. The MD section will be updated as we discuss it in class. The due date for the midterm will be Friday, March 11. === Final === TBA == Textbooks and Resources == * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-0072-7 Beginning Python, Hetland, 2005] (eBook avail. from USF Library) * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-3238-4 Python Algorithms, Hetland, 2010] (eBook avail. from USF Library) * [http://aosabook.org/en/index.html The Architecture of Open Source Applications] * [http://docs.python.org Python Documentation] * [https://developers.google.com/edu/python/ Google Introductory Python Notes] * [http://huffman.sourceforge.net/tao/tao-of-programming.html Tao of Programming] Other (possibly useful) materials: * [http://hackersdictionary.com/html/entry/larval-stage.html The Jargon File] * Chapters 7&8 of Modelling and Simulation, Birta and Arbez, Springer 2007 (eBook avail. from USF Library). * Chapters 4-6 of Models and Algorithms for Intelligent Data Analysis, Runkler, Springer 2012 (eBook avail. from USF Library). * Guide to Scientific Computing in C++, Francis and Whiteley, Springer, 2012. (eBook avail. from USF Library) * Extra info. On the basics: ** Chapters 3 and 7 of Mathematics in Computing, Regan, Springer 2013. (eBook avail. from USF Library) ** Instant feedback graphical programming with [https://www.khanacademy.org/cs/programming/ Khan Academy] * [http://www.meetup.com/python-178/ Local PyBulls Meetings] Code: * [http://carsonfarmer.com/2013/07/essential-python-geo-libraries Python Libraries Useful for Geospatial Problems] * [[Code#Python_Libraries|Python Libraries Useful for Computational Chemistry]] (very small list at present) Interactive Interpreters: * [http://www.codewars.com CodeWars] Recommended for building experience with practice problems. * [http://exercism.io Exercism] A command-line client with a similar learn-through-challenge philosophy. * [http://repl.it repl.it] A read-eval-print loop for several computer languages. * [http://en.cppreference.com/w/cpp/language CppReference] Documentation with an online evaluator for C++ code. === Notes === * [[Media:intro.pdf|Notes]] for Week 1 ** Over the first two weeks or so, we'll be practicing the basics - so read through Chapters 1-3 of Hetland's Beginning Python during this time. ** [[PythonTranslated|Important Definitions]] * [[Media:Week2.pdf|Notes]] for Week 2 ** [[Code:Oware|Oware code]] ** Solutions for some problems in Week 2's notes: <source lang="python"> # simple data types "a string" # : str x = [1, 2, 3] # : [int] # compound data type (1, "name", (x, x)) # : (int, str, ([int], [int])) # add_one : int -> int # str.__add__ : str -> str -> str # str.split : str -> [str] # str.__mod__ : str -> (Objects) -> str </source> * [[Media:Week3.pdf|Notes]] for Week 3-4 ** Reading assignment - read through Chapter 5 and 6 (and practice dictionaries from Ch. 4) ** [[Code:for_patterns|Abstracting patterns]] in for loops. * [[Media:Week5.pdf|Notes]] for Week 5-6 ** Reading assignment - Read Chapter 10-11 (and refer to Ch. 4) * By this point, we've covered all the basics: ** base types: str, int, float, [a] ** variables and substitution: j vs "4" vs 4 ** indexing and slicing into lists / strings: x[1:4] or x[i:j] ** control flow: if and for syntax ** functions implementing patterns: def next(r, x): return r*x*(1-x) * You should be able to use these for: ** finding and abstracting the pattern ** naming the type of a function ** determining which variable names are in scope * All that's left is learning common uses, patterns and even more syntax! === Homework === * [[CompSciHW1|Homework 1]] is due Monday, January 25. * [[CompSciHW2|Homework 2]] is due Monday, February 8. * [[CompSciHW3|Homework 3]] is due Friday, February 19. * [[CompSciHW4|Homeowork 4]] is due Friday, February 26. * [[CompSciHW5|Homework 5]] is due Friday, March 4. == Group Work Pages == Group 1 [https://docs.google.com/document/d/1k6vruCx78aV0pL8Kw7WWtsw_-6zgdoeP0OvujSzbsh0/edit?usp=sharing]: Group 2 [https://docs.google.com/document/d/1MgpVly2D1h9Xt_lFh5ywa3b70Ul9ES6OQZtg5l_n0NM/edit?usp=sharing] Group 3 [https://docs.google.com/document/d/1LT_J-vObN9tPa1JoQ1B_h04ENsL5Ko2xeFeRMp-99f8/edit?usp=sharing] Group 4 [https://docs.google.com/document/d/1hGlNlg1w7_3qCo6LE-y9rSZx1Chwc0FBUoxK6cyzWW8/edit?usp=sharing] Substitution problem notes: <pre> Requirements: 1. Python object representing a spreadsheet 2. Ability to show the whole sheet (formulas) 3. Ability to compute the whole sheet (values) 4. Ability to update formula stored in a cell Cells: Example Cell Content: "A1 - B2*C2" A B C 1 A1 B1 C1 2 A2 B2 C2 3 A3 B3 C3 Hint 1: use str.replace : str -> str -> str -> str * fixed replacement order: A1, B1, C1, A2, B2, C2, ... "A1 - B2*C2".replace("A1", "5") Hint 2: use eval : str -> Object eval("5*3 - 4") vals = ["3", "4", "5", "A1", "A1 - 2*A2", "5", "", "", ""] vals = {"" : "3", } #? Hint 3: OK to print the easy way -- A1 = 5 + 2 A2 = A1*4 A3 = A1 - A2 Hint 4: Compute values in a separate sheet object. formulas -> values -- values["A1"] = formulas["A1"] values["B1"] = formulas["B1"].replace("A1", values["A1"]) values["C1"] = formulas["C1"].replace("B1", values["B1"]) values["C1"] = values["C1"].replace("A1", values["A1"]) values["A2"] = formulas["A2"] values["A2"] = values["A2"].replace("C1", values["C1"]) values["A2"] = values["A2"].replace("B1", values["B1"]) values["A2"] = values["A2"].replace("A1", values["A1"]) # Build the value of B2 from its formula. values["B2"] = formulas["B2"] values["B2"] = values["B2"].replace("A2", values["A2"]) values["B2"] = values["B2"].replace("C1", values["C1"]) values["B2"] = values["B2"].replace("B1", values["B1"]) values["B2"] = values["B2"].replace("A1", values["A1"]) </pre> 17410079c377d594f9333675283487d05c8413e1 453 452 2016-02-19T18:53:24Z David M. Rogers 2 /* Homework */ wikitext text/x-wiki '''<BIG>Introduction to Scientific Computing</BIG>''' Course Info * Course Numbers CHM 4932-004/6938-010, CRN: 22347/22348 * Credit Hours: 3 * Meeting Dates: January 22 - April 27, 2016 ** No Class Jan. 18 or Mar. 14-19 * Meeting Times: Mon. and Wed., 12:30-13:45 in SCA 222 ** Lab Session & Office Hours: Fri. 12:30-13:45 in SCA 222 (or SCA 433) == Overview == Mathematical models in the natural sciences take many shapes and forms. The moment they become more complicated than tracking a few variables over time, we have to put away our Excel spreadsheets and make use of a solid foundation in computational science. The course establishes this foundation by introducing data structures and algorithms used in everyday scientific computing using examples in the python scripting language. By the end of the Semester, students will be able to navigate the Linux command-line to go from a mathematical model to a numerical solution. Best practices for working with computer code and visualizing data will also be covered. == Topics == # Languages #* bash (shell) #* python (scripting) #* stack & register-based machine languages: overview of C and Fortran syntax & compiling with gcc, ‘thread safety’ #* Shared libraries & language inter-operability (FFI) # Algorithms #* Horner’s algorithm for polynomials #* Newton’s root finding algo. #* Overview of general optimization algo-s (example: linear & nonlin. least-squares) #* Numerical integration (scripted, plus gnu ODE) #* Communication (how HTTP get/put works) # Data Structures #* Linked Lists #* Trees (file system hierarchies) #* Graphs #* Arrays (dense & sparse) example: vectors & rotations / transpositions, densities and difference operators # Presentation & visualization #* Flat CSV files (and excel) #* Working with binary data #* Python matplotlib (2D images) #* Binning histograms & weighted averages # Best Practices #* High-level code design (modularity, interface specifications, unit testing, etc.) #* Code audit: open-source libraries, ex. Gnu Scientific Library, qsort in libc, Boost #* Source code versioning (example: git or mercurial) #* gdb & execution profiling #* documentation #* Makefiles == Grading == '''Grading Scale (out of 400 points possible)''' {| class="wikitable" |- ! Grade ! Undergraduate ! Graduate |- | A | 230 | 300 |- | B | 180 | 230 |- | C | 150 | 180 |- | D | 120 | 150 |} * Points Possible: ** 10 homework assignments (20 points per homework) ** 2 projects / competitions (100 points per project) * Homework Rules ** For work done in groups, credit is divided equally among participants - so the max homework grade for a group of 2 is 10 points each. ** For each homework, 1 re-do at full credit can be sent at any time after the due date, but must present a unique solution to previous work from yourself or others. ** All work must cite co-group members (if any) and the source of any code snippets used online. === Grading Rationale === Homework points will only be awarded for correct, working code and correct algorithmic analysis, while the homework problems will become progressively tougher. Undergraduates should be able to pass the course with an A if they have correctly answered most of the homework, and made a strong attempt at one of the projects. Graduate students should both perform well on the homework and successfully complete one or two projects. Essentially, this means you should do your own homework when possible and may do a project in a small group. The re-grading and group options for homework allow making up for missed assignments, and encourage returning to core concepts at a later point in the class. Students who have completed significant portions of the homework have thus demonstrated programming proficiency, and are qualified for at least B/C grades. == Projects == === Midterm === A description for the midterm project is now available [[Media:midterm.pdf|here]]. The MD section will be updated as we discuss it in class. The due date for the midterm will be Friday, March 11. === Final === TBA == Textbooks and Resources == * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-0072-7 Beginning Python, Hetland, 2005] (eBook avail. from USF Library) * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-3238-4 Python Algorithms, Hetland, 2010] (eBook avail. from USF Library) * [http://aosabook.org/en/index.html The Architecture of Open Source Applications] * [http://docs.python.org Python Documentation] * [https://developers.google.com/edu/python/ Google Introductory Python Notes] * [http://huffman.sourceforge.net/tao/tao-of-programming.html Tao of Programming] Other (possibly useful) materials: * [http://hackersdictionary.com/html/entry/larval-stage.html The Jargon File] * Chapters 7&8 of Modelling and Simulation, Birta and Arbez, Springer 2007 (eBook avail. from USF Library). * Chapters 4-6 of Models and Algorithms for Intelligent Data Analysis, Runkler, Springer 2012 (eBook avail. from USF Library). * Guide to Scientific Computing in C++, Francis and Whiteley, Springer, 2012. (eBook avail. from USF Library) * Extra info. On the basics: ** Chapters 3 and 7 of Mathematics in Computing, Regan, Springer 2013. (eBook avail. from USF Library) ** Instant feedback graphical programming with [https://www.khanacademy.org/cs/programming/ Khan Academy] * [http://www.meetup.com/python-178/ Local PyBulls Meetings] Code: * [http://carsonfarmer.com/2013/07/essential-python-geo-libraries Python Libraries Useful for Geospatial Problems] * [[Code#Python_Libraries|Python Libraries Useful for Computational Chemistry]] (very small list at present) Interactive Interpreters: * [http://www.codewars.com CodeWars] Recommended for building experience with practice problems. * [http://exercism.io Exercism] A command-line client with a similar learn-through-challenge philosophy. * [http://repl.it repl.it] A read-eval-print loop for several computer languages. * [http://en.cppreference.com/w/cpp/language CppReference] Documentation with an online evaluator for C++ code. === Notes === * [[Media:intro.pdf|Notes]] for Week 1 ** Over the first two weeks or so, we'll be practicing the basics - so read through Chapters 1-3 of Hetland's Beginning Python during this time. ** [[PythonTranslated|Important Definitions]] * [[Media:Week2.pdf|Notes]] for Week 2 ** [[Code:Oware|Oware code]] ** Solutions for some problems in Week 2's notes: <source lang="python"> # simple data types "a string" # : str x = [1, 2, 3] # : [int] # compound data type (1, "name", (x, x)) # : (int, str, ([int], [int])) # add_one : int -> int # str.__add__ : str -> str -> str # str.split : str -> [str] # str.__mod__ : str -> (Objects) -> str </source> * [[Media:Week3.pdf|Notes]] for Week 3-4 ** Reading assignment - read through Chapter 5 and 6 (and practice dictionaries from Ch. 4) ** [[Code:for_patterns|Abstracting patterns]] in for loops. * [[Media:Week5.pdf|Notes]] for Week 5-6 ** Reading assignment - Read Chapter 10-11 (and refer to Ch. 4) * By this point, we've covered all the basics: ** base types: str, int, float, [a] ** variables and substitution: j vs "4" vs 4 ** indexing and slicing into lists / strings: x[1:4] or x[i:j] ** control flow: if and for syntax ** functions implementing patterns: def next(r, x): return r*x*(1-x) * You should be able to use these for: ** finding and abstracting the pattern ** naming the type of a function ** determining which variable names are in scope * All that's left is learning common uses, patterns and even more syntax! === Homework === * [[CompSciHW1|Homework 1]] is due Monday, January 25. * [[CompSciHW2|Homework 2]] is due Monday, February 8. * [[CompSciHW3|Homework 3]] is due Friday, February 19. * [[CompSciHW4|Homework 4]] is due Friday, February 26. * [[CompSciHW5|Homework 5]] is due Friday, March 4. == Group Work Pages == Group 1 [https://docs.google.com/document/d/1k6vruCx78aV0pL8Kw7WWtsw_-6zgdoeP0OvujSzbsh0/edit?usp=sharing]: Group 2 [https://docs.google.com/document/d/1MgpVly2D1h9Xt_lFh5ywa3b70Ul9ES6OQZtg5l_n0NM/edit?usp=sharing] Group 3 [https://docs.google.com/document/d/1LT_J-vObN9tPa1JoQ1B_h04ENsL5Ko2xeFeRMp-99f8/edit?usp=sharing] Group 4 [https://docs.google.com/document/d/1hGlNlg1w7_3qCo6LE-y9rSZx1Chwc0FBUoxK6cyzWW8/edit?usp=sharing] Substitution problem notes: <pre> Requirements: 1. Python object representing a spreadsheet 2. Ability to show the whole sheet (formulas) 3. Ability to compute the whole sheet (values) 4. Ability to update formula stored in a cell Cells: Example Cell Content: "A1 - B2*C2" A B C 1 A1 B1 C1 2 A2 B2 C2 3 A3 B3 C3 Hint 1: use str.replace : str -> str -> str -> str * fixed replacement order: A1, B1, C1, A2, B2, C2, ... "A1 - B2*C2".replace("A1", "5") Hint 2: use eval : str -> Object eval("5*3 - 4") vals = ["3", "4", "5", "A1", "A1 - 2*A2", "5", "", "", ""] vals = {"" : "3", } #? Hint 3: OK to print the easy way -- A1 = 5 + 2 A2 = A1*4 A3 = A1 - A2 Hint 4: Compute values in a separate sheet object. formulas -> values -- values["A1"] = formulas["A1"] values["B1"] = formulas["B1"].replace("A1", values["A1"]) values["C1"] = formulas["C1"].replace("B1", values["B1"]) values["C1"] = values["C1"].replace("A1", values["A1"]) values["A2"] = formulas["A2"] values["A2"] = values["A2"].replace("C1", values["C1"]) values["A2"] = values["A2"].replace("B1", values["B1"]) values["A2"] = values["A2"].replace("A1", values["A1"]) # Build the value of B2 from its formula. values["B2"] = formulas["B2"] values["B2"] = values["B2"].replace("A2", values["A2"]) values["B2"] = values["B2"].replace("C1", values["C1"]) values["B2"] = values["B2"].replace("B1", values["B1"]) values["B2"] = values["B2"].replace("A1", values["A1"]) </pre> 4b6c0d1933ba6942197cb63995ca04d9f6a6c46a 460 453 2016-02-24T17:26:39Z David M. Rogers 2 /* Notes */ wikitext text/x-wiki '''<BIG>Introduction to Scientific Computing</BIG>''' Course Info * Course Numbers CHM 4932-004/6938-010, CRN: 22347/22348 * Credit Hours: 3 * Meeting Dates: January 22 - April 27, 2016 ** No Class Jan. 18 or Mar. 14-19 * Meeting Times: Mon. and Wed., 12:30-13:45 in SCA 222 ** Lab Session & Office Hours: Fri. 12:30-13:45 in SCA 222 (or SCA 433) == Overview == Mathematical models in the natural sciences take many shapes and forms. The moment they become more complicated than tracking a few variables over time, we have to put away our Excel spreadsheets and make use of a solid foundation in computational science. The course establishes this foundation by introducing data structures and algorithms used in everyday scientific computing using examples in the python scripting language. By the end of the Semester, students will be able to navigate the Linux command-line to go from a mathematical model to a numerical solution. Best practices for working with computer code and visualizing data will also be covered. == Topics == # Languages #* bash (shell) #* python (scripting) #* stack & register-based machine languages: overview of C and Fortran syntax & compiling with gcc, ‘thread safety’ #* Shared libraries & language inter-operability (FFI) # Algorithms #* Horner’s algorithm for polynomials #* Newton’s root finding algo. #* Overview of general optimization algo-s (example: linear & nonlin. least-squares) #* Numerical integration (scripted, plus gnu ODE) #* Communication (how HTTP get/put works) # Data Structures #* Linked Lists #* Trees (file system hierarchies) #* Graphs #* Arrays (dense & sparse) example: vectors & rotations / transpositions, densities and difference operators # Presentation & visualization #* Flat CSV files (and excel) #* Working with binary data #* Python matplotlib (2D images) #* Binning histograms & weighted averages # Best Practices #* High-level code design (modularity, interface specifications, unit testing, etc.) #* Code audit: open-source libraries, ex. Gnu Scientific Library, qsort in libc, Boost #* Source code versioning (example: git or mercurial) #* gdb & execution profiling #* documentation #* Makefiles == Grading == '''Grading Scale (out of 400 points possible)''' {| class="wikitable" |- ! Grade ! Undergraduate ! Graduate |- | A | 230 | 300 |- | B | 180 | 230 |- | C | 150 | 180 |- | D | 120 | 150 |} * Points Possible: ** 10 homework assignments (20 points per homework) ** 2 projects / competitions (100 points per project) * Homework Rules ** For work done in groups, credit is divided equally among participants - so the max homework grade for a group of 2 is 10 points each. ** For each homework, 1 re-do at full credit can be sent at any time after the due date, but must present a unique solution to previous work from yourself or others. ** All work must cite co-group members (if any) and the source of any code snippets used online. === Grading Rationale === Homework points will only be awarded for correct, working code and correct algorithmic analysis, while the homework problems will become progressively tougher. Undergraduates should be able to pass the course with an A if they have correctly answered most of the homework, and made a strong attempt at one of the projects. Graduate students should both perform well on the homework and successfully complete one or two projects. Essentially, this means you should do your own homework when possible and may do a project in a small group. The re-grading and group options for homework allow making up for missed assignments, and encourage returning to core concepts at a later point in the class. Students who have completed significant portions of the homework have thus demonstrated programming proficiency, and are qualified for at least B/C grades. == Projects == === Midterm === A description for the midterm project is now available [[Media:midterm.pdf|here]]. The MD section will be updated as we discuss it in class. The due date for the midterm will be Friday, March 11. === Final === TBA == Textbooks and Resources == * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-0072-7 Beginning Python, Hetland, 2005] (eBook avail. from USF Library) * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-3238-4 Python Algorithms, Hetland, 2010] (eBook avail. from USF Library) * [http://aosabook.org/en/index.html The Architecture of Open Source Applications] * [http://docs.python.org Python Documentation] * [https://developers.google.com/edu/python/ Google Introductory Python Notes] * [http://huffman.sourceforge.net/tao/tao-of-programming.html Tao of Programming] Other (possibly useful) materials: * [http://hackersdictionary.com/html/entry/larval-stage.html The Jargon File] * Chapters 7&8 of Modelling and Simulation, Birta and Arbez, Springer 2007 (eBook avail. from USF Library). * Chapters 4-6 of Models and Algorithms for Intelligent Data Analysis, Runkler, Springer 2012 (eBook avail. from USF Library). * Guide to Scientific Computing in C++, Francis and Whiteley, Springer, 2012. (eBook avail. from USF Library) * Extra info. On the basics: ** Chapters 3 and 7 of Mathematics in Computing, Regan, Springer 2013. (eBook avail. from USF Library) ** Instant feedback graphical programming with [https://www.khanacademy.org/cs/programming/ Khan Academy] * [http://www.meetup.com/python-178/ Local PyBulls Meetings] Code: * [http://carsonfarmer.com/2013/07/essential-python-geo-libraries Python Libraries Useful for Geospatial Problems] * [[Code#Python_Libraries|Python Libraries Useful for Computational Chemistry]] (very small list at present) Interactive Interpreters: * [http://www.codewars.com CodeWars] Recommended for building experience with practice problems. * [http://exercism.io Exercism] A command-line client with a similar learn-through-challenge philosophy. * [http://repl.it repl.it] A read-eval-print loop for several computer languages. * [http://en.cppreference.com/w/cpp/language CppReference] Documentation with an online evaluator for C++ code. === Notes === * [[Media:intro.pdf|Notes]] for Week 1 ** Over the first two weeks or so, we'll be practicing the basics - so read through Chapters 1-3 of Hetland's Beginning Python during this time. ** [[PythonTranslated|Important Definitions]] * [[Media:Week2.pdf|Notes]] for Week 2 ** [[Code:Oware|Oware code]] ** Solutions for some problems in Week 2's notes: <source lang="python"> # simple data types "a string" # : str x = [1, 2, 3] # : [int] # compound data type (1, "name", (x, x)) # : (int, str, ([int], [int])) # add_one : int -> int # str.__add__ : str -> str -> str # str.split : str -> [str] # str.__mod__ : str -> (Objects) -> str </source> * [[Media:Week3.pdf|Notes]] for Week 3-4 ** Reading assignment - read through Chapter 5 and 6 (and practice dictionaries from Ch. 4) ** [[Code:for_patterns|Abstracting patterns]] in for loops. * [[Media:Week5.pdf|Notes]] for Week 5-6 ** Reading assignment - Read Chapter 10-11 (and refer to Ch. 4) * By this point, we've covered all the basics: ** base types: str, int, float, [a] ** variables and substitution: j vs "4" vs 4 ** indexing and slicing into lists / strings: x[1:4] or x[i:j] ** control flow: if and for syntax ** functions implementing patterns: def next(r, x): return r*x*(1-x) * You should be able to use these for: ** finding and abstracting the pattern ** naming the type of a function ** determining which variable names are in scope * All that's left is learning common uses, patterns and even more syntax! * [[Gorrilaz Code]] === Homework === * [[CompSciHW1|Homework 1]] is due Monday, January 25. * [[CompSciHW2|Homework 2]] is due Monday, February 8. * [[CompSciHW3|Homework 3]] is due Friday, February 19. * [[CompSciHW4|Homework 4]] is due Friday, February 26. * [[CompSciHW5|Homework 5]] is due Friday, March 4. == Group Work Pages == Group 1 [https://docs.google.com/document/d/1k6vruCx78aV0pL8Kw7WWtsw_-6zgdoeP0OvujSzbsh0/edit?usp=sharing]: Group 2 [https://docs.google.com/document/d/1MgpVly2D1h9Xt_lFh5ywa3b70Ul9ES6OQZtg5l_n0NM/edit?usp=sharing] Group 3 [https://docs.google.com/document/d/1LT_J-vObN9tPa1JoQ1B_h04ENsL5Ko2xeFeRMp-99f8/edit?usp=sharing] Group 4 [https://docs.google.com/document/d/1hGlNlg1w7_3qCo6LE-y9rSZx1Chwc0FBUoxK6cyzWW8/edit?usp=sharing] Substitution problem notes: <pre> Requirements: 1. Python object representing a spreadsheet 2. Ability to show the whole sheet (formulas) 3. Ability to compute the whole sheet (values) 4. Ability to update formula stored in a cell Cells: Example Cell Content: "A1 - B2*C2" A B C 1 A1 B1 C1 2 A2 B2 C2 3 A3 B3 C3 Hint 1: use str.replace : str -> str -> str -> str * fixed replacement order: A1, B1, C1, A2, B2, C2, ... "A1 - B2*C2".replace("A1", "5") Hint 2: use eval : str -> Object eval("5*3 - 4") vals = ["3", "4", "5", "A1", "A1 - 2*A2", "5", "", "", ""] vals = {"" : "3", } #? Hint 3: OK to print the easy way -- A1 = 5 + 2 A2 = A1*4 A3 = A1 - A2 Hint 4: Compute values in a separate sheet object. formulas -> values -- values["A1"] = formulas["A1"] values["B1"] = formulas["B1"].replace("A1", values["A1"]) values["C1"] = formulas["C1"].replace("B1", values["B1"]) values["C1"] = values["C1"].replace("A1", values["A1"]) values["A2"] = formulas["A2"] values["A2"] = values["A2"].replace("C1", values["C1"]) values["A2"] = values["A2"].replace("B1", values["B1"]) values["A2"] = values["A2"].replace("A1", values["A1"]) # Build the value of B2 from its formula. values["B2"] = formulas["B2"] values["B2"] = values["B2"].replace("A2", values["A2"]) values["B2"] = values["B2"].replace("C1", values["C1"]) values["B2"] = values["B2"].replace("B1", values["B1"]) values["B2"] = values["B2"].replace("A1", values["A1"]) </pre> 65cd96e6f0cac9fb658f8a03be0eae5799f89db0 PythonTranslated 0 88 414 2016-01-13T14:18:18Z David M. Rogers 2 Created page with "Abstracting = the process of turning a specific answer (or program) into a more general one. The code below uses '''x''' and '''y''' as abstract place-holders for the actual ..." wikitext text/x-wiki Abstracting = the process of turning a specific answer (or program) into a more general one. The code below uses '''x''' and '''y''' as abstract place-holders for the actual numbers of apples in the computation. # 4 apples - 1 apples gives me 3 apples left left = 4 - 1 # original, specific answer x = 4 y = 1 left = x - y # general, abstract answer Argument = the Python objects sent as inputs to a function This example calls '''map''' with arguments '''abs''' and [-1,2,-3,4] map(abs, [-1,2,-3,4]) Code block = a group of Python code with the same number of spaces in front of the line. Here's an example of a block of 3 lines executed when '''x''' is larger than 4: if x > 4: x = x - 4 z = z + "a" print x Control flow = the order in which lines of code are executed by the Python interpreter. If-statements interrupt control flow by skipping over one of the branches. The third step could print either "Win" or "Lose". x = 100 # first step if x == 100: # second step print "Win" # true-branch else: print "Lose" # false-branch print "Game Over." # fourth step Interpreter = the computer program that runs Python code. All Python code is run by the interpreter, usually by typing (at the $-prompt). $ python code.py # You can also start an interactive interpreter $ python >>> # this prompt means you are now talking to Python >>> print "Hello World!" List = a collection of Python objects inside brackets, '''[]''' [1,2,3,4] Tuple = a collection of Python objects inside parentheses, '''()''' ("string", 5*6, ['a']) Type ... Every Python object has a type (like int, string, or float) that describes what kind of object it is. type(7) ~> <type 'int'> Variable = a name used to refer to any Python object Note: Every word in your program other than special keywords (or words beginning with numbers) is treated as a variable. x, y, hallo c8175dd22eb2c333bbf3ffb04bd27b38bac4a2c0 Predictive Chemistry:Current events 4 10 416 400 2016-01-15T17:51:04Z David M. Rogers 2 wikitext text/x-wiki * July 12-16, 2016: David M. Rogers presents "A Molecular Approach to Dispersion Energy", at the TSRC Workshop on Ions in Solution: Biology, Energy, and Environment. * Mar. 13-17, 2016: David M. Rogers presents "The Quantum Andersen Thermostat," at the 2016 ACS Spring Meeting. * Friday, Feb. 12, 2016: David M. Rogers presents "Angle-free methods for boundary element problems on the sphere: The quadrature basis for spherical harmonics," at the USF Mathematics Department Analysis Lecture Series. * Monday, Jan 11, 2016: USF Spring 2016 semester classes begin. * Tuesday, December 15, 2015: David M. Rogers presents "Maximum Transition Entropy - A Causal, Canonical Model for Nonequilibrium Statistical Mechanics," at the 114th Statistical Mechanics Conference at Rutgers, New Brunswick New Jersey. * Monday, September 14, 2015, Invited Presentation, "Understanding the origins of irreversibility: electrical driving and the second law.," Tulane Department of Chemistry. * July 27-30, 2015 Travel to DOE Comp. Sci. Graduate Fellowship Program Review in Arlington, VA. * June, 2015: JCTC Publishes our [http://pubs.acs.org/doi/abs/10.1021/acs.jctc.5b00357 article] on "Dispersion- and Exchange-Corrected Density Functional Theory for Sodium Ion Hydration" * Wednesday, May 13, 2015: David M. Rogers presented "Spatiotemporal Concentration-Polarization Induced pH Changes at Ion-Selective Membranes." at the [https://www.cbdstconference.com/agenda Chemical and Biological Defense Sci. & Tech. conference] in St. Louis, MO. * Friday, May 8, 2015: David M. Rogers presented "Where do Quanta Come From?" at the Florida ACS Meeting and Exhibition ([http://fame2015.fl-acs.org/ataglance.html FAME]). * April, 2015: [http://scitation.aip.org/content/aip/journal/jcp/142/7/10.1063/1.4907404 Real-Space Quadrature paper] was published as a cover article by JCP. * Wednesday, Mar. 4, 2015: David M. Rogers presented "[http://meetings.aps.org/Meeting/MAR15/Session/M44.9 Thermodynamics of Maximum Transition Entropy for Quantum Assemblies]." at the APS March Meeting in San Antonio, TX. * Saturday, Nov. 22 2014: USF and neighboring universities are hosting a [http://predictivestatmech.org/papers/MRI-flyer.pdf Scientific Computing Workshop] for undergraduates. Follow the instructions in the flyer to sign up by Nov. 11! * Thursday, Oct. 16: David M. Rogers presented "[http://predictivestatmech.org/papers/real-poles.pdf Real-space quadrature: A convenient, universal representation for multipole expansions]." at the Southeast Regional Meeting of the ACS in Nashville, TN. * Friday, Aug. 29 2014: Felipe Zapata joins the group * Monday, Aug. 25 2014: USF Autumn Semester First Day of Classes - don't forget to sign up for [[CompSciFall2014|Introduction to Scientific Computing]]! * Monday, Aug. 18 2014: David M. Rogers presented an invited talk "pH Dynamics During Concentration Polarization," to the [http://www.pnnl.gov/computing/cm4/ CM4 Mathematics for Mesoscopic Materials Modeling Group]. * Tuesday, July 8 2014: David M. Rogers presented "What’s Holding Up Multiscale modeling?" at the Telluride, CO workshop for [http://www.telluridescience.org/meetings/workshop-details?wid=404 Ions in Aqueous Solutions and Molecular Biology]. * Friday, May 9 2014: David M. Rogers presented "Jumping from atomistic to continuum simulation of electrochemical driving at interfaces," at the 2014 Florida FAME Conference.[http://www.fame.chem.ufl.edu/computational.html] * January 29th, 2014: David M. Rogers presented "Simulating at the molecular / continuum interface," at the USF Research Computing User's Group Forum [http://www.usf.edu/it/research-computing/featured-researchers/rogersgroup.aspx]. * Monday, Aug. 26 2013: USF Autumn Semester First Day of Classes * Friday, July 12, 2013: Argonne Center for Nanoscale Materials [http://nano.anl.gov/users/call_for_proposals.html Proposal Deadline] * Thursday, July 4, 2013: Independence Day - celebrate by supporting [https://www.eff.org/ EFF] * Thursday, April 11 2013: David M. Rogers presented "Solute Partitioning and Transport through Natural and Biomimetic Membranes," at the 2013 ACS National Meeting. == Calendars == * [http://www.registrar.usf.edu/enroll/regist/calendt.php USF Calendar] 4ea7a10e6a59b3f01eba6aed4dde37cd5370d394 File:Week2.pdf 6 89 418 2016-01-20T17:21:15Z David M. Rogers 2 wikitext text/x-wiki da39a3ee5e6b4b0d3255bfef95601890afd80709 Code:Oware 0 90 420 2016-01-20T19:20:09Z David M. Rogers 2 Created page with "Here is the code we're building in Intro. Scientific Computing, 2016 for playing [https://en.wikipedia.org/wiki/Oware Oware]. There is a simple rule summary and a few example ..." wikitext text/x-wiki Here is the code we're building in Intro. Scientific Computing, 2016 for playing [https://en.wikipedia.org/wiki/Oware Oware]. There is a simple rule summary and a few example game openings at this [https://ilk.uvt.nl/icga/journal/contents/content25-3.htm#AWARI%20IS%20SOLVED site]. <source lang="python"> # objective: create a game of Owari # ASCII Art: f e d c b a <-- (fed) # score[1] # A B C D E F --> (ABC) # score[0] # 0 1 2 3 4 5 # create a new board def new_board(): # () -> ([int], [int], [int]) ABC = [4]*6 fed = [4]*6 score = [0, 0] return ABC, fed, score # move pieces (TODO) def move(ABC, fed, start): # player 1, assume start is at position F ABC[5] = 0 #assign old position to zero fed[5] = fed[5] + 1 # distribute seeds fed[4] = fed[4] + 1 # distribute seeds fed[3] = fed[3] + 1 # distribute seeds fed[2] = fed[2] + 1 # distribute seeds # TODO: check for capture return 0, 0 # return score update # print_board : ([int], [int], [int]) -> () def print_board(ABC, fed, score): print "Current board:" print "f e d c b a" print fed, score[1] print ABC, score[0] print "A B C D E F" ABC, fed, score = create_board() print_board(ABC, fed, score) </source> 89e048dfa126e8c94e7717bc0cc0e7a73e3cb69a 421 420 2016-01-20T19:20:36Z David M. Rogers 2 wikitext text/x-wiki Here is the code we're building in Intro. Scientific Computing, 2016 for playing [https://en.wikipedia.org/wiki/Oware Oware]. There is a simple rule summary and a few example game openings at this [https://ilk.uvt.nl/icga/journal/contents/content25-3.htm#AWARI%20IS%20SOLVED site]. <source lang="python"> # objective: create a game of Owari # ASCII Art: f e d c b a <-- (fed) # score[1] # A B C D E F --> (ABC) # score[0] # 0 1 2 3 4 5 # create a new board def new_board(): # () -> ([int], [int], [int]) ABC = [4]*6 fed = [4]*6 score = [0, 0] return ABC, fed, score # move pieces (TODO) def move(ABC, fed, start): # player 1, assume start is at position F ABC[5] = 0 #assign old position to zero fed[5] = fed[5] + 1 # distribute seeds fed[4] = fed[4] + 1 # distribute seeds fed[3] = fed[3] + 1 # distribute seeds fed[2] = fed[2] + 1 # distribute seeds # TODO: check for capture return 0, 0 # return score update # print_board : ([int], [int], [int]) -> () def print_board(ABC, fed, score): print "Current board:" print "f e d c b a" print fed, score[1] print ABC, score[0] print "A B C D E F" ABC, fed, score = new_board() print_board(ABC, fed, score) </source> 7962da85d9ac90bc5228724afc667fa890a5ce1b 434 421 2016-02-01T16:49:04Z David M. Rogers 2 wikitext text/x-wiki Here is the code we're building in Intro. Scientific Computing, 2016 for playing [https://en.wikipedia.org/wiki/Oware Oware]. There is a simple rule summary and a few example game openings at this [https://ilk.uvt.nl/icga/journal/contents/content25-3.htm#AWARI%20IS%20SOLVED site]. <source lang="python"> # objective: create a game of Owari # ASCII Art: f e d c b a <-- (fed) # score[1] # A B C D E F --> (ABC) # score[0] # 0 1 2 3 4 5 # create a new board def new_board(): # () -> ([int], [int], [int]) ABC = [4]*6 fed = [4]*6 score = [0, 0] return ABC, fed, score # move -- remove seeds from starting location # and distribute one after the other counterclockwise # # Implements the pattern: (start) ABC fed (score) -> ABC fed (score) # type = (start : int), board -> board # (position F) [4,4,4,4,4,4] [4,4,4,4,4,4] (score) -> [4,4,4,4,4,0] [4,4,5,5,5,5] (score) # (position e) [4,4,4,4,4,4] [4,4,4,4,4,4] (score) -> [5,5,5,4,4,4] [5,0,4,4,4,4] (score) # (position A) [0,1,2,3,4,5] [2,2,2,2,2,2] (score) -> [0,1,2,3,4,5] [2,2,2,2,2,2] (score) # (position a) [0,1,2,3,4,5] [2,2,2,2,2,2] (score) -> [0,1,2,3,4,5] [2,2,2,3,3,0] (score) # # move : int -> board -> board def move(start, ABC, fed, score): # move pieces # compute board location board, pos = compute_board_location(start, ABC, fed) n = board[pos] # copy number of seeds there board[pos] = 0 # loop over n for i in range(n): # 0, 1, ..., n-1 update_pos = (pos + i + 1) % 12 board, loc = compute_board_location(update_pos, ABC, fed) print i, loc, update_pos board[loc] += 1 # same as board[] = board[] + 1 print("Remember to check for capture") return ABC, FED, score # Helper function to deal with our 0-11 based numbering system. def compute_board_location(start, ABC, fed): if start < 6: board = ABC pos = start else: board = fed pos = 11 - start return board, pos # print_board : ([int], [int], [int]) -> () def print_board(ABC, fed, score): print "Current board:" print "f e d c b a" print fed, score[1] print ABC, score[0] print "A B C D E F" ABC, fed, score = new_board() print_board(ABC, fed, score) </source> bbf7bb10708421c6f8d7033b982d477b24c56e2e 435 434 2016-02-01T16:52:03Z David M. Rogers 2 wikitext text/x-wiki Here is the code we're building in Intro. Scientific Computing, 2016 for playing [https://en.wikipedia.org/wiki/Oware Oware]. There is a simple rule summary and a few example game openings at this [https://ilk.uvt.nl/icga/journal/contents/content25-3.htm#AWARI%20IS%20SOLVED site]. <source lang="python"> # objective: create a game of Owari # ASCII Art: f e d c b a <-- (fed) # score[1] # A B C D E F --> (ABC) # score[0] # 0 1 2 3 4 5 # create a new board def new_board(): # () -> ([int], [int], [int]) ABC = [4]*6 fed = [4]*6 score = [0, 0] return ABC, fed, score # move -- remove seeds from starting location # and distribute one after the other counterclockwise # # Implements the pattern: (start) ABC fed (score) -> ABC fed (score) # type = (start : int), board -> board # (position F) [4,4,4,4,4,4] [4,4,4,4,4,4] (score) -> [4,4,4,4,4,0] [4,4,5,5,5,5] (score) # (position e) [4,4,4,4,4,4] [4,4,4,4,4,4] (score) -> [5,5,5,4,4,4] [5,0,4,4,4,4] (score) # (position A) [0,1,2,3,4,5] [2,2,2,2,2,2] (score) -> [0,1,2,3,4,5] [2,2,2,2,2,2] (score) # (position a) [0,1,2,3,4,5] [2,2,2,2,2,2] (score) -> [0,1,2,3,4,5] [2,2,2,3,3,0] (score) # # move : int -> board -> board def move(start, ABC, fed, score): # move pieces # compute board location board, pos = compute_board_location(start, ABC, fed) n = board[pos] # copy number of seeds there board[pos] = 0 # loop over n for i in range(n): # 0, 1, ..., n-1 update_pos = (pos + i + 1) % 12 board, loc = compute_board_location(update_pos, ABC, fed) print i, loc, update_pos board[loc] += 1 # same as board[] = board[] + 1 print("Remember to check for capture") return ABC, fed, score # Helper function to deal with our 0-11 based numbering system. def compute_board_location(start, ABC, fed): if start < 6: board = ABC pos = start else: board = fed pos = 11 - start return board, pos # print_board : ([int], [int], [int]) -> () def print_board(ABC, fed, score): print "Current board:" print "f e d c b a" print fed, score[1] print ABC, score[0] print "A B C D E F" ABC, fed, score = new_board() print_board(ABC, fed, score) </source> 838907dd3ea6743aa30552984a6fedcd453f5c71 436 435 2016-02-01T16:55:05Z David M. Rogers 2 wikitext text/x-wiki Here is the code we're building in Intro. Scientific Computing, 2016 for playing [https://en.wikipedia.org/wiki/Oware Oware]. There is a simple rule summary and a few example game openings at this [https://ilk.uvt.nl/icga/journal/contents/content25-3.htm#AWARI%20IS%20SOLVED site]. <source lang="python"> # objective: create a game of Owari # ASCII Art: f e d c b a <-- (fed) # score[1] # A B C D E F --> (ABC) # score[0] # 0 1 2 3 4 5 # create a new board def new_board(): # () -> ([int], [int], [int]) ABC = [4]*6 fed = [4]*6 score = [0, 0] return ABC, fed, score # move -- remove seeds from starting location # and distribute one after the other counterclockwise # # Implements the pattern: (start) ABC fed (score) -> ABC fed (score) # type = (start : int), board -> board # (position F) [4,4,4,4,4,4] [4,4,4,4,4,4] (score) -> [4,4,4,4,4,0] [4,4,5,5,5,5] (score) # (position e) [4,4,4,4,4,4] [4,4,4,4,4,4] (score) -> [5,5,5,4,4,4] [5,0,4,4,4,4] (score) # (position A) [0,1,2,3,4,5] [2,2,2,2,2,2] (score) -> [0,1,2,3,4,5] [2,2,2,2,2,2] (score) # (position a) [0,1,2,3,4,5] [2,2,2,2,2,2] (score) -> [0,1,2,3,4,5] [2,2,2,3,3,0] (score) # # move : int -> board -> board def move(start, ABC, fed, score): # move pieces # compute board location board, pos = compute_board_location(start, ABC, fed) n = board[pos] # copy number of seeds there board[pos] = 0 # loop over n for i in range(n): # 0, 1, ..., n-1 update_pos = (start + i + 1) % 12 board, loc = compute_board_location(update_pos, ABC, fed) # print i, loc, update_pos # trace the loop execution for debugging board[loc] += 1 # same as board[] = board[] + 1 print("Remember to check for capture") return ABC, fed, score # Helper function to deal with our 0-11 based numbering system. def compute_board_location(start, ABC, fed): if start < 6: board = ABC pos = start else: board = fed pos = 11 - start return board, pos # print_board : ([int], [int], [int]) -> () def print_board(ABC, fed, score): print "Current board:" print "f e d c b a" print fed, score[1] print ABC, score[0] print "A B C D E F" ABC, fed, score = new_board() print_board(ABC, fed, score) </source> 390c4b92152edb004fb176cf38f5c8cdc8133fad File:Week3.pdf 6 91 424 2016-01-25T17:16:11Z David M. Rogers 2 wikitext text/x-wiki da39a3ee5e6b4b0d3255bfef95601890afd80709 Code:for patterns 0 92 426 2016-01-25T19:56:32Z David M. Rogers 2 Created page with "Here are some example codes that write essentially the same instruction over and over. Let's see how to abstract these patterns out using variables. Try and work the problems..." wikitext text/x-wiki Here are some example codes that write essentially the same instruction over and over. Let's see how to abstract these patterns out using variables. Try and work the problems before flipping over to the solutions section. == Problems == <source lang="python"> # Replace text in a formula. # A B C vals = ["1", "", "2", # 1 "", "", "3", # 2 "", "", "" ] # 3 out = "A1 + C1 * C2" out = out.replace("A1", vals[0]) out = out.replace("A2", vals[3]) out = out.replace("A3", vals[6]) out = out.replace("B1", vals[1]) out = out.replace("B2", vals[4]) out = out.replace("B3", vals[7]) out = out.replace("C1", vals[2]) out = out.replace("C2", vals[5]) out = out.replace("C3", vals[8]) # Increment items in a list. fed[5] = fed[5] + 1 fed[4] = fed[4] + 1 fed[3] = fed[3] + 1 # Append a line to a string. if n >= 1: out = out + "%f %f %f\n"%(a[0][0], a[0][1], a[0][2]) if n >= 2: out = out + "%f %f %f\n"%(a[1][0], a[1][1], a[1][2]) if n >= 3: out = out + "%f %f %f\n"%(a[2][0], a[2][1], a[2][2]) if n >= 4: out = out + "%f %f %f\n"%(a[3][0], a[3][1], a[3][2]) # Iterate the linear congruential random number generator. i = len(x)-1 x.append(x[i]*61 % 900) i = len(x)-1 x.append(x[i]*61 % 900) i = len(x)-1 x.append(x[i]*61 % 900) i = len(x)-1 x.append(x[i]*61 % 900) i = len(x)-1 x.append(x[i]*61 % 900) </source> First, assume the loop control variable is "i", and try and write each one of these as a loop body that uses the variable "i" to make the pattern. Next, add the "for i in (...):" syntax on top by figuring out how many times / what values of "i" the loop should run. == Solutions == <source lang="python"> # Replace text in a formula. # A B C def substitute_str(fmt, vals): # substitute_str : str -> [str] -> str out = fmt n = 0 for i in ["A1", "A2", "A3", "B1", "B2", "B3", "C1", "C2", "C3"]: out = out.replace(i, vals[n]) n = n + 1 return out print substitute_str("A1 + C1*C2", vals) # Increment items in a list. def sow_list_6(fed, n): # sow_list : [int] -> int -> [int] out = fed[:] # copy all elements of fed by slicing all of them for i in range(n): out[5-i] = out[5-i] + 1 return out # Increment items in a list (advanced). def sow_list(ABC, fed, start, n): # [int] -> [int] -> int -> int -> ([int], [int], int) ABC = ABC[:] # copy ABC fed = fed[:] # copy fed for i in range(n): pos = (start + n) % 12 # use mod to get an index in the circular # range 0, 1, 2, 3, ..., 10, 11, 0, 1, 2 if i < 6: # positions 0, 1, ..., 5 are ABC ABC[i] = ABC[i] + 1 else: # positions 6, 7, ..., 11 map to fed 5, 4, ..., 0 fed[5-(i-6)] = fed[5-(i-6)] + 1 return ABC, fed, pos # Append a line to a string. def print_atoms(a): # print_atoms : [[float]] -> str out = "Atomic coordinates (in Angstrom)\n" for i in range(len(a)): # loop over all items in a if len(a) > i: # This test is no longer needed. Do you see why? out = out + "%f %f %f\n"%(a[i][0], a[i][1], a[i][2]) return out # Iterate the linear congruential "random" number generator. x = [1] # start with a `seed' value for i in range(5): # generate 5 numbers x.append(x[i]*61 % 900) </source> ea4a36f0822cec984eda5ae9d5bdc1aa728ff2d2 427 426 2016-01-25T20:05:40Z David M. Rogers 2 /* Solutions */ wikitext text/x-wiki Here are some example codes that write essentially the same instruction over and over. Let's see how to abstract these patterns out using variables. Try and work the problems before flipping over to the solutions section. == Problems == <source lang="python"> # Replace text in a formula. # A B C vals = ["1", "", "2", # 1 "", "", "3", # 2 "", "", "" ] # 3 out = "A1 + C1 * C2" out = out.replace("A1", vals[0]) out = out.replace("A2", vals[3]) out = out.replace("A3", vals[6]) out = out.replace("B1", vals[1]) out = out.replace("B2", vals[4]) out = out.replace("B3", vals[7]) out = out.replace("C1", vals[2]) out = out.replace("C2", vals[5]) out = out.replace("C3", vals[8]) # Increment items in a list. fed[5] = fed[5] + 1 fed[4] = fed[4] + 1 fed[3] = fed[3] + 1 # Append a line to a string. if n >= 1: out = out + "%f %f %f\n"%(a[0][0], a[0][1], a[0][2]) if n >= 2: out = out + "%f %f %f\n"%(a[1][0], a[1][1], a[1][2]) if n >= 3: out = out + "%f %f %f\n"%(a[2][0], a[2][1], a[2][2]) if n >= 4: out = out + "%f %f %f\n"%(a[3][0], a[3][1], a[3][2]) # Iterate the linear congruential random number generator. i = len(x)-1 x.append(x[i]*61 % 900) i = len(x)-1 x.append(x[i]*61 % 900) i = len(x)-1 x.append(x[i]*61 % 900) i = len(x)-1 x.append(x[i]*61 % 900) i = len(x)-1 x.append(x[i]*61 % 900) </source> First, assume the loop control variable is "i", and try and write each one of these as a loop body that uses the variable "i" to make the pattern. Next, add the "for i in (...):" syntax on top by figuring out how many times / what values of "i" the loop should run. == Solutions == <source lang="python"> # Replace text in a formula. # A B C def substitute_str(fmt, vals): # substitute_str : str -> [str] -> str out = fmt n = 0 for i in ["A1", "B1", "C1", "A2", "B2", "C2", "A3", "B3", "C3"]: out = out.replace(i, vals[n]) n = n + 1 return out print substitute_str("A1 + C1*C2", vals) # Increment items in a list. def sow_list_6(fed, n): # sow_list : [int] -> int -> [int] out = fed[:] # copy all elements of fed by slicing all of them for i in range(n): out[5-i] = out[5-i] + 1 return out # Increment items in a list (advanced). def sow_list(ABC, fed, start, n): # [int] -> [int] -> int -> int -> ([int], [int], int) ABC = ABC[:] # copy ABC fed = fed[:] # copy fed for i in range(n): pos = (start + i) % 12 # use mod to get an index in the circular # range 0, 1, 2, 3, ..., 10, 11, 0, 1, 2 if pos < 6: # positions 0, 1, ..., 5 are ABC ABC[pos] = ABC[pos] + 1 else: # positions 6, 7, ..., 11 map to fed 5, 4, ..., 0 fed[5-(pos-6)] = fed[5-(pos-6)] + 1 return ABC, fed, pos # Append a line to a string. def print_atoms(a): # print_atoms : [[float]] -> str out = "Atomic coordinates (in Angstrom)\n" for i in range(len(a)): # loop over all items in a if len(a) > i: # This test is no longer needed. Do you see why? out = out + "%f %f %f\n"%(a[i][0], a[i][1], a[i][2]) return out # Iterate the linear congruential "random" number generator. x = [1] # start with a `seed' value for i in range(5): # generate 5 numbers x.append(x[i]*62 % 900) </source> 68a52d959bfa8bda0a46a18999824a8167d7afb0 CompSciHW2 0 93 428 2016-01-25T23:15:33Z David M. Rogers 2 Created page with "Homework 2 -- types, functions, and substitution Use the following code as reference for problem 1: <source lang="python"> from numpy.random import uniform from math import c..." wikitext text/x-wiki Homework 2 -- types, functions, and substitution Use the following code as reference for problem 1: <source lang="python"> from numpy.random import uniform from math import cos, sin, acos, pi def atom_str(x, y, z, at, res, type=" C ", resname="UNK "): return "ATOM %5d %3s %4s%5s %8.3f%8.3f%8.3f 1.00"%(at,type, \ resname,res,x,y,z) def polar2cart(r, th, phi): z = r*cos(phi) # z-axis part x = r*sin(phi) # x/y plane part y = x*sin(th) x = x*cos(th) return x, y, z def gen_sph_surfpt(): th = uniform(0.0, 2.0*pi) z = uniform(-1.0, 1.0) phi = acos(phi) return th, phi R = 1000 out = open("test.pdb", 'w') for i in range(1000): u, v = gen_sph_surfpt() x, y, z = polar2cart(R, u, v) out.write(atom_str(x, y, z, i+1, 1)+'\n') out.close() </source> # In this code, name the type of each of the following: #* u #* gen_sph_surfpt #* polar2cart #** Make sure you use one of the following types: #** basic type: int / string / () #** derived type: [a], (a, b, c, ...) / a -> ... -> b -> c # Write code that computes each of the following patterns, but replaces the variable part with 'x' (and 'y', 'z', etc.). #* Be sure to write this as a function with "def f(x, y, etc.):" and use "return" to return the pattern as output. #* Also, write the type of the function you have produced. a. A list of all positive integers smaller than n ex: [0, 1, 2, 3, 4] [0, 1] [0, 1, 2, 3, 4, 5, 6, 7] b. The following sentence template: "The quick brown dog jumped over 5 foxes." "The terrible brown dog attacked 0 foxes." "The leaning brown dog replaced 99 foxes." "The absent brown dog confused 4 foxes." c. The following very similar lists: [8, 7, 4, 2, 2, 4, 7, 8] [8, 7, 9, 0, 0, 9, 7, 8] [8, 7, 6, 5, 5, 6, 7, 8] [8, 7, 2, 3, 3, 2, 7, 8] [8, 7, 6, 1, 1, 6, 7, 8] d. The outputs (total work and finished flag) of the following flow-chart: <pre><nowiki> (> 4 days left) ---> (procrastinate) ^ / (work >= 10) ---> (work is done) (<= 4 days left) ---> (add "5 - (#days left)" to work) </nowiki></pre> Your function should produce the following output for these (work,left) inputs ((6,0), (5,0), (4,0), (3,1), (2, 3), (1, 6)): 0, False 0, False 1, False 3, False 7, True 10, True 3. Write for-loop to do each of the following tasks: a. Build a list of 4 lines input by the user. Hint: use raw_input b. Count the number of times the letter "e" appears in a string named 'x'. c. Return the rot13 cipher of a lowercase string, "x.lower()" * Explanation: rot13 changes each letter to the letter that appears 13 characters later alphabetically, for example abc becomes nop while and ketchup becomes naq xrgpuhc * Hint: use (ord, chr, and the mod function), dont forget to subtract ord('a') 69baadf842b11079a47be1d314aa9ae93105cb98 429 428 2016-01-26T21:11:48Z David M. Rogers 2 wikitext text/x-wiki Homework 2 -- types, functions, and substitution Use the following code as reference for problem 1: <source lang="python"> from numpy.random import uniform from math import cos, sin, acos, pi def atom_str(x, y, z, at, res, type=" C ", resname="UNK "): return "ATOM %5d %3s %4s%5s %8.3f%8.3f%8.3f 1.00"%(at,type, \ resname,res,x,y,z) def polar2cart(r, th, phi): z = r*cos(phi) # z-axis part x = r*sin(phi) # x/y plane part y = x*sin(th) x = x*cos(th) return x, y, z def gen_sph_surfpt(): th = uniform(0.0, 2.0*pi) z = uniform(-1.0, 1.0) phi = acos(z) return th, phi R = 1000 out = open("test.pdb", 'w') for i in range(1000): u, v = gen_sph_surfpt() x, y, z = polar2cart(R, u, v) out.write(atom_str(x, y, z, i+1, 1)+'\n') out.close() </source> # In this code, name the type of each of the following: #* u #* gen_sph_surfpt #* polar2cart #** Make sure you use one of the following types: #** basic type: int / float / string / () #** derived type: [a], (a, b, c, ...) / a -> ... -> b -> c # Write code that computes each of the following patterns, but replaces the variable part with 'x' (and 'y', 'z', etc.). #* Be sure to write this as a function with "def f(x, y, etc.):" and use "return" to return the pattern as output. #* Also, write the type of the function you have produced. a. A list of all positive integers smaller than n ex: [0, 1, 2, 3, 4] [0, 1] [0, 1, 2, 3, 4, 5, 6, 7] b. The following sentence template: "The quick brown dog jumped over 5 foxes." "The terrible brown dog attacked 0 foxes." "The leaning brown dog replaced 99 foxes." "The absent brown dog confused 4 foxes." c. The following very similar lists: [8, 7, 4, 2, 2, 4, 7, 8] [8, 7, 9, 0, 0, 9, 7, 8] [8, 7, 6, 5, 5, 6, 7, 8] [8, 7, 2, 3, 3, 2, 7, 8] [8, 7, 6, 1, 1, 6, 7, 8] d. The outputs (total work and finished flag) of the following flow-chart: <pre><nowiki> (> 4 days left) ---> (procrastinate) ^ / (work >= 10) ---> (work is done) (<= 4 days left) ---> (add "5 - (#days left)" to work) </nowiki></pre> Your function should produce the following output for these (work,left) inputs ((6,0), (5,0), (4,0), (3,1), (2, 3), (1, 6)): 0, False 0, False 1, False 3, False 7, True 10, True 3. Write for-loop to do each of the following tasks: a. Build a list of 4 lines input by the user. Hint: use raw_input b. Count the number of times the letter "e" appears in a string named 'x'. c. Return the rot13 cipher of a lowercase string, "x.lower()" * Explanation: rot13 changes each letter to the letter that appears 13 characters later alphabetically, for example abc becomes nop while and ketchup becomes naq xrgpuhc * Hint: use (ord, chr, and the mod function), dont forget to subtract ord('a') 4371615e1e475e4b8a7255ef2e8fc4a5b3caa171 431 429 2016-01-27T18:18:31Z David M. Rogers 2 wikitext text/x-wiki Homework 2 -- types, functions, and substitution Due Monday, Feb. 8 Use the following code as reference for problem 1: <source lang="python"> from numpy.random import uniform from math import cos, sin, acos, pi def atom_str(x, y, z, at, res, type=" C ", resname="UNK "): return "ATOM %5d %3s %4s%5s %8.3f%8.3f%8.3f 1.00"%(at,type, \ resname,res,x,y,z) def polar2cart(r, th, phi): z = r*cos(phi) # z-axis part x = r*sin(phi) # x/y plane part y = x*sin(th) x = x*cos(th) return x, y, z def gen_sph_surfpt(): th = uniform(0.0, 2.0*pi) z = uniform(-1.0, 1.0) phi = acos(z) return th, phi R = 1000 out = open("test.pdb", 'w') for i in range(1000): u, v = gen_sph_surfpt() x, y, z = polar2cart(R, u, v) out.write(atom_str(x, y, z, i+1, 1)+'\n') out.close() </source> # In this code, name the type of each of the following: #* u #* gen_sph_surfpt #* polar2cart #** Make sure you use one of the following types: #** basic type: int / float / string / () #** derived type: [a], (a, b, c, ...) / a -> ... -> b -> c # Write code that computes each of the following patterns, but replaces the variable part with 'x' (and 'y', 'z', etc.). #* Be sure to write this as a function with "def f(x, y, etc.):" and use "return" to return the pattern as output. #* Also, write the type of the function you have produced. a. A list of all positive integers smaller than n ex: [0, 1, 2, 3, 4] [0, 1] [0, 1, 2, 3, 4, 5, 6, 7] b. The following sentence template: "The quick brown dog jumped over 5 foxes." "The terrible brown dog attacked 0 foxes." "The leaning brown dog replaced 99 foxes." "The absent brown dog confused 4 foxes." c. The following very similar lists: [8, 7, 4, 2, 2, 4, 7, 8] [8, 7, 9, 0, 0, 9, 7, 8] [8, 7, 6, 5, 5, 6, 7, 8] [8, 7, 2, 3, 3, 2, 7, 8] [8, 7, 6, 1, 1, 6, 7, 8] d. The outputs (total work and finished flag) of the following flow-chart: <pre><nowiki> (> 4 days left) ---> (procrastinate) ^ / (work >= 10) ---> (work is done) (<= 4 days left) ---> (add "5 - (#days left)" to work) </nowiki></pre> Your function should produce the following output for these (work,left) inputs ((6,0), (5,0), (4,0), (3,1), (2, 3), (1, 6)): 0, False 0, False 1, False 3, False 7, True 10, True 3. Write for-loop to do each of the following tasks: a. Build a list of 4 lines input by the user. Hint: use raw_input b. Count the number of times the letter "e" appears in a string named 'x'. c. Return the rot13 cipher of a lowercase string, "x.lower()" * Explanation: rot13 changes each letter to the letter that appears 13 characters later alphabetically, for example abc becomes nop while and ketchup becomes naq xrgpuhc * Hint: use (ord, chr, and the mod function), dont forget to subtract ord('a') a4c3d0be06fff987ddb70a82e007ee11f6d246e2 438 431 2016-02-08T17:30:53Z David M. Rogers 2 wikitext text/x-wiki Homework 2 -- types, functions, and substitution Due Monday, Feb. 8 Use the following code as reference for problem 1: <source lang="python"> from numpy.random import uniform from math import cos, sin, acos, pi def atom_str(x, y, z, at, res, type=" C ", resname="UNK "): return "ATOM %5d %3s %4s%5s %8.3f%8.3f%8.3f 1.00"%(at,type, \ resname,res,x,y,z) def polar2cart(r, th, phi): z = r*cos(phi) # z-axis part x = r*sin(phi) # x/y plane part y = x*sin(th) x = x*cos(th) return x, y, z def gen_sph_surfpt(): th = uniform(0.0, 2.0*pi) z = uniform(-1.0, 1.0) phi = acos(z) return th, phi R = 1000 out = open("test.pdb", 'w') for i in range(1000): u, v = gen_sph_surfpt() x, y, z = polar2cart(R, u, v) out.write(atom_str(x, y, z, i+1, 1)+'\n') out.close() </source> # In this code, name the type of each of the following: #* u #* gen_sph_surfpt #* polar2cart #** Make sure you use one of the following types: #** basic type: int / float / string / () #** derived type: [a], (a, b, c, ...) / a -> ... -> b -> c # Write code that computes each of the following patterns, but replaces the variable part with 'x' (and 'y', 'z', etc.). #* Be sure to write this as a function with "def f(x, y, etc.):" and use "return" to return the pattern as output. #* Also, write the type of the function you have produced. a. A list of all positive integers smaller than n ex: [0, 1, 2, 3, 4] [0, 1] [0, 1, 2, 3, 4, 5, 6, 7] b. The following sentence template: "The quick brown dog jumped over 5 foxes." "The terrible brown dog attacked 0 foxes." "The leaning brown dog replaced 99 foxes." "The absent brown dog confused 4 foxes." c. The following very similar lists: [8, 7, 4, 2, 2, 4, 7, 8] [8, 7, 9, 0, 0, 9, 7, 8] [8, 7, 6, 5, 5, 6, 7, 8] [8, 7, 2, 3, 3, 2, 7, 8] [8, 7, 6, 1, 1, 6, 7, 8] d. The outputs (total work and finished flag) of the following flow-chart: <pre><nowiki> (> 4 days left) ---> (procrastinate) ^ / (work >= 10) ---> (work is done) (<= 4 days left) ---> (add "5 - (#days left)" to work) </nowiki></pre> Your function should produce the following output for these (left,work) inputs ((6,0), (5,0), (4,0), (3,1), (2, 3), (1, 6)): 0, False 0, False 1, False 3, False 7, True 10, True 3. Write for-loop to do each of the following tasks: a. Build a list of 4 lines input by the user. Hint: use raw_input b. Count the number of times the letter "e" appears in a string named 'x'. c. Return the rot13 cipher of a lowercase string, "x.lower()" * Explanation: rot13 changes each letter to the letter that appears 13 characters later alphabetically, for example abc becomes nop while and ketchup becomes naq xrgpuhc * Hint: use (ord, chr, and the mod function), dont forget to subtract ord('a') c14668725ce2cd204ab1bb427bd748c8b46a94f9 439 438 2016-02-08T17:35:09Z David M. Rogers 2 wikitext text/x-wiki Homework 2 -- types, functions, and substitution Due Monday, Feb. 8 Use the following code as reference for problem 1: <source lang="python"> from numpy.random import uniform from math import cos, sin, acos, pi def atom_str(x, y, z, at, res, type=" C ", resname="UNK "): return "ATOM %5d %3s %4s%5s %8.3f%8.3f%8.3f 1.00"%(at,type, \ resname,res,x,y,z) def polar2cart(r, th, phi): z = r*cos(phi) # z-axis part x = r*sin(phi) # x/y plane part y = x*sin(th) x = x*cos(th) return x, y, z def gen_sph_surfpt(): th = uniform(0.0, 2.0*pi) z = uniform(-1.0, 1.0) phi = acos(z) return th, phi R = 1000 out = open("test.pdb", 'w') for i in range(1000): u, v = gen_sph_surfpt() x, y, z = polar2cart(R, u, v) out.write(atom_str(x, y, z, i+1, 1)+'\n') out.close() </source> # In this code, name the type of each of the following: #* u #* gen_sph_surfpt #* polar2cart #** Make sure you use one of the following types: #** basic type: int / float / string / () #** derived type: [a], (a, b, c, ...) / a -> ... -> b -> c # Write code that computes each of the following patterns, but replaces the variable part with 'x' (and 'y', 'z', etc.). #* Be sure to write this as a function with "def f(x, y, etc.):" and use "return" to return the pattern as output. #* Also, write the type of the function you have produced. a. A list of all positive integers smaller than n ex: [0, 1, 2, 3, 4] [0, 1] [0, 1, 2, 3, 4, 5, 6, 7] b. The following sentence template: "The quick brown dog jumped over 5 foxes." "The terrible brown dog attacked 0 foxes." "The leaning brown dog replaced 99 foxes." "The absent brown dog confused 4 foxes." c. The following very similar lists: [8, 7, 4, 2, 2, 4, 7, 8] [8, 7, 9, 0, 0, 9, 7, 8] [8, 7, 6, 5, 5, 6, 7, 8] [8, 7, 2, 3, 3, 2, 7, 8] [8, 7, 6, 1, 1, 6, 7, 8] d. The outputs (total work and finished flag) of the following flow-chart: <pre><nowiki> (> 4 days left) ---> (procrastinate) ^ / (work >= 10) ---> (work is done) (<= 4 days left) ---> (add "5 - (#days left)" to work) </nowiki></pre> Your function should produce the following output for these (left,work) inputs : input output 6, 0 -> 0, False 5, 0 -> 0, False 4, 0 -> 1, False 3, 1 -> 3, False 2, 3 -> 7, False 1, 6 -> 10, True 3. Write for-loop to do each of the following tasks: a. Build a list of 4 lines input by the user. Hint: use raw_input b. Count the number of times the letter "e" appears in a string named 'x'. c. Return the rot13 cipher of a lowercase string, "x.lower()" * Explanation: rot13 changes each letter to the letter that appears 13 characters later alphabetically, for example abc becomes nop while and ketchup becomes naq xrgpuhc * Hint: use (ord, chr, and the mod function), dont forget to subtract ord('a') e1525ad56ffdcb2696fc8248cce544adf1ff3fd0 Code 0 18 432 344 2016-01-28T15:33:38Z David M. Rogers 2 /* C Libraries */ wikitext text/x-wiki This page contains a list of codes we've found useful for scientific HPC from a developer's perspective. To use existing codes, check out [[Best Practices]]. == Tutorials == When learning a new language, once you've memorized the words, you need to start conversing. Unfortunately, source code is not spoken. It's a stillborn language. One of the best ways to code well is to study and modify other, good code. For code, this means reading and tweaking tutorials first, then design patterns, then large-scale projects next. * [http://matt.might.net/articles/bash-by-example Bash By Example] * [http://docs.python.org/3/tutorial/datastructures.html Data Structures in Python] * [http://www.u.arizona.edu/~erdmann/mse350/topics/basic_linear_algebra.html Linear Algebra in Numpy] * [[Code:gmxliquid|Liquid Structure With Gromacs]] Remember that it's not enough to just read them. It's actually a positive waste of time. Rather, you have to do some run-tweak-run-debug development cycles with them. == Publication-related Code == * [[Code:realpole]] Real-space quadrature implementation of multipole electrostatics. == C Libraries == With the exception of the standard libraries and the [http://www.gnu.org/software/gsl/ GNU Scientific Library], there are surprisingly few of these about. Here are some generics that we've implemented and are sharing under the GPL. Robust map and red/black tree code has recently been published to [https://github.com/frobnitzem?tab=repositories github]. The amazing, smallish, extensible, final-form, lambda interpreter in C [http://predictivestatmech.org/code/lambda_final.c]. == Python Libraries == * [[Code:libnwchem|libnwchem]] A patch against Nwchem 6.5 to build its functionality as a shared library, along with glue code for access using python ctypes. * [[Code:networkx|Networkx]] a quick guide. === Geometric Algebra === The [http://www.predictivestatmech.org/code/galg.py Multivector] class implements geometric algebra using Python's operator overloading. It works with minimal space for any number of spatial dimensions, since it's not based on the matrix / spinor representation of Clifford algebra. Instead, it takes the basis blade approach recommended by Dorst, Fondijne, and Mann [http://www.geometricalgebra.net]. It's really just as easy as ordering all the basis vectors, and keeping track of the commutator (+/- <math>\hat 1</math>). == Templates == The real world has forms, computation has templates. Pick one up, fill in the blanks, and send it down the chute. * [[NWChem|NWChem Jobs]] * [[Code:SLURM|Slurm (USF Circe)]] * [[Code:SGE|SGE (USF Circe)]] * [[Code:text2pdf|Text conversion using text2pdf]] == Efficiencies == To chop a tree quickly, spend twice the time sharpening your axe. * [[Vimrc|vimrc files]] == Code Humor == Put this into your makefile: <source lang=bash> Clint\ Eastwood: myday echo "I feel great!" </source> b594adc9f72026a54582fe45e439151d8be0a26e File:Week5.pdf 6 94 442 2016-02-10T20:59:08Z David M. Rogers 2 wikitext text/x-wiki da39a3ee5e6b4b0d3255bfef95601890afd80709 CompSciHW3 0 95 444 2016-02-12T15:19:41Z David M. Rogers 2 Created page with "= Homework 3 - Due Friday., Feb. 19 = <pre> 1. Replace the re-used constants in the following code with appropriate names, and list their types: example: P = 1500..." wikitext text/x-wiki = Homework 3 - Due Friday., Feb. 19 = <pre> 1. Replace the re-used constants in the following code with appropriate names, and list their types: example: P = 150000.0 - 30000. -> cost = 150000.00 # float P += P*0.03/12 - 1300. down = 30000.00 # float P += P*0.03/12 - 1300. payment = 1300.0 # float P += P*0.03/12 - 1300. rate = 0.03/12 # float ... P = cost - down P += P*rate - payment a) x = 0.5 x = x*(1-x)*0.04 x = x*(1-x)*0.04 b) y = [] y.append([4,5,6]) y.append([5,6,4]) y.append([6,4,5]) c) def calc_E(x): return x*x*200.0/2.0 def calc_F(x): return -x*200.0 2. Write a function returning the pattern for each of the following: example: c_op_list = [ sqrt(2.0/kappa * 0.8)*a.dag(), sqrt(2.0/kappa * 0.2)*a ] c_op_list = [ sqrt(2.0/kappa * 0.1)*a.dag(), sqrt(2.0/kappa * 0.9)*a ] answer (the names are arbitrary of course): def mk_ops(p): return [ sqrt(2.0/kappa*p)*a.dag(), sqrt(2.0/kappa * (1.0-p))*a ] a) 5 equally spaced numbers from 0.0 to x: [0.0, 0.1, 0.2, 0.3, 0.4] [0.0, 0.5, 1.0, 1.5, 2.0] [0.0, -0.2, -0.4, -0.6, -0.8] b) Substitution into the polynomial: (-3*5 + 2)*5 + 7 (-3*0 + 2)*0 + 7 (-3*10 + 2)*10 + 7 c) The or operation -- From two inputs, the function returns True or False: True, True -> True False, True -> True True, False -> True False, False -> False 3. Write a for-loop to create a list with 100 iterations of the Tinkerbell map for a=0.3, b=0.6000, c=2.0, d=0.27 (https://en.wikipedia.org/wiki/Tinkerbell_map): xp = x*(x+a) - y*(y-b) yp = 2*x*y + c*x + d*y # Remember to update x,y to the new values, xp,yp after each iteration! 4. Write a code to open the file "iterates.dat" for writing, write 100 strings to the file (you can use the iterates from the last problem or any other string) and close it. 5. Write a code to open "iterates.dat" for reading and print out each line. </pre> Experiment on your own with plotting commands! <source lang="python"> import matplotlib.pyplot as plt plt.plot(range(10,1,-1), 'o') plt.show() # plt.savefig("test.png", dpi=200) # alternative to show() </source> 8559bbecca6a068cd92cf15ec36da2b3e48b0383 HowTo:Fourier 0 70 447 326 2016-02-15T19:40:36Z David M. Rogers 2 wikitext text/x-wiki The Fourier transform is such a useful fundamental tool, it deserves its own howto (as opposed to a simple [[Code]]). The Fourier transform is a transformation of a function into another function. The transformation can (in almost all cases) be reversed. = Analogies = Before getting started, a few analogies are helpful. Sound comes from acoustic pressure waves -- so you hear middle C when your ear feels a time-varying pressure at precisely 261.6 Hz (1 Hz = 1 cycle per second). The pressure signal would be <math>P(t) \propto cos(2 \pi (261.6 t))</math> -- so that 1/261.6 second goes in a complete cycle, from 0 to <math>2\pi</math> radians. Fourier transforming that signal gives a function that is zero everywhere except for <math>k = 261.6</math> -- a delta function. The transform of a pure sin or cos wave is always a delta function -- peaked at one particular frequency. If you shift the phase of the sin or cos wave (say by <math>\Delta \theta = 2 \pi (261.6 \Delta t)</math>) this shows up in Fourier space as a phase factor, <math>\exp(i\Delta \theta)</math>, which does not change the magnitude. Light comes from electromagnetic waves. In parking lots, you can usually see the grungy yellow/orange color of 589.29 nm light from cheap high-pressure sodium lights. This is because your eye is experiencing a time-varying electric field at a frequency of <math>3\cdot 10^{17}</math> nm/s / 589.29 nm <math>\simeq</math> 510 THz. = Definition = The Fourier transform of <math>f(x)</math> is defined as <math> F(k) = \int_{-\infty}^\infty f(x) e^{-2\pi i k x} \; dx </math> You can immediately see why the Fourier transform of a pure wave, <math>f(x) = e^{2\pi i s x}</math>, is centered on <math>k = s</math>. All the other test frequencies, <math>k</math>, create oscillatory integrands, <math> e^{2\pi i (s - k) x} </math> so the integral always cancels, unless <math>s = k</math>, where it shoots to infinity (<math>F(k) = \delta(k-s)</math>). The Fourier transform `picks up' all these pure frequencies. You can see this by noting the transform of a bunch of pure waves, <math> g(x) = \sum_j a_j e^{2\pi i k_j x} </math> which is a sum over all the pure frequencies, <math>G(k) = \sum_j a_j \delta(k-k_j) </math> The reverse of the Fourier transform is just another Fourier transform. This time, the direction of oscillation has to change, though: <math> f(x) = \int_{-\infty}^\infty F(k) e^{2\pi i k x} \; dk </math> For visually understanding the Fourier transform, it's helpful to plot both sides of a table of transforms. We already showed that the transform of a wave is a delta function, and vice-versa. This means the transform of a constant is a delta function centered at zero. As another example, the transform of a Gaussian function is another Gaussian function. == Other Definitions == Note that there are other definitions of the Fourier transform. These are all related to the above, by scaling <math>k \to \nu/a</math>, so <math> F_a(\nu) = \int_{-\infty}^\infty f(x) e^{-\frac{2\pi}{a} i\nu x} \; dx </math> and <math> f(x) = |a^{-1}| \int_{-\infty}^\infty F_a(\nu) e^{\frac{2\pi}{a} i\nu x} \; d\nu </math> Common variations are <math>a = -1</math> and <math>a = \pm 2\pi</math>. Note that these formulas aren't applicable for imaginary <math>a</math>. If you do that, you'll end up translating the Fourier theory into its equivalent -- analytic continuations of Laplace transforms and their inverse via Bromwich contours. = Discrete Version = The discrete Fourier transform is one limit of the continuous one, where the integral is replaced by the sum. Before introducing this, however, it's helpful to introduce the Fourier transform on a circle. <math> F_L(k) = \int_0^L f(x) e^{-2\pi i k x / L} \; dx </math> The integral runs over 0 to L, at which point the function is considered to be periodic -- i.e. <math>f(0) = f(L)</math>. This definition is consistent with the `other definitions' above, for <math>a = L</math>. Now, because the function is periodic, the test functions should be also. This means we only need to collect the values of <math>F_L(k)</math> at integer values of <math>k = n = 0, \pm 1, \ldots</math> -- those for which the test functions are periodic. Conversely, given a finite set of frequency values, we can make good approximations of the function using the inverse Fourier transform, <math> f(x) \simeq \sum_{n=-M/2}^{M/2} a_n e^{2\pi i n x / L} </math> Now we have a computational way to represent the Fourier transform -- a set of coefficients, <math>\{a_n\}_{-M/2}^{M/2}</math>. Each coefficient belongs to a basis function -- called a `plane-wave' basis in physics because of its oscillation as <math>x</math> varies along the direction of travel of the wave. To complete the picture, let's introduce a set of <math>M</math> equally spaced sampling points, <math>x_m/L = m / M</math>. The inverse Fourier transform at these points is then a polynomial, <math>f(x_m) \simeq \sum_{n=0}^{M-1} a_n \omega^{nm} </math> where <math>\omega = e^{2\pi i/M}</math>. Moreover, given the set <math>f(x_m) = b_m</math>, the inverse of the inverse is <math>a_n = \frac{1}{M}\sum_{m=0}^{M-1} b_m \omega^{-nm} </math> These last two are the discrete Fourier transform. They are polynomials in the <math>M^{th}</math> roots of unity, <math>\omega</math>. For one last caveat, note that the scaling by <math>1/M</math> is not done at all in the fftw library, whereas it is done on the ''reverse'' transform in the numpy library (fft.ifft). = Efficient DFT = There are efficient ways of computing the discrete Fourier transform. They derive from noting that <math>\omega^{n+M/2} = \omega^{-n}</math> (for even <math>M</math>). = Wiener–Khinchin Theorem = Remember that shifting a function <math>f(x) \to f(x-y)</math> in real space translates to multiplying by a phase factor in Fourier space? This makes it really easy to compute integrals of the form: <math>(f*g)(x) = \int_0^L f(x-y) g(y) \; dy </math> in Fourier space. They are called convolutions, and represent for example, the correlation between <math>f</math> and <math>g</math> at 2 points separated by the distance <math>x</math>, or the probability distribution of the sum of 2 numbers -- one drawn from <math>f</math> and the other from <math>g</math>, or the matrix multiplication between Circulant matrices. The first interpretation leads to the Wiener–Khinchin Theorem, which states that the power spectrum (in Fourier space) is the transform of the autocorrelation function (in real space). Computing the convolution at points <math>x_M</math> looks at first like it will take <math>O(M^2)</math> time, since the integral becomes a discrete dot product and we have <math>M</math> of them to compute. For 3D data, this is prohibitively expensive. In Fourier-land, the convolution is a direct product, and takes only <math>M</math> operations! We'll derive it in the discrete case by Fourier transforming the result, <math>f*g</math>, <math>FG(n) = \frac{1}{M}\sum_{m=0}^{M-1}\sum_{j=0}^{M-1} f(x_{m-j})g(x_j) \omega^{-nm} </math> Since <math>f</math> is periodic, we can shift <math>m \to m+j</math> and the sum still runs over <math>m=-j,\ldots,M-j-1</math>, which is the same as <math>0,\ldots,M-1</math>. <math>FG(n) = \frac{1}{M}\sum_{m=0}^{M-1}\sum_{j=0}^{M-1} f(x_m)g(x_j) \omega^{-nm}\omega^{-nj} = M F(n) G(n) </math> Because the product takes <math>M</math> operations, the Fourier transformations of <math>f,g,FG</math> are the time-limiting steps in this process. Nevertheless, we've reduced <math>M^2</math> operations to <math>M + 3 M \log M</math> operations. Notice how the starting formula looks a lot like matrix multiplication with <math>f_{mj} = f(x_m-x_j)</math>? This type of matrix multiplication is one of the major computational uses of the Fourier transform. = FFT-ing with Numpy = Finally, some code. You can verify the particular definition of the DFT used by numpy by, what else, Fourier transforming a delta function: <source lang="python"> from numpy import * x = zeros(16) x[1] = 1.0 y = fft.fft(x) print y print exp(-2j*pi/16.0) # omega print exp(-2j*pi*arange(16)/16.0) </source> You should also double-check that the inverse, '''fft.ifft''', works as advertised. Note that this means it must divide by <math>M=16</math> here. Now for some thought-provoking questions: # What is the special significance of the zero-frequency component, '''y[0]'''? # What is the relationship between the transform at frequencies <math>k</math> and <math>M-k</math>? ## How does this relationship depend on functions that are real vs. contain some imaginary numbers? # What special property does the transform have if the function is even (<math>f(x) = f(L-x)</math>)? ## Construct an even function numerically and test this out. ## ... if the function is odd (<math>f(x) = -f(L-x)</math>)? # Why does it make sense to look at the magnitude ('''y.real**2+y.imag**2''') and the phase ('''arctan2(y.imag,y.real)''') of the Fourier transform separately? = Properties = The following properties make the discrete Fourier transform useful: Convolution: <math>F[f * g](n) = F[f](n) F[g](n) </math> Differentiation: <math>F[f_{m+1} - f_m](n) = (\omega^{n} - 1) F[f](n) </math> Representation of Delta: <math>F[\delta_{m-j}] = \omega^{-jn} </math> Parseval: <math>\sum_{m=0}^{M-1} f(m) g(m) = \frac{1}{M}\sum_{n=0}^{M-1} F[f](n) F[g](n) </math> bcd96cfceeb2ba090516307d9954fea52efefa88 File:Midterm.pdf 6 96 449 2016-02-17T17:17:17Z David M. Rogers 2 wikitext text/x-wiki da39a3ee5e6b4b0d3255bfef95601890afd80709 CompSciHW4 0 97 454 2016-02-19T18:53:48Z David M. Rogers 2 Created page with "<pre> Homework 4: 1. Write down the types for the following standard python functions. Hint: Consult the text, use help() and try out example function calls. a) str.coun..." wikitext text/x-wiki <pre> Homework 4: 1. Write down the types for the following standard python functions. Hint: Consult the text, use help() and try out example function calls. a) str.count b) list.reverse c) str.strip d) str.split e) len 2. For each of the following, define any function that has that type. You must use all the arguments when creating the return value. Example: str -> int -> str Answer: def f(x, i) return x + str(i) a) int -> float b) str -> [str] c) (int,int) -> (float,float) d) int -> int -> int e) str -> str -> str 3. Replace the constants and the variables in the following patterns. Create a single function returning the pattern. Define the constants outside the function. Example: Answer: open("test1.dat", 'r') mode = 'r' open("test2.dat", 'r') def f(name): open("test3.dat", 'r') return open(name, mode) a) pretty-printed data "Atom %d coords %f %f %f"%(1, 1.1, 3.3. 0.0) "Atom %d coords %f %f %f"%(2,-1.2, 7.9. 0.0) "Atom %d coords %f %f %f"%(3, 2.3,-1.4. 0.0) b) tagged data ("A1",1.1, [(1,2), (1,3)]) ("A2",-1.2, [(1,2), (1,3)]) ("B1",7.6, [(1,2), (1,3)]) ("B2",-1.4, [(1,2), (1,3)]) c) scaled arange x = [] for i in range(17): x.append(i*(4.0 - 2.3)/(17-1.0) + 2.3) x = [] for i in range(22): x.append(i*(4.0 - 2.3)/(22-1.0) + 2.3) x = [] for i in range(50): x.append(i*(4.0 - 2.3)/(50-1.0) + 2.3) d) status report print "Converged in %d iterations, residual = %e."%(100,1.7e-5) print "Converged in %d iterations, residual = %e."%(553,4.9e-10) print "Converged in %d iterations, residual = %e."%(201,8.3e-4) e) logistic map simulation x = 0.5 vals = [] for i in range(100 + 50): vals.append(x) x = 3.7*x*(1.0-x) return vals[50:] x = 0.5 vals = [] for i in range(100 + 50): vals.append(x) x = 3.1*x*(1.0-x) return vals[50:] x = 0.5 vals = [] for i in range(100 + 50): vals.append(x) x = 2.8*x*(1.0-x) return vals[50:] f) scaled and shifted random numbers (from numpy import random) random.standard_normal(10)*20.0 - 5.0 random.standard_normal(10)*10.0 - 25.0 random.standard_normal(10)*2.0 + 5.0 g) The count " ".join(map(str, range(4))) " ".join(map(str, range(10, 0, -1))) " ".join(map(str, range(9, 22))) h) Summing random numbers (from numpy import random) x = sum(random.random()*2.0 for i in range(4)) x = sum(random.random()*2.0 for i in range(10)) x = sum(random.random()*2.0 for i in range(20)) i) trying combinations in a sequence for x in range(3): for y in range(4, 7): if x^y == 7: break if x^y == 7: break for x in range(3): for y in range(4, 7): if x^y == 4: break if x^y == 4: break for x in range(3): for y in range(4, 7): if x^y == 9: break if x^y == 9: break j) writing a list to a file (the entire list is the variable) out = open("list.dat", 'w') out.write("\n".join(map(str, [1,2,3,3,4])) + "\n") out.close() out = open("list.dat", 'w') out.write("\n".join(map(str, [-3,3,1,2])) + "\n") out.close() out = open("list.dat", 'w') out.write("\n".join(map(str, [7,7,1])) + "\n") out.close() </pre> 921e9230559620bb7189219274ed075407911177 455 454 2016-02-19T18:54:15Z David M. Rogers 2 wikitext text/x-wiki Homework 4 - Due Friday, February 26, 2016. <pre> 1. Write down the types for the following standard python functions. Hint: Consult the text, use help() and try out example function calls. a) str.count b) list.reverse c) str.strip d) str.split e) len 2. For each of the following, define any function that has that type. You must use all the arguments when creating the return value. Example: str -> int -> str Answer: def f(x, i) return x + str(i) a) int -> float b) str -> [str] c) (int,int) -> (float,float) d) int -> int -> int e) str -> str -> str 3. Replace the constants and the variables in the following patterns. Create a single function returning the pattern. Define the constants outside the function. Example: Answer: open("test1.dat", 'r') mode = 'r' open("test2.dat", 'r') def f(name): open("test3.dat", 'r') return open(name, mode) a) pretty-printed data "Atom %d coords %f %f %f"%(1, 1.1, 3.3. 0.0) "Atom %d coords %f %f %f"%(2,-1.2, 7.9. 0.0) "Atom %d coords %f %f %f"%(3, 2.3,-1.4. 0.0) b) tagged data ("A1",1.1, [(1,2), (1,3)]) ("A2",-1.2, [(1,2), (1,3)]) ("B1",7.6, [(1,2), (1,3)]) ("B2",-1.4, [(1,2), (1,3)]) c) scaled arange x = [] for i in range(17): x.append(i*(4.0 - 2.3)/(17-1.0) + 2.3) x = [] for i in range(22): x.append(i*(4.0 - 2.3)/(22-1.0) + 2.3) x = [] for i in range(50): x.append(i*(4.0 - 2.3)/(50-1.0) + 2.3) d) status report print "Converged in %d iterations, residual = %e."%(100,1.7e-5) print "Converged in %d iterations, residual = %e."%(553,4.9e-10) print "Converged in %d iterations, residual = %e."%(201,8.3e-4) e) logistic map simulation x = 0.5 vals = [] for i in range(100 + 50): vals.append(x) x = 3.7*x*(1.0-x) return vals[50:] x = 0.5 vals = [] for i in range(100 + 50): vals.append(x) x = 3.1*x*(1.0-x) return vals[50:] x = 0.5 vals = [] for i in range(100 + 50): vals.append(x) x = 2.8*x*(1.0-x) return vals[50:] f) scaled and shifted random numbers (from numpy import random) random.standard_normal(10)*20.0 - 5.0 random.standard_normal(10)*10.0 - 25.0 random.standard_normal(10)*2.0 + 5.0 g) The count " ".join(map(str, range(4))) " ".join(map(str, range(10, 0, -1))) " ".join(map(str, range(9, 22))) h) Summing random numbers (from numpy import random) x = sum(random.random()*2.0 for i in range(4)) x = sum(random.random()*2.0 for i in range(10)) x = sum(random.random()*2.0 for i in range(20)) i) trying combinations in a sequence for x in range(3): for y in range(4, 7): if x^y == 7: break if x^y == 7: break for x in range(3): for y in range(4, 7): if x^y == 4: break if x^y == 4: break for x in range(3): for y in range(4, 7): if x^y == 9: break if x^y == 9: break j) writing a list to a file (the entire list is the variable) out = open("list.dat", 'w') out.write("\n".join(map(str, [1,2,3,3,4])) + "\n") out.close() out = open("list.dat", 'w') out.write("\n".join(map(str, [-3,3,1,2])) + "\n") out.close() out = open("list.dat", 'w') out.write("\n".join(map(str, [7,7,1])) + "\n") out.close() </pre> c315bc36e3f18aad370d41997a77fb489640653b CompSciHW5 0 98 456 2016-02-19T18:55:05Z David M. Rogers 2 Created page with "Homework 6 - Due Friday, March 4, 2016 <pre> 1) Create a function that parses the following files: a) mat33 = """ 1.0 2.0 3.0 -2.0 0.0 1.0 1.0 1.1 1.2 """ b) csv = """ # ti..." wikitext text/x-wiki Homework 6 - Due Friday, March 4, 2016 <pre> 1) Create a function that parses the following files: a) mat33 = """ 1.0 2.0 3.0 -2.0 0.0 1.0 1.0 1.1 1.2 """ b) csv = """ # time temperature sea_level 0.0, 300.0, 44.5 1.5, 299.5, 44.0 3.0, 299.8, 44.2 4.5, 301.0, 43.9 """ c) name_val = """ seed = 1553 name = "test name" trials = 10 tolerance = 1e-8 """ d) group_data = """ [Group 1] 1 2 3 4 5 6 [Group 2] 4 5 11 14 1 [Group 3] 7 8 9 10 11 """ 2) Write code to carry out matrix multiplication manually and test it against the result of numpy.dot. 3) Write code to multiply every column of matrix, A, with every other column. Use this to find the set of angles between the column vectors. </pre> 2f123ea90af7a8558a594b34648ad6ac0499f642 457 456 2016-02-19T18:55:39Z David M. Rogers 2 wikitext text/x-wiki Homework 5 - Due Friday, March 4, 2016 <pre> 1) Use numpy and pyplot to plot the following functions: (remember to start by choosing an appropriate range for x) a) f(x) = sin(x) cos(2x) b) g(x) = x (if x is in 0,1), 2-x (if x is in 1,2), 0 otherwise c) h(x) = exp(-x*x/(2*sigma)), for sigma = 1, 2, and 3 d) w(x) = g(x) - 4*g(x-2.0) 2) Name the type of the following functions: (remember that *a means a list is input and **a means a dictionary) a) def joinwith(space, *a): return space.join(a) b) def map_on_n(f, n): return [f(i) for i in range(n)] c) def get_elem(k="default", **d): return d[k] + 2.0 d) def chaos(*a, **b): return random.random()*random.random() </pre> 6901735a9880103f16e0e122404924335bed2fea 458 457 2016-02-19T18:57:17Z David M. Rogers 2 wikitext text/x-wiki Homework 5 - Due Friday, March 4, 2016 <pre> 1) Use numpy and pyplot to plot the following functions: (remember to start by choosing an appropriate range for x) a) f(x) = sin(x) cos(2x) b) g(x) = x (if x is in 0,1), 2-x (if x is in 1,2), 0 otherwise c) h(x) = exp(-x*x/(2*sigma)), for sigma = 1, 2, and 3 d) w(x) = g(x) - 4*g(x-2.0) e) u(x, y) = sin(x)*cos(3*y) - cos(2*x)*sin(y) [Hint: use pylab.imshow()] 2) Name the type of the following functions: (remember that *a means a list is input and **a means a dictionary) a) def joinwith(space, *a): return space.join(a) b) def map_on_n(f, n): return [f(i) for i in range(n)] c) def get_elem(k="default", **d): return d[k] + 2.0 d) def chaos(*a, **b): return random.random()*random.random() e) def sliceof(st, stop, step, *a): return a[st:stop:step] </pre> 6693ace39cdb54c1fb2036199d36f3172bac3c95 CompSciHW6 0 99 459 2016-02-19T18:58:24Z David M. Rogers 2 Created page with "Homework 6 - Due Friday, March 18 <pre> 1) Create a function that parses the following files: a) mat33 = """ 1.0 2.0 3.0 -2.0 0.0 1.0 1.0 1.1 1.2 """ b) csv = """ # time te..." wikitext text/x-wiki Homework 6 - Due Friday, March 18 <pre> 1) Create a function that parses the following files: a) mat33 = """ 1.0 2.0 3.0 -2.0 0.0 1.0 1.0 1.1 1.2 """ b) csv = """ # time temperature sea_level 0.0, 300.0, 44.5 1.5, 299.5, 44.0 3.0, 299.8, 44.2 4.5, 301.0, 43.9 """ c) name_val = """ seed = 1553 name = "test name" trials = 10 tolerance = 1e-8 """ d) group_data = """ [Group 1] 1 2 3 4 5 6 [Group 2] 4 5 11 14 1 [Group 3] 7 8 9 10 11 """ 2) Write code to carry out matrix multiplication manually and test it against the result of numpy.dot. 3) Write code to multiply every column of matrix, A, with every other column. Use this to find the set of angles between the column vectors. </pre> 81d3a8140d8c964c2874c22872ce6fdfab300d64 Gorillaz Code 0 100 461 2016-02-24T17:27:16Z David M. Rogers 2 Created page with "Use the following image files: [[File:L.png]] [[File:R.png]] [[File:banana.png]]" wikitext text/x-wiki Use the following image files: [[File:L.png]] [[File:R.png]] [[File:banana.png]] 77d67911b7d755b9164daa77eab6ab58aadf5b99 465 461 2016-02-24T18:49:50Z David M. Rogers 2 wikitext text/x-wiki Use the following image files: [[File:L.png]] [[File:R.png]] [[File:banana.png]] And base your work on the following code: <source lang="python"> import matplotlib.pyplot as plt import Image, time import numpy as np # 0. Import some images L = np.array(Image.open("L.png")) # 208 x 208 R = np.array(Image.open("R.png")) # 205 x 205 ban = np.array(Image.open("banana.png")) # 105 x 100 L = L[:,:,0] R = R[:,:,0] ban = ban[:,:,0] #print L.shape, R.shape, ban.shape #exit() x0 = 100 y0 = 50 x1 = 500 y1 = 400 def draw(x, y): # 1. create an array Z = np.zeros((1000,1000)) # 2. Add images to array Z[x0:x0+208,y0:y0+208] = L Z[x1:x1+205,y1:y1+205] = R Z[x:x+105,y:y+100] = ban return Z Z = draw(300,50) # 3. show the array plt.imshow(Z, cmap = plt.cm.gray) plt.show() fig = plt.gcf() def animate(cb, args=(), n=200): tstart = time.time() data = cb(*args) im = plt.imshow(data, origin='lowerleft') for i in range(1, n): data = cb(*args) im.set_data(data) fig.canvas.draw() print "FPS:", n/(time.time() - tstart) #animate(draw, (50,100)) </source> 33d5af1ef3dfb11b8481c4a78ecfae62db06156c 469 465 2016-02-29T17:19:39Z David M. Rogers 2 wikitext text/x-wiki Use the following image files: [[File:L.png]] [[File:R.png]] [[File:banana.png]] And base your work on the following code: <source lang="python"> import matplotlib.pyplot as plt import Image, time import numpy as np # 0. Import some images L = np.array(Image.open("L.png")) # 208 x 208 R = np.array(Image.open("R.png")) # 205 x 205 ban = np.array(Image.open("banana.png")) # 105 x 100 L = L[:,:,0] R = R[:,:,0] ban = ban[:,:,0] #print L.shape, R.shape, ban.shape #exit() x0 = 100 y0 = 50 x1 = 500 y1 = 400 def draw(x, y): # 1. create an array Z = np.zeros((1000,1000)) # 2. Add images to array Z[x0:x0+208,y0:y0+208] = L Z[x1:x1+205,y1:y1+205] = R Z[x:x+105,y:y+100] = ban return Z Z = draw(300,50) # 3. show the array #plt.imshow(Z, cmap = plt.cm.gray) #plt.show() # Animate the array by calling draw() 200 times. def animate(cb, args=(), n=200): tstart = time.time() data = cb(*args) im = plt.imshow(data, origin='lowerleft') for i in range(1, n): data = cb(*args) im.set_data(data) fig.canvas.draw() print "FPS:", n/(time.time() - tstart) fig = plt.figure() ax = fig.add_subplot(111) win = fig.canvas.manager.window win.after(100, lambda: animate(draw, (50,100))) plt.show() </source> f8de139f970464c4453396424dbfe03f5880353f 474 469 2016-03-07T16:30:32Z David M. Rogers 2 David M. Rogers moved page [[Gorrilaz Code]] to [[Gorillaz Code]]: misspelling wikitext text/x-wiki Use the following image files: [[File:L.png]] [[File:R.png]] [[File:banana.png]] And base your work on the following code: <source lang="python"> import matplotlib.pyplot as plt import Image, time import numpy as np # 0. Import some images L = np.array(Image.open("L.png")) # 208 x 208 R = np.array(Image.open("R.png")) # 205 x 205 ban = np.array(Image.open("banana.png")) # 105 x 100 L = L[:,:,0] R = R[:,:,0] ban = ban[:,:,0] #print L.shape, R.shape, ban.shape #exit() x0 = 100 y0 = 50 x1 = 500 y1 = 400 def draw(x, y): # 1. create an array Z = np.zeros((1000,1000)) # 2. Add images to array Z[x0:x0+208,y0:y0+208] = L Z[x1:x1+205,y1:y1+205] = R Z[x:x+105,y:y+100] = ban return Z Z = draw(300,50) # 3. show the array #plt.imshow(Z, cmap = plt.cm.gray) #plt.show() # Animate the array by calling draw() 200 times. def animate(cb, args=(), n=200): tstart = time.time() data = cb(*args) im = plt.imshow(data, origin='lowerleft') for i in range(1, n): data = cb(*args) im.set_data(data) fig.canvas.draw() print "FPS:", n/(time.time() - tstart) fig = plt.figure() ax = fig.add_subplot(111) win = fig.canvas.manager.window win.after(100, lambda: animate(draw, (50,100))) plt.show() </source> f8de139f970464c4453396424dbfe03f5880353f File:L.png 6 101 462 2016-02-24T17:27:42Z David M. Rogers 2 wikitext text/x-wiki da39a3ee5e6b4b0d3255bfef95601890afd80709 File:R.png 6 102 463 2016-02-24T17:28:06Z David M. Rogers 2 wikitext text/x-wiki da39a3ee5e6b4b0d3255bfef95601890afd80709 File:Banana.png 6 103 464 2016-02-24T17:28:26Z David M. Rogers 2 wikitext text/x-wiki da39a3ee5e6b4b0d3255bfef95601890afd80709 CompSciSpring2016 0 85 466 460 2016-02-29T17:14:07Z David M. Rogers 2 /* Notes */ wikitext text/x-wiki '''<BIG>Introduction to Scientific Computing</BIG>''' Course Info * Course Numbers CHM 4932-004/6938-010, CRN: 22347/22348 * Credit Hours: 3 * Meeting Dates: January 22 - April 27, 2016 ** No Class Jan. 18 or Mar. 14-19 * Meeting Times: Mon. and Wed., 12:30-13:45 in SCA 222 ** Lab Session & Office Hours: Fri. 12:30-13:45 in SCA 222 (or SCA 433) == Overview == Mathematical models in the natural sciences take many shapes and forms. The moment they become more complicated than tracking a few variables over time, we have to put away our Excel spreadsheets and make use of a solid foundation in computational science. The course establishes this foundation by introducing data structures and algorithms used in everyday scientific computing using examples in the python scripting language. By the end of the Semester, students will be able to navigate the Linux command-line to go from a mathematical model to a numerical solution. Best practices for working with computer code and visualizing data will also be covered. == Topics == # Languages #* bash (shell) #* python (scripting) #* stack & register-based machine languages: overview of C and Fortran syntax & compiling with gcc, ‘thread safety’ #* Shared libraries & language inter-operability (FFI) # Algorithms #* Horner’s algorithm for polynomials #* Newton’s root finding algo. #* Overview of general optimization algo-s (example: linear & nonlin. least-squares) #* Numerical integration (scripted, plus gnu ODE) #* Communication (how HTTP get/put works) # Data Structures #* Linked Lists #* Trees (file system hierarchies) #* Graphs #* Arrays (dense & sparse) example: vectors & rotations / transpositions, densities and difference operators # Presentation & visualization #* Flat CSV files (and excel) #* Working with binary data #* Python matplotlib (2D images) #* Binning histograms & weighted averages # Best Practices #* High-level code design (modularity, interface specifications, unit testing, etc.) #* Code audit: open-source libraries, ex. Gnu Scientific Library, qsort in libc, Boost #* Source code versioning (example: git or mercurial) #* gdb & execution profiling #* documentation #* Makefiles == Grading == '''Grading Scale (out of 400 points possible)''' {| class="wikitable" |- ! Grade ! Undergraduate ! Graduate |- | A | 230 | 300 |- | B | 180 | 230 |- | C | 150 | 180 |- | D | 120 | 150 |} * Points Possible: ** 10 homework assignments (20 points per homework) ** 2 projects / competitions (100 points per project) * Homework Rules ** For work done in groups, credit is divided equally among participants - so the max homework grade for a group of 2 is 10 points each. ** For each homework, 1 re-do at full credit can be sent at any time after the due date, but must present a unique solution to previous work from yourself or others. ** All work must cite co-group members (if any) and the source of any code snippets used online. === Grading Rationale === Homework points will only be awarded for correct, working code and correct algorithmic analysis, while the homework problems will become progressively tougher. Undergraduates should be able to pass the course with an A if they have correctly answered most of the homework, and made a strong attempt at one of the projects. Graduate students should both perform well on the homework and successfully complete one or two projects. Essentially, this means you should do your own homework when possible and may do a project in a small group. The re-grading and group options for homework allow making up for missed assignments, and encourage returning to core concepts at a later point in the class. Students who have completed significant portions of the homework have thus demonstrated programming proficiency, and are qualified for at least B/C grades. == Projects == === Midterm === A description for the midterm project is now available [[Media:midterm.pdf|here]]. The MD section will be updated as we discuss it in class. The due date for the midterm will be Friday, March 11. === Final === TBA == Textbooks and Resources == * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-0072-7 Beginning Python, Hetland, 2005] (eBook avail. from USF Library) * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-3238-4 Python Algorithms, Hetland, 2010] (eBook avail. from USF Library) * [http://aosabook.org/en/index.html The Architecture of Open Source Applications] * [http://docs.python.org Python Documentation] * [https://developers.google.com/edu/python/ Google Introductory Python Notes] * [http://huffman.sourceforge.net/tao/tao-of-programming.html Tao of Programming] Other (possibly useful) materials: * [http://hackersdictionary.com/html/entry/larval-stage.html The Jargon File] * Chapters 7&8 of Modelling and Simulation, Birta and Arbez, Springer 2007 (eBook avail. from USF Library). * Chapters 4-6 of Models and Algorithms for Intelligent Data Analysis, Runkler, Springer 2012 (eBook avail. from USF Library). * Guide to Scientific Computing in C++, Francis and Whiteley, Springer, 2012. (eBook avail. from USF Library) * Extra info. On the basics: ** Chapters 3 and 7 of Mathematics in Computing, Regan, Springer 2013. (eBook avail. from USF Library) ** Instant feedback graphical programming with [https://www.khanacademy.org/cs/programming/ Khan Academy] * [http://www.meetup.com/python-178/ Local PyBulls Meetings] Code: * [http://carsonfarmer.com/2013/07/essential-python-geo-libraries Python Libraries Useful for Geospatial Problems] * [[Code#Python_Libraries|Python Libraries Useful for Computational Chemistry]] (very small list at present) Interactive Interpreters: * [http://www.codewars.com CodeWars] Recommended for building experience with practice problems. * [http://exercism.io Exercism] A command-line client with a similar learn-through-challenge philosophy. * [http://repl.it repl.it] A read-eval-print loop for several computer languages. * [http://en.cppreference.com/w/cpp/language CppReference] Documentation with an online evaluator for C++ code. === Notes === * [[Media:intro.pdf|Notes]] for Week 1 ** Over the first two weeks or so, we'll be practicing the basics - so read through Chapters 1-3 of Hetland's Beginning Python during this time. ** [[PythonTranslated|Important Definitions]] * [[Media:Week2.pdf|Notes]] for Week 2 ** [[Code:Oware|Oware code]] ** Solutions for some problems in Week 2's notes: <source lang="python"> # simple data types "a string" # : str x = [1, 2, 3] # : [int] # compound data type (1, "name", (x, x)) # : (int, str, ([int], [int])) # add_one : int -> int # str.__add__ : str -> str -> str # str.split : str -> [str] # str.__mod__ : str -> (Objects) -> str </source> * [[Media:Week3.pdf|Notes]] for Week 3-4 ** Reading assignment - read through Chapter 5 and 6 (and practice dictionaries from Ch. 4) ** [[Code:for_patterns|Abstracting patterns]] in for loops. * [[Media:Week5.pdf|Notes]] for Week 5-6 ** Reading assignment - Read Chapter 10-11 (and refer to Ch. 4) * By this point, we've covered all the basics: ** base types: str, int, float, [a] ** variables and substitution: j vs "4" vs 4 ** indexing and slicing into lists / strings: x[1:4] or x[i:j] ** control flow: if and for syntax ** functions implementing patterns: def next(r, x): return r*x*(1-x) * You should be able to use these for: ** finding and abstracting the pattern ** naming the type of a function ** determining which variable names are in scope * All that's left is learning common uses, patterns and even more syntax! * In-Class Examples * [[Gorrilaz Code]] * [[File:wat3-ccsd.aim]] Output of Multiwfn for a Na+(H20)_3 molecular cluster. === Homework === * [[CompSciHW1|Homework 1]] is due Monday, January 25. * [[CompSciHW2|Homework 2]] is due Monday, February 8. * [[CompSciHW3|Homework 3]] is due Friday, February 19. * [[CompSciHW4|Homework 4]] is due Friday, February 26. * [[CompSciHW5|Homework 5]] is due Friday, March 4. == Group Work Pages == Group 1 [https://docs.google.com/document/d/1k6vruCx78aV0pL8Kw7WWtsw_-6zgdoeP0OvujSzbsh0/edit?usp=sharing]: Group 2 [https://docs.google.com/document/d/1MgpVly2D1h9Xt_lFh5ywa3b70Ul9ES6OQZtg5l_n0NM/edit?usp=sharing] Group 3 [https://docs.google.com/document/d/1LT_J-vObN9tPa1JoQ1B_h04ENsL5Ko2xeFeRMp-99f8/edit?usp=sharing] Group 4 [https://docs.google.com/document/d/1hGlNlg1w7_3qCo6LE-y9rSZx1Chwc0FBUoxK6cyzWW8/edit?usp=sharing] Substitution problem notes: <pre> Requirements: 1. Python object representing a spreadsheet 2. Ability to show the whole sheet (formulas) 3. Ability to compute the whole sheet (values) 4. Ability to update formula stored in a cell Cells: Example Cell Content: "A1 - B2*C2" A B C 1 A1 B1 C1 2 A2 B2 C2 3 A3 B3 C3 Hint 1: use str.replace : str -> str -> str -> str * fixed replacement order: A1, B1, C1, A2, B2, C2, ... "A1 - B2*C2".replace("A1", "5") Hint 2: use eval : str -> Object eval("5*3 - 4") vals = ["3", "4", "5", "A1", "A1 - 2*A2", "5", "", "", ""] vals = {"" : "3", } #? Hint 3: OK to print the easy way -- A1 = 5 + 2 A2 = A1*4 A3 = A1 - A2 Hint 4: Compute values in a separate sheet object. formulas -> values -- values["A1"] = formulas["A1"] values["B1"] = formulas["B1"].replace("A1", values["A1"]) values["C1"] = formulas["C1"].replace("B1", values["B1"]) values["C1"] = values["C1"].replace("A1", values["A1"]) values["A2"] = formulas["A2"] values["A2"] = values["A2"].replace("C1", values["C1"]) values["A2"] = values["A2"].replace("B1", values["B1"]) values["A2"] = values["A2"].replace("A1", values["A1"]) # Build the value of B2 from its formula. values["B2"] = formulas["B2"] values["B2"] = values["B2"].replace("A2", values["A2"]) values["B2"] = values["B2"].replace("C1", values["C1"]) values["B2"] = values["B2"].replace("B1", values["B1"]) values["B2"] = values["B2"].replace("A1", values["A1"]) </pre> 6a0d98861aa7a03548a1a69213dd897525b67673 468 466 2016-02-29T17:16:11Z David M. Rogers 2 /* Notes */ wikitext text/x-wiki '''<BIG>Introduction to Scientific Computing</BIG>''' Course Info * Course Numbers CHM 4932-004/6938-010, CRN: 22347/22348 * Credit Hours: 3 * Meeting Dates: January 22 - April 27, 2016 ** No Class Jan. 18 or Mar. 14-19 * Meeting Times: Mon. and Wed., 12:30-13:45 in SCA 222 ** Lab Session & Office Hours: Fri. 12:30-13:45 in SCA 222 (or SCA 433) == Overview == Mathematical models in the natural sciences take many shapes and forms. The moment they become more complicated than tracking a few variables over time, we have to put away our Excel spreadsheets and make use of a solid foundation in computational science. The course establishes this foundation by introducing data structures and algorithms used in everyday scientific computing using examples in the python scripting language. By the end of the Semester, students will be able to navigate the Linux command-line to go from a mathematical model to a numerical solution. Best practices for working with computer code and visualizing data will also be covered. == Topics == # Languages #* bash (shell) #* python (scripting) #* stack & register-based machine languages: overview of C and Fortran syntax & compiling with gcc, ‘thread safety’ #* Shared libraries & language inter-operability (FFI) # Algorithms #* Horner’s algorithm for polynomials #* Newton’s root finding algo. #* Overview of general optimization algo-s (example: linear & nonlin. least-squares) #* Numerical integration (scripted, plus gnu ODE) #* Communication (how HTTP get/put works) # Data Structures #* Linked Lists #* Trees (file system hierarchies) #* Graphs #* Arrays (dense & sparse) example: vectors & rotations / transpositions, densities and difference operators # Presentation & visualization #* Flat CSV files (and excel) #* Working with binary data #* Python matplotlib (2D images) #* Binning histograms & weighted averages # Best Practices #* High-level code design (modularity, interface specifications, unit testing, etc.) #* Code audit: open-source libraries, ex. Gnu Scientific Library, qsort in libc, Boost #* Source code versioning (example: git or mercurial) #* gdb & execution profiling #* documentation #* Makefiles == Grading == '''Grading Scale (out of 400 points possible)''' {| class="wikitable" |- ! Grade ! Undergraduate ! Graduate |- | A | 230 | 300 |- | B | 180 | 230 |- | C | 150 | 180 |- | D | 120 | 150 |} * Points Possible: ** 10 homework assignments (20 points per homework) ** 2 projects / competitions (100 points per project) * Homework Rules ** For work done in groups, credit is divided equally among participants - so the max homework grade for a group of 2 is 10 points each. ** For each homework, 1 re-do at full credit can be sent at any time after the due date, but must present a unique solution to previous work from yourself or others. ** All work must cite co-group members (if any) and the source of any code snippets used online. === Grading Rationale === Homework points will only be awarded for correct, working code and correct algorithmic analysis, while the homework problems will become progressively tougher. Undergraduates should be able to pass the course with an A if they have correctly answered most of the homework, and made a strong attempt at one of the projects. Graduate students should both perform well on the homework and successfully complete one or two projects. Essentially, this means you should do your own homework when possible and may do a project in a small group. The re-grading and group options for homework allow making up for missed assignments, and encourage returning to core concepts at a later point in the class. Students who have completed significant portions of the homework have thus demonstrated programming proficiency, and are qualified for at least B/C grades. == Projects == === Midterm === A description for the midterm project is now available [[Media:midterm.pdf|here]]. The MD section will be updated as we discuss it in class. The due date for the midterm will be Friday, March 11. === Final === TBA == Textbooks and Resources == * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-0072-7 Beginning Python, Hetland, 2005] (eBook avail. from USF Library) * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-3238-4 Python Algorithms, Hetland, 2010] (eBook avail. from USF Library) * [http://aosabook.org/en/index.html The Architecture of Open Source Applications] * [http://docs.python.org Python Documentation] * [https://developers.google.com/edu/python/ Google Introductory Python Notes] * [http://huffman.sourceforge.net/tao/tao-of-programming.html Tao of Programming] Other (possibly useful) materials: * [http://hackersdictionary.com/html/entry/larval-stage.html The Jargon File] * Chapters 7&8 of Modelling and Simulation, Birta and Arbez, Springer 2007 (eBook avail. from USF Library). * Chapters 4-6 of Models and Algorithms for Intelligent Data Analysis, Runkler, Springer 2012 (eBook avail. from USF Library). * Guide to Scientific Computing in C++, Francis and Whiteley, Springer, 2012. (eBook avail. from USF Library) * Extra info. On the basics: ** Chapters 3 and 7 of Mathematics in Computing, Regan, Springer 2013. (eBook avail. from USF Library) ** Instant feedback graphical programming with [https://www.khanacademy.org/cs/programming/ Khan Academy] * [http://www.meetup.com/python-178/ Local PyBulls Meetings] Code: * [http://carsonfarmer.com/2013/07/essential-python-geo-libraries Python Libraries Useful for Geospatial Problems] * [[Code#Python_Libraries|Python Libraries Useful for Computational Chemistry]] (very small list at present) Interactive Interpreters: * [http://www.codewars.com CodeWars] Recommended for building experience with practice problems. * [http://exercism.io Exercism] A command-line client with a similar learn-through-challenge philosophy. * [http://repl.it repl.it] A read-eval-print loop for several computer languages. * [http://en.cppreference.com/w/cpp/language CppReference] Documentation with an online evaluator for C++ code. === Notes === * [[Media:intro.pdf|Notes]] for Week 1 ** Over the first two weeks or so, we'll be practicing the basics - so read through Chapters 1-3 of Hetland's Beginning Python during this time. ** [[PythonTranslated|Important Definitions]] * [[Media:Week2.pdf|Notes]] for Week 2 ** [[Code:Oware|Oware code]] ** Solutions for some problems in Week 2's notes: <source lang="python"> # simple data types "a string" # : str x = [1, 2, 3] # : [int] # compound data type (1, "name", (x, x)) # : (int, str, ([int], [int])) # add_one : int -> int # str.__add__ : str -> str -> str # str.split : str -> [str] # str.__mod__ : str -> (Objects) -> str </source> * [[Media:Week3.pdf|Notes]] for Week 3-4 ** Reading assignment - read through Chapter 5 and 6 (and practice dictionaries from Ch. 4) ** [[Code:for_patterns|Abstracting patterns]] in for loops. * [[Media:Week5.pdf|Notes]] for Week 5-6 ** Reading assignment - Read Chapter 10-11 (and refer to Ch. 4) * By this point, we've covered all the basics: ** base types: str, int, float, [a] ** variables and substitution: j vs "4" vs 4 ** indexing and slicing into lists / strings: x[1:4] or x[i:j] ** control flow: if and for syntax ** functions implementing patterns: def next(r, x): return r*x*(1-x) * You should be able to use these for: ** finding and abstracting the pattern ** naming the type of a function ** determining which variable names are in scope * All that's left is learning common uses, patterns and even more syntax! * In-Class Examples * [[Gorrilaz Code]] * [[File:Wat3-ccsd.txt]] Output of Multiwfn for a Na+(H20)_3 molecular cluster. === Homework === * [[CompSciHW1|Homework 1]] is due Monday, January 25. * [[CompSciHW2|Homework 2]] is due Monday, February 8. * [[CompSciHW3|Homework 3]] is due Friday, February 19. * [[CompSciHW4|Homework 4]] is due Friday, February 26. * [[CompSciHW5|Homework 5]] is due Friday, March 4. == Group Work Pages == Group 1 [https://docs.google.com/document/d/1k6vruCx78aV0pL8Kw7WWtsw_-6zgdoeP0OvujSzbsh0/edit?usp=sharing]: Group 2 [https://docs.google.com/document/d/1MgpVly2D1h9Xt_lFh5ywa3b70Ul9ES6OQZtg5l_n0NM/edit?usp=sharing] Group 3 [https://docs.google.com/document/d/1LT_J-vObN9tPa1JoQ1B_h04ENsL5Ko2xeFeRMp-99f8/edit?usp=sharing] Group 4 [https://docs.google.com/document/d/1hGlNlg1w7_3qCo6LE-y9rSZx1Chwc0FBUoxK6cyzWW8/edit?usp=sharing] Substitution problem notes: <pre> Requirements: 1. Python object representing a spreadsheet 2. Ability to show the whole sheet (formulas) 3. Ability to compute the whole sheet (values) 4. Ability to update formula stored in a cell Cells: Example Cell Content: "A1 - B2*C2" A B C 1 A1 B1 C1 2 A2 B2 C2 3 A3 B3 C3 Hint 1: use str.replace : str -> str -> str -> str * fixed replacement order: A1, B1, C1, A2, B2, C2, ... "A1 - B2*C2".replace("A1", "5") Hint 2: use eval : str -> Object eval("5*3 - 4") vals = ["3", "4", "5", "A1", "A1 - 2*A2", "5", "", "", ""] vals = {"" : "3", } #? Hint 3: OK to print the easy way -- A1 = 5 + 2 A2 = A1*4 A3 = A1 - A2 Hint 4: Compute values in a separate sheet object. formulas -> values -- values["A1"] = formulas["A1"] values["B1"] = formulas["B1"].replace("A1", values["A1"]) values["C1"] = formulas["C1"].replace("B1", values["B1"]) values["C1"] = values["C1"].replace("A1", values["A1"]) values["A2"] = formulas["A2"] values["A2"] = values["A2"].replace("C1", values["C1"]) values["A2"] = values["A2"].replace("B1", values["B1"]) values["A2"] = values["A2"].replace("A1", values["A1"]) # Build the value of B2 from its formula. values["B2"] = formulas["B2"] values["B2"] = values["B2"].replace("A2", values["A2"]) values["B2"] = values["B2"].replace("C1", values["C1"]) values["B2"] = values["B2"].replace("B1", values["B1"]) values["B2"] = values["B2"].replace("A1", values["A1"]) </pre> a0f6888b1f0421d9f692063df0bead8eb1e32216 473 468 2016-03-07T16:29:33Z David M. Rogers 2 /* Notes */ wikitext text/x-wiki '''<BIG>Introduction to Scientific Computing</BIG>''' Course Info * Course Numbers CHM 4932-004/6938-010, CRN: 22347/22348 * Credit Hours: 3 * Meeting Dates: January 22 - April 27, 2016 ** No Class Jan. 18 or Mar. 14-19 * Meeting Times: Mon. and Wed., 12:30-13:45 in SCA 222 ** Lab Session & Office Hours: Fri. 12:30-13:45 in SCA 222 (or SCA 433) == Overview == Mathematical models in the natural sciences take many shapes and forms. The moment they become more complicated than tracking a few variables over time, we have to put away our Excel spreadsheets and make use of a solid foundation in computational science. The course establishes this foundation by introducing data structures and algorithms used in everyday scientific computing using examples in the python scripting language. By the end of the Semester, students will be able to navigate the Linux command-line to go from a mathematical model to a numerical solution. Best practices for working with computer code and visualizing data will also be covered. == Topics == # Languages #* bash (shell) #* python (scripting) #* stack & register-based machine languages: overview of C and Fortran syntax & compiling with gcc, ‘thread safety’ #* Shared libraries & language inter-operability (FFI) # Algorithms #* Horner’s algorithm for polynomials #* Newton’s root finding algo. #* Overview of general optimization algo-s (example: linear & nonlin. least-squares) #* Numerical integration (scripted, plus gnu ODE) #* Communication (how HTTP get/put works) # Data Structures #* Linked Lists #* Trees (file system hierarchies) #* Graphs #* Arrays (dense & sparse) example: vectors & rotations / transpositions, densities and difference operators # Presentation & visualization #* Flat CSV files (and excel) #* Working with binary data #* Python matplotlib (2D images) #* Binning histograms & weighted averages # Best Practices #* High-level code design (modularity, interface specifications, unit testing, etc.) #* Code audit: open-source libraries, ex. Gnu Scientific Library, qsort in libc, Boost #* Source code versioning (example: git or mercurial) #* gdb & execution profiling #* documentation #* Makefiles == Grading == '''Grading Scale (out of 400 points possible)''' {| class="wikitable" |- ! Grade ! Undergraduate ! Graduate |- | A | 230 | 300 |- | B | 180 | 230 |- | C | 150 | 180 |- | D | 120 | 150 |} * Points Possible: ** 10 homework assignments (20 points per homework) ** 2 projects / competitions (100 points per project) * Homework Rules ** For work done in groups, credit is divided equally among participants - so the max homework grade for a group of 2 is 10 points each. ** For each homework, 1 re-do at full credit can be sent at any time after the due date, but must present a unique solution to previous work from yourself or others. ** All work must cite co-group members (if any) and the source of any code snippets used online. === Grading Rationale === Homework points will only be awarded for correct, working code and correct algorithmic analysis, while the homework problems will become progressively tougher. Undergraduates should be able to pass the course with an A if they have correctly answered most of the homework, and made a strong attempt at one of the projects. Graduate students should both perform well on the homework and successfully complete one or two projects. Essentially, this means you should do your own homework when possible and may do a project in a small group. The re-grading and group options for homework allow making up for missed assignments, and encourage returning to core concepts at a later point in the class. Students who have completed significant portions of the homework have thus demonstrated programming proficiency, and are qualified for at least B/C grades. == Projects == === Midterm === A description for the midterm project is now available [[Media:midterm.pdf|here]]. The MD section will be updated as we discuss it in class. The due date for the midterm will be Friday, March 11. === Final === TBA == Textbooks and Resources == * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-0072-7 Beginning Python, Hetland, 2005] (eBook avail. from USF Library) * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-3238-4 Python Algorithms, Hetland, 2010] (eBook avail. from USF Library) * [http://aosabook.org/en/index.html The Architecture of Open Source Applications] * [http://docs.python.org Python Documentation] * [https://developers.google.com/edu/python/ Google Introductory Python Notes] * [http://huffman.sourceforge.net/tao/tao-of-programming.html Tao of Programming] Other (possibly useful) materials: * [http://hackersdictionary.com/html/entry/larval-stage.html The Jargon File] * Chapters 7&8 of Modelling and Simulation, Birta and Arbez, Springer 2007 (eBook avail. from USF Library). * Chapters 4-6 of Models and Algorithms for Intelligent Data Analysis, Runkler, Springer 2012 (eBook avail. from USF Library). * Guide to Scientific Computing in C++, Francis and Whiteley, Springer, 2012. (eBook avail. from USF Library) * Extra info. On the basics: ** Chapters 3 and 7 of Mathematics in Computing, Regan, Springer 2013. (eBook avail. from USF Library) ** Instant feedback graphical programming with [https://www.khanacademy.org/cs/programming/ Khan Academy] * [http://www.meetup.com/python-178/ Local PyBulls Meetings] Code: * [http://carsonfarmer.com/2013/07/essential-python-geo-libraries Python Libraries Useful for Geospatial Problems] * [[Code#Python_Libraries|Python Libraries Useful for Computational Chemistry]] (very small list at present) Interactive Interpreters: * [http://www.codewars.com CodeWars] Recommended for building experience with practice problems. * [http://exercism.io Exercism] A command-line client with a similar learn-through-challenge philosophy. * [http://repl.it repl.it] A read-eval-print loop for several computer languages. * [http://en.cppreference.com/w/cpp/language CppReference] Documentation with an online evaluator for C++ code. === Notes === * [[Media:intro.pdf|Notes]] for Week 1 ** Over the first two weeks or so, we'll be practicing the basics - so read through Chapters 1-3 of Hetland's Beginning Python during this time. ** [[PythonTranslated|Important Definitions]] * [[Media:Week2.pdf|Notes]] for Week 2 ** [[Code:Oware|Oware code]] ** Solutions for some problems in Week 2's notes: <source lang="python"> # simple data types "a string" # : str x = [1, 2, 3] # : [int] # compound data type (1, "name", (x, x)) # : (int, str, ([int], [int])) # add_one : int -> int # str.__add__ : str -> str -> str # str.split : str -> [str] # str.__mod__ : str -> (Objects) -> str </source> * [[Media:Week3.pdf|Notes]] for Week 3-4 ** Reading assignment - read through Chapter 5 and 6 (and practice dictionaries from Ch. 4) ** [[Code:for_patterns|Abstracting patterns]] in for loops. * [[Media:Week5.pdf|Notes]] for Week 5-6 ** Reading assignment - Read Chapter 10-11 (and refer to Ch. 4) * By this point, we've covered all the basics: ** base types: str, int, float, [a] ** variables and substitution: j vs "4" vs 4 ** indexing and slicing into lists / strings: x[1:4] or x[i:j] ** control flow: if and for syntax ** functions implementing patterns: def next(r, x): return r*x*(1-x) * You should be able to use these for: ** finding and abstracting the pattern ** naming the type of a function ** determining which variable names are in scope * All that's left is learning common uses, patterns and even more syntax! * [[Media:Week8.pdf|Notes]] for Week 7-8 * In-Class Examples * [[Gorillaz Code]] * [[File:Wat3-ccsd.txt]] Output of Multiwfn for a Na+(H20)_3 molecular cluster. === Homework === * [[CompSciHW1|Homework 1]] is due Monday, January 25. * [[CompSciHW2|Homework 2]] is due Monday, February 8. * [[CompSciHW3|Homework 3]] is due Friday, February 19. * [[CompSciHW4|Homework 4]] is due Friday, February 26. * [[CompSciHW5|Homework 5]] is due Friday, March 4. == Group Work Pages == Group 1 [https://docs.google.com/document/d/1k6vruCx78aV0pL8Kw7WWtsw_-6zgdoeP0OvujSzbsh0/edit?usp=sharing]: Group 2 [https://docs.google.com/document/d/1MgpVly2D1h9Xt_lFh5ywa3b70Ul9ES6OQZtg5l_n0NM/edit?usp=sharing] Group 3 [https://docs.google.com/document/d/1LT_J-vObN9tPa1JoQ1B_h04ENsL5Ko2xeFeRMp-99f8/edit?usp=sharing] Group 4 [https://docs.google.com/document/d/1hGlNlg1w7_3qCo6LE-y9rSZx1Chwc0FBUoxK6cyzWW8/edit?usp=sharing] Substitution problem notes: <pre> Requirements: 1. Python object representing a spreadsheet 2. Ability to show the whole sheet (formulas) 3. Ability to compute the whole sheet (values) 4. Ability to update formula stored in a cell Cells: Example Cell Content: "A1 - B2*C2" A B C 1 A1 B1 C1 2 A2 B2 C2 3 A3 B3 C3 Hint 1: use str.replace : str -> str -> str -> str * fixed replacement order: A1, B1, C1, A2, B2, C2, ... "A1 - B2*C2".replace("A1", "5") Hint 2: use eval : str -> Object eval("5*3 - 4") vals = ["3", "4", "5", "A1", "A1 - 2*A2", "5", "", "", ""] vals = {"" : "3", } #? Hint 3: OK to print the easy way -- A1 = 5 + 2 A2 = A1*4 A3 = A1 - A2 Hint 4: Compute values in a separate sheet object. formulas -> values -- values["A1"] = formulas["A1"] values["B1"] = formulas["B1"].replace("A1", values["A1"]) values["C1"] = formulas["C1"].replace("B1", values["B1"]) values["C1"] = values["C1"].replace("A1", values["A1"]) values["A2"] = formulas["A2"] values["A2"] = values["A2"].replace("C1", values["C1"]) values["A2"] = values["A2"].replace("B1", values["B1"]) values["A2"] = values["A2"].replace("A1", values["A1"]) # Build the value of B2 from its formula. values["B2"] = formulas["B2"] values["B2"] = values["B2"].replace("A2", values["A2"]) values["B2"] = values["B2"].replace("C1", values["C1"]) values["B2"] = values["B2"].replace("B1", values["B1"]) values["B2"] = values["B2"].replace("A1", values["A1"]) </pre> cac826eeeb59c7562e0c89d56cfbb116c10d6115 476 473 2016-03-07T16:34:13Z David M. Rogers 2 /* Notes */ wikitext text/x-wiki '''<BIG>Introduction to Scientific Computing</BIG>''' Course Info * Course Numbers CHM 4932-004/6938-010, CRN: 22347/22348 * Credit Hours: 3 * Meeting Dates: January 22 - April 27, 2016 ** No Class Jan. 18 or Mar. 14-19 * Meeting Times: Mon. and Wed., 12:30-13:45 in SCA 222 ** Lab Session & Office Hours: Fri. 12:30-13:45 in SCA 222 (or SCA 433) == Overview == Mathematical models in the natural sciences take many shapes and forms. The moment they become more complicated than tracking a few variables over time, we have to put away our Excel spreadsheets and make use of a solid foundation in computational science. The course establishes this foundation by introducing data structures and algorithms used in everyday scientific computing using examples in the python scripting language. By the end of the Semester, students will be able to navigate the Linux command-line to go from a mathematical model to a numerical solution. Best practices for working with computer code and visualizing data will also be covered. == Topics == # Languages #* bash (shell) #* python (scripting) #* stack & register-based machine languages: overview of C and Fortran syntax & compiling with gcc, ‘thread safety’ #* Shared libraries & language inter-operability (FFI) # Algorithms #* Horner’s algorithm for polynomials #* Newton’s root finding algo. #* Overview of general optimization algo-s (example: linear & nonlin. least-squares) #* Numerical integration (scripted, plus gnu ODE) #* Communication (how HTTP get/put works) # Data Structures #* Linked Lists #* Trees (file system hierarchies) #* Graphs #* Arrays (dense & sparse) example: vectors & rotations / transpositions, densities and difference operators # Presentation & visualization #* Flat CSV files (and excel) #* Working with binary data #* Python matplotlib (2D images) #* Binning histograms & weighted averages # Best Practices #* High-level code design (modularity, interface specifications, unit testing, etc.) #* Code audit: open-source libraries, ex. Gnu Scientific Library, qsort in libc, Boost #* Source code versioning (example: git or mercurial) #* gdb & execution profiling #* documentation #* Makefiles == Grading == '''Grading Scale (out of 400 points possible)''' {| class="wikitable" |- ! Grade ! Undergraduate ! Graduate |- | A | 230 | 300 |- | B | 180 | 230 |- | C | 150 | 180 |- | D | 120 | 150 |} * Points Possible: ** 10 homework assignments (20 points per homework) ** 2 projects / competitions (100 points per project) * Homework Rules ** For work done in groups, credit is divided equally among participants - so the max homework grade for a group of 2 is 10 points each. ** For each homework, 1 re-do at full credit can be sent at any time after the due date, but must present a unique solution to previous work from yourself or others. ** All work must cite co-group members (if any) and the source of any code snippets used online. === Grading Rationale === Homework points will only be awarded for correct, working code and correct algorithmic analysis, while the homework problems will become progressively tougher. Undergraduates should be able to pass the course with an A if they have correctly answered most of the homework, and made a strong attempt at one of the projects. Graduate students should both perform well on the homework and successfully complete one or two projects. Essentially, this means you should do your own homework when possible and may do a project in a small group. The re-grading and group options for homework allow making up for missed assignments, and encourage returning to core concepts at a later point in the class. Students who have completed significant portions of the homework have thus demonstrated programming proficiency, and are qualified for at least B/C grades. == Projects == === Midterm === A description for the midterm project is now available [[Media:midterm.pdf|here]]. The MD section will be updated as we discuss it in class. The due date for the midterm will be Friday, March 11. === Final === TBA == Textbooks and Resources == * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-0072-7 Beginning Python, Hetland, 2005] (eBook avail. from USF Library) * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-3238-4 Python Algorithms, Hetland, 2010] (eBook avail. from USF Library) * [http://aosabook.org/en/index.html The Architecture of Open Source Applications] * [http://docs.python.org Python Documentation] * [https://developers.google.com/edu/python/ Google Introductory Python Notes] * [http://huffman.sourceforge.net/tao/tao-of-programming.html Tao of Programming] Other (possibly useful) materials: * [http://hackersdictionary.com/html/entry/larval-stage.html The Jargon File] * Chapters 7&8 of Modelling and Simulation, Birta and Arbez, Springer 2007 (eBook avail. from USF Library). * Chapters 4-6 of Models and Algorithms for Intelligent Data Analysis, Runkler, Springer 2012 (eBook avail. from USF Library). * Guide to Scientific Computing in C++, Francis and Whiteley, Springer, 2012. (eBook avail. from USF Library) * Extra info. On the basics: ** Chapters 3 and 7 of Mathematics in Computing, Regan, Springer 2013. (eBook avail. from USF Library) ** Instant feedback graphical programming with [https://www.khanacademy.org/cs/programming/ Khan Academy] * [http://www.meetup.com/python-178/ Local PyBulls Meetings] Code: * [http://carsonfarmer.com/2013/07/essential-python-geo-libraries Python Libraries Useful for Geospatial Problems] * [[Code#Python_Libraries|Python Libraries Useful for Computational Chemistry]] (very small list at present) Interactive Interpreters: * [http://www.codewars.com CodeWars] Recommended for building experience with practice problems. * [http://exercism.io Exercism] A command-line client with a similar learn-through-challenge philosophy. * [http://repl.it repl.it] A read-eval-print loop for several computer languages. * [http://en.cppreference.com/w/cpp/language CppReference] Documentation with an online evaluator for C++ code. === Notes === * [[Media:intro.pdf|Notes]] for Week 1 ** Over the first two weeks or so, we'll be practicing the basics - so read through Chapters 1-3 of Hetland's Beginning Python during this time. ** [[PythonTranslated|Important Definitions]] * [[Media:Week2.pdf|Notes]] for Week 2 ** [[Code:Oware|Oware code]] ** Solutions for some problems in Week 2's notes: <source lang="python"> # simple data types "a string" # : str x = [1, 2, 3] # : [int] # compound data type (1, "name", (x, x)) # : (int, str, ([int], [int])) # add_one : int -> int # str.__add__ : str -> str -> str # str.split : str -> [str] # str.__mod__ : str -> (Objects) -> str </source> * [[Media:Week3.pdf|Notes]] for Week 3-4 ** Reading assignment - read through Chapter 5 and 6 (and practice dictionaries from Ch. 4) ** [[Code:for_patterns|Abstracting patterns]] in for loops. * [[Media:Week5.pdf|Notes]] for Week 5-6 ** Reading assignment - Read Chapter 10-11 (and refer to Ch. 4) * By this point, we've covered all the basics: ** base types: str, int, float, [a] ** variables and substitution: j vs "4" vs 4 ** indexing and slicing into lists / strings: x[1:4] or x[i:j] ** control flow: if and for syntax ** functions implementing patterns: def next(r, x): return r*x*(1-x) * You should be able to use these for: ** finding and abstracting the pattern ** naming the type of a function ** determining which variable names are in scope * All that's left is learning common uses, patterns and even more syntax! * [[Media:Week7-8.pdf|Notes]] for Week 7-8 * In-Class Examples * [[Gorillaz Code]] * [[File:Wat3-ccsd.txt]] Output of Multiwfn for a Na+(H20)_3 molecular cluster. === Homework === * [[CompSciHW1|Homework 1]] is due Monday, January 25. * [[CompSciHW2|Homework 2]] is due Monday, February 8. * [[CompSciHW3|Homework 3]] is due Friday, February 19. * [[CompSciHW4|Homework 4]] is due Friday, February 26. * [[CompSciHW5|Homework 5]] is due Friday, March 4. == Group Work Pages == Group 1 [https://docs.google.com/document/d/1k6vruCx78aV0pL8Kw7WWtsw_-6zgdoeP0OvujSzbsh0/edit?usp=sharing]: Group 2 [https://docs.google.com/document/d/1MgpVly2D1h9Xt_lFh5ywa3b70Ul9ES6OQZtg5l_n0NM/edit?usp=sharing] Group 3 [https://docs.google.com/document/d/1LT_J-vObN9tPa1JoQ1B_h04ENsL5Ko2xeFeRMp-99f8/edit?usp=sharing] Group 4 [https://docs.google.com/document/d/1hGlNlg1w7_3qCo6LE-y9rSZx1Chwc0FBUoxK6cyzWW8/edit?usp=sharing] Substitution problem notes: <pre> Requirements: 1. Python object representing a spreadsheet 2. Ability to show the whole sheet (formulas) 3. Ability to compute the whole sheet (values) 4. Ability to update formula stored in a cell Cells: Example Cell Content: "A1 - B2*C2" A B C 1 A1 B1 C1 2 A2 B2 C2 3 A3 B3 C3 Hint 1: use str.replace : str -> str -> str -> str * fixed replacement order: A1, B1, C1, A2, B2, C2, ... "A1 - B2*C2".replace("A1", "5") Hint 2: use eval : str -> Object eval("5*3 - 4") vals = ["3", "4", "5", "A1", "A1 - 2*A2", "5", "", "", ""] vals = {"" : "3", } #? Hint 3: OK to print the easy way -- A1 = 5 + 2 A2 = A1*4 A3 = A1 - A2 Hint 4: Compute values in a separate sheet object. formulas -> values -- values["A1"] = formulas["A1"] values["B1"] = formulas["B1"].replace("A1", values["A1"]) values["C1"] = formulas["C1"].replace("B1", values["B1"]) values["C1"] = values["C1"].replace("A1", values["A1"]) values["A2"] = formulas["A2"] values["A2"] = values["A2"].replace("C1", values["C1"]) values["A2"] = values["A2"].replace("B1", values["B1"]) values["A2"] = values["A2"].replace("A1", values["A1"]) # Build the value of B2 from its formula. values["B2"] = formulas["B2"] values["B2"] = values["B2"].replace("A2", values["A2"]) values["B2"] = values["B2"].replace("C1", values["C1"]) values["B2"] = values["B2"].replace("B1", values["B1"]) values["B2"] = values["B2"].replace("A1", values["A1"]) </pre> 29985812e4b8d4087e87b47d09d7a584d3be9248 479 476 2016-03-21T14:48:17Z David M. Rogers 2 /* Homework */ wikitext text/x-wiki '''<BIG>Introduction to Scientific Computing</BIG>''' Course Info * Course Numbers CHM 4932-004/6938-010, CRN: 22347/22348 * Credit Hours: 3 * Meeting Dates: January 22 - April 27, 2016 ** No Class Jan. 18 or Mar. 14-19 * Meeting Times: Mon. and Wed., 12:30-13:45 in SCA 222 ** Lab Session & Office Hours: Fri. 12:30-13:45 in SCA 222 (or SCA 433) == Overview == Mathematical models in the natural sciences take many shapes and forms. The moment they become more complicated than tracking a few variables over time, we have to put away our Excel spreadsheets and make use of a solid foundation in computational science. The course establishes this foundation by introducing data structures and algorithms used in everyday scientific computing using examples in the python scripting language. By the end of the Semester, students will be able to navigate the Linux command-line to go from a mathematical model to a numerical solution. Best practices for working with computer code and visualizing data will also be covered. == Topics == # Languages #* bash (shell) #* python (scripting) #* stack & register-based machine languages: overview of C and Fortran syntax & compiling with gcc, ‘thread safety’ #* Shared libraries & language inter-operability (FFI) # Algorithms #* Horner’s algorithm for polynomials #* Newton’s root finding algo. #* Overview of general optimization algo-s (example: linear & nonlin. least-squares) #* Numerical integration (scripted, plus gnu ODE) #* Communication (how HTTP get/put works) # Data Structures #* Linked Lists #* Trees (file system hierarchies) #* Graphs #* Arrays (dense & sparse) example: vectors & rotations / transpositions, densities and difference operators # Presentation & visualization #* Flat CSV files (and excel) #* Working with binary data #* Python matplotlib (2D images) #* Binning histograms & weighted averages # Best Practices #* High-level code design (modularity, interface specifications, unit testing, etc.) #* Code audit: open-source libraries, ex. Gnu Scientific Library, qsort in libc, Boost #* Source code versioning (example: git or mercurial) #* gdb & execution profiling #* documentation #* Makefiles == Grading == '''Grading Scale (out of 400 points possible)''' {| class="wikitable" |- ! Grade ! Undergraduate ! Graduate |- | A | 230 | 300 |- | B | 180 | 230 |- | C | 150 | 180 |- | D | 120 | 150 |} * Points Possible: ** 10 homework assignments (20 points per homework) ** 2 projects / competitions (100 points per project) * Homework Rules ** For work done in groups, credit is divided equally among participants - so the max homework grade for a group of 2 is 10 points each. ** For each homework, 1 re-do at full credit can be sent at any time after the due date, but must present a unique solution to previous work from yourself or others. ** All work must cite co-group members (if any) and the source of any code snippets used online. === Grading Rationale === Homework points will only be awarded for correct, working code and correct algorithmic analysis, while the homework problems will become progressively tougher. Undergraduates should be able to pass the course with an A if they have correctly answered most of the homework, and made a strong attempt at one of the projects. Graduate students should both perform well on the homework and successfully complete one or two projects. Essentially, this means you should do your own homework when possible and may do a project in a small group. The re-grading and group options for homework allow making up for missed assignments, and encourage returning to core concepts at a later point in the class. Students who have completed significant portions of the homework have thus demonstrated programming proficiency, and are qualified for at least B/C grades. == Projects == === Midterm === A description for the midterm project is now available [[Media:midterm.pdf|here]]. The MD section will be updated as we discuss it in class. The due date for the midterm will be Friday, March 11. === Final === TBA == Textbooks and Resources == * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-0072-7 Beginning Python, Hetland, 2005] (eBook avail. from USF Library) * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-3238-4 Python Algorithms, Hetland, 2010] (eBook avail. from USF Library) * [http://aosabook.org/en/index.html The Architecture of Open Source Applications] * [http://docs.python.org Python Documentation] * [https://developers.google.com/edu/python/ Google Introductory Python Notes] * [http://huffman.sourceforge.net/tao/tao-of-programming.html Tao of Programming] Other (possibly useful) materials: * [http://hackersdictionary.com/html/entry/larval-stage.html The Jargon File] * Chapters 7&8 of Modelling and Simulation, Birta and Arbez, Springer 2007 (eBook avail. from USF Library). * Chapters 4-6 of Models and Algorithms for Intelligent Data Analysis, Runkler, Springer 2012 (eBook avail. from USF Library). * Guide to Scientific Computing in C++, Francis and Whiteley, Springer, 2012. (eBook avail. from USF Library) * Extra info. On the basics: ** Chapters 3 and 7 of Mathematics in Computing, Regan, Springer 2013. (eBook avail. from USF Library) ** Instant feedback graphical programming with [https://www.khanacademy.org/cs/programming/ Khan Academy] * [http://www.meetup.com/python-178/ Local PyBulls Meetings] Code: * [http://carsonfarmer.com/2013/07/essential-python-geo-libraries Python Libraries Useful for Geospatial Problems] * [[Code#Python_Libraries|Python Libraries Useful for Computational Chemistry]] (very small list at present) Interactive Interpreters: * [http://www.codewars.com CodeWars] Recommended for building experience with practice problems. * [http://exercism.io Exercism] A command-line client with a similar learn-through-challenge philosophy. * [http://repl.it repl.it] A read-eval-print loop for several computer languages. * [http://en.cppreference.com/w/cpp/language CppReference] Documentation with an online evaluator for C++ code. === Notes === * [[Media:intro.pdf|Notes]] for Week 1 ** Over the first two weeks or so, we'll be practicing the basics - so read through Chapters 1-3 of Hetland's Beginning Python during this time. ** [[PythonTranslated|Important Definitions]] * [[Media:Week2.pdf|Notes]] for Week 2 ** [[Code:Oware|Oware code]] ** Solutions for some problems in Week 2's notes: <source lang="python"> # simple data types "a string" # : str x = [1, 2, 3] # : [int] # compound data type (1, "name", (x, x)) # : (int, str, ([int], [int])) # add_one : int -> int # str.__add__ : str -> str -> str # str.split : str -> [str] # str.__mod__ : str -> (Objects) -> str </source> * [[Media:Week3.pdf|Notes]] for Week 3-4 ** Reading assignment - read through Chapter 5 and 6 (and practice dictionaries from Ch. 4) ** [[Code:for_patterns|Abstracting patterns]] in for loops. * [[Media:Week5.pdf|Notes]] for Week 5-6 ** Reading assignment - Read Chapter 10-11 (and refer to Ch. 4) * By this point, we've covered all the basics: ** base types: str, int, float, [a] ** variables and substitution: j vs "4" vs 4 ** indexing and slicing into lists / strings: x[1:4] or x[i:j] ** control flow: if and for syntax ** functions implementing patterns: def next(r, x): return r*x*(1-x) * You should be able to use these for: ** finding and abstracting the pattern ** naming the type of a function ** determining which variable names are in scope * All that's left is learning common uses, patterns and even more syntax! * [[Media:Week7-8.pdf|Notes]] for Week 7-8 * In-Class Examples * [[Gorillaz Code]] * [[File:Wat3-ccsd.txt]] Output of Multiwfn for a Na+(H20)_3 molecular cluster. === Homework === * [[CompSciHW1|Homework 1]] is due Monday, January 25. * [[CompSciHW2|Homework 2]] is due Monday, February 8. * [[CompSciHW3|Homework 3]] is due Friday, February 19. * [[CompSciHW4|Homework 4]] is due Friday, February 26. * [[CompSciHW5|Homework 5]] is due Friday, March 4. * [[CompSciHW6|Homework 6]] is due Friday, March 25. == Group Work Pages == Group 1 [https://docs.google.com/document/d/1k6vruCx78aV0pL8Kw7WWtsw_-6zgdoeP0OvujSzbsh0/edit?usp=sharing]: Group 2 [https://docs.google.com/document/d/1MgpVly2D1h9Xt_lFh5ywa3b70Ul9ES6OQZtg5l_n0NM/edit?usp=sharing] Group 3 [https://docs.google.com/document/d/1LT_J-vObN9tPa1JoQ1B_h04ENsL5Ko2xeFeRMp-99f8/edit?usp=sharing] Group 4 [https://docs.google.com/document/d/1hGlNlg1w7_3qCo6LE-y9rSZx1Chwc0FBUoxK6cyzWW8/edit?usp=sharing] Substitution problem notes: <pre> Requirements: 1. Python object representing a spreadsheet 2. Ability to show the whole sheet (formulas) 3. Ability to compute the whole sheet (values) 4. Ability to update formula stored in a cell Cells: Example Cell Content: "A1 - B2*C2" A B C 1 A1 B1 C1 2 A2 B2 C2 3 A3 B3 C3 Hint 1: use str.replace : str -> str -> str -> str * fixed replacement order: A1, B1, C1, A2, B2, C2, ... "A1 - B2*C2".replace("A1", "5") Hint 2: use eval : str -> Object eval("5*3 - 4") vals = ["3", "4", "5", "A1", "A1 - 2*A2", "5", "", "", ""] vals = {"" : "3", } #? Hint 3: OK to print the easy way -- A1 = 5 + 2 A2 = A1*4 A3 = A1 - A2 Hint 4: Compute values in a separate sheet object. formulas -> values -- values["A1"] = formulas["A1"] values["B1"] = formulas["B1"].replace("A1", values["A1"]) values["C1"] = formulas["C1"].replace("B1", values["B1"]) values["C1"] = values["C1"].replace("A1", values["A1"]) values["A2"] = formulas["A2"] values["A2"] = values["A2"].replace("C1", values["C1"]) values["A2"] = values["A2"].replace("B1", values["B1"]) values["A2"] = values["A2"].replace("A1", values["A1"]) # Build the value of B2 from its formula. values["B2"] = formulas["B2"] values["B2"] = values["B2"].replace("A2", values["A2"]) values["B2"] = values["B2"].replace("C1", values["C1"]) values["B2"] = values["B2"].replace("B1", values["B1"]) values["B2"] = values["B2"].replace("A1", values["A1"]) </pre> e737c3284c4b547caf30f7a7019f1bd77a164ba1 480 479 2016-03-21T16:14:40Z David M. Rogers 2 /* Notes */ wikitext text/x-wiki '''<BIG>Introduction to Scientific Computing</BIG>''' Course Info * Course Numbers CHM 4932-004/6938-010, CRN: 22347/22348 * Credit Hours: 3 * Meeting Dates: January 22 - April 27, 2016 ** No Class Jan. 18 or Mar. 14-19 * Meeting Times: Mon. and Wed., 12:30-13:45 in SCA 222 ** Lab Session & Office Hours: Fri. 12:30-13:45 in SCA 222 (or SCA 433) == Overview == Mathematical models in the natural sciences take many shapes and forms. The moment they become more complicated than tracking a few variables over time, we have to put away our Excel spreadsheets and make use of a solid foundation in computational science. The course establishes this foundation by introducing data structures and algorithms used in everyday scientific computing using examples in the python scripting language. By the end of the Semester, students will be able to navigate the Linux command-line to go from a mathematical model to a numerical solution. Best practices for working with computer code and visualizing data will also be covered. == Topics == # Languages #* bash (shell) #* python (scripting) #* stack & register-based machine languages: overview of C and Fortran syntax & compiling with gcc, ‘thread safety’ #* Shared libraries & language inter-operability (FFI) # Algorithms #* Horner’s algorithm for polynomials #* Newton’s root finding algo. #* Overview of general optimization algo-s (example: linear & nonlin. least-squares) #* Numerical integration (scripted, plus gnu ODE) #* Communication (how HTTP get/put works) # Data Structures #* Linked Lists #* Trees (file system hierarchies) #* Graphs #* Arrays (dense & sparse) example: vectors & rotations / transpositions, densities and difference operators # Presentation & visualization #* Flat CSV files (and excel) #* Working with binary data #* Python matplotlib (2D images) #* Binning histograms & weighted averages # Best Practices #* High-level code design (modularity, interface specifications, unit testing, etc.) #* Code audit: open-source libraries, ex. Gnu Scientific Library, qsort in libc, Boost #* Source code versioning (example: git or mercurial) #* gdb & execution profiling #* documentation #* Makefiles == Grading == '''Grading Scale (out of 400 points possible)''' {| class="wikitable" |- ! Grade ! Undergraduate ! Graduate |- | A | 230 | 300 |- | B | 180 | 230 |- | C | 150 | 180 |- | D | 120 | 150 |} * Points Possible: ** 10 homework assignments (20 points per homework) ** 2 projects / competitions (100 points per project) * Homework Rules ** For work done in groups, credit is divided equally among participants - so the max homework grade for a group of 2 is 10 points each. ** For each homework, 1 re-do at full credit can be sent at any time after the due date, but must present a unique solution to previous work from yourself or others. ** All work must cite co-group members (if any) and the source of any code snippets used online. === Grading Rationale === Homework points will only be awarded for correct, working code and correct algorithmic analysis, while the homework problems will become progressively tougher. Undergraduates should be able to pass the course with an A if they have correctly answered most of the homework, and made a strong attempt at one of the projects. Graduate students should both perform well on the homework and successfully complete one or two projects. Essentially, this means you should do your own homework when possible and may do a project in a small group. The re-grading and group options for homework allow making up for missed assignments, and encourage returning to core concepts at a later point in the class. Students who have completed significant portions of the homework have thus demonstrated programming proficiency, and are qualified for at least B/C grades. == Projects == === Midterm === A description for the midterm project is now available [[Media:midterm.pdf|here]]. The MD section will be updated as we discuss it in class. The due date for the midterm will be Friday, March 11. === Final === TBA == Textbooks and Resources == * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-0072-7 Beginning Python, Hetland, 2005] (eBook avail. from USF Library) * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-3238-4 Python Algorithms, Hetland, 2010] (eBook avail. from USF Library) * [http://aosabook.org/en/index.html The Architecture of Open Source Applications] * [http://docs.python.org Python Documentation] * [https://developers.google.com/edu/python/ Google Introductory Python Notes] * [http://huffman.sourceforge.net/tao/tao-of-programming.html Tao of Programming] Other (possibly useful) materials: * [http://hackersdictionary.com/html/entry/larval-stage.html The Jargon File] * Chapters 7&8 of Modelling and Simulation, Birta and Arbez, Springer 2007 (eBook avail. from USF Library). * Chapters 4-6 of Models and Algorithms for Intelligent Data Analysis, Runkler, Springer 2012 (eBook avail. from USF Library). * Guide to Scientific Computing in C++, Francis and Whiteley, Springer, 2012. (eBook avail. from USF Library) * Extra info. On the basics: ** Chapters 3 and 7 of Mathematics in Computing, Regan, Springer 2013. (eBook avail. from USF Library) ** Instant feedback graphical programming with [https://www.khanacademy.org/cs/programming/ Khan Academy] * [http://www.meetup.com/python-178/ Local PyBulls Meetings] Code: * [http://carsonfarmer.com/2013/07/essential-python-geo-libraries Python Libraries Useful for Geospatial Problems] * [[Code#Python_Libraries|Python Libraries Useful for Computational Chemistry]] (very small list at present) Interactive Interpreters: * [http://www.codewars.com CodeWars] Recommended for building experience with practice problems. * [http://exercism.io Exercism] A command-line client with a similar learn-through-challenge philosophy. * [http://repl.it repl.it] A read-eval-print loop for several computer languages. * [http://en.cppreference.com/w/cpp/language CppReference] Documentation with an online evaluator for C++ code. === Notes === * [[Media:intro.pdf|Notes]] for Week 1 ** Over the first two weeks or so, we'll be practicing the basics - so read through Chapters 1-3 of Hetland's Beginning Python during this time. ** [[PythonTranslated|Important Definitions]] * [[Media:Week2.pdf|Notes]] for Week 2 ** [[Code:Oware|Oware code]] ** Solutions for some problems in Week 2's notes: <source lang="python"> # simple data types "a string" # : str x = [1, 2, 3] # : [int] # compound data type (1, "name", (x, x)) # : (int, str, ([int], [int])) # add_one : int -> int # str.__add__ : str -> str -> str # str.split : str -> [str] # str.__mod__ : str -> (Objects) -> str </source> * [[Media:Week3.pdf|Notes]] for Week 3-4 ** Reading assignment - read through Chapter 5 and 6 (and practice dictionaries from Ch. 4) ** [[Code:for_patterns|Abstracting patterns]] in for loops. * [[Media:Week5.pdf|Notes]] for Week 5-6 ** Reading assignment - Read Chapter 10-11 (and refer to Ch. 4) * By this point, we've covered all the basics: ** base types: str, int, float, [a] ** variables and substitution: j vs "4" vs 4 ** indexing and slicing into lists / strings: x[1:4] or x[i:j] ** control flow: if and for syntax ** functions implementing patterns: def next(r, x): return r*x*(1-x) * You should be able to use these for: ** finding and abstracting the pattern ** naming the type of a function ** determining which variable names are in scope * All that's left is learning common uses, patterns and even more syntax! * [[Media:Week7-8.pdf|Notes]] for Week 7-8 * [[Media:Week9-10.pdf|Notes]] for Week 9-10 * In-Class Examples * [[Gorillaz Code]] * [[File:Wat3-ccsd.txt]] Output of Multiwfn for a Na+(H20)_3 molecular cluster. === Homework === * [[CompSciHW1|Homework 1]] is due Monday, January 25. * [[CompSciHW2|Homework 2]] is due Monday, February 8. * [[CompSciHW3|Homework 3]] is due Friday, February 19. * [[CompSciHW4|Homework 4]] is due Friday, February 26. * [[CompSciHW5|Homework 5]] is due Friday, March 4. * [[CompSciHW6|Homework 6]] is due Friday, March 25. == Group Work Pages == Group 1 [https://docs.google.com/document/d/1k6vruCx78aV0pL8Kw7WWtsw_-6zgdoeP0OvujSzbsh0/edit?usp=sharing]: Group 2 [https://docs.google.com/document/d/1MgpVly2D1h9Xt_lFh5ywa3b70Ul9ES6OQZtg5l_n0NM/edit?usp=sharing] Group 3 [https://docs.google.com/document/d/1LT_J-vObN9tPa1JoQ1B_h04ENsL5Ko2xeFeRMp-99f8/edit?usp=sharing] Group 4 [https://docs.google.com/document/d/1hGlNlg1w7_3qCo6LE-y9rSZx1Chwc0FBUoxK6cyzWW8/edit?usp=sharing] Substitution problem notes: <pre> Requirements: 1. Python object representing a spreadsheet 2. Ability to show the whole sheet (formulas) 3. Ability to compute the whole sheet (values) 4. Ability to update formula stored in a cell Cells: Example Cell Content: "A1 - B2*C2" A B C 1 A1 B1 C1 2 A2 B2 C2 3 A3 B3 C3 Hint 1: use str.replace : str -> str -> str -> str * fixed replacement order: A1, B1, C1, A2, B2, C2, ... "A1 - B2*C2".replace("A1", "5") Hint 2: use eval : str -> Object eval("5*3 - 4") vals = ["3", "4", "5", "A1", "A1 - 2*A2", "5", "", "", ""] vals = {"" : "3", } #? Hint 3: OK to print the easy way -- A1 = 5 + 2 A2 = A1*4 A3 = A1 - A2 Hint 4: Compute values in a separate sheet object. formulas -> values -- values["A1"] = formulas["A1"] values["B1"] = formulas["B1"].replace("A1", values["A1"]) values["C1"] = formulas["C1"].replace("B1", values["B1"]) values["C1"] = values["C1"].replace("A1", values["A1"]) values["A2"] = formulas["A2"] values["A2"] = values["A2"].replace("C1", values["C1"]) values["A2"] = values["A2"].replace("B1", values["B1"]) values["A2"] = values["A2"].replace("A1", values["A1"]) # Build the value of B2 from its formula. values["B2"] = formulas["B2"] values["B2"] = values["B2"].replace("A2", values["A2"]) values["B2"] = values["B2"].replace("C1", values["C1"]) values["B2"] = values["B2"].replace("B1", values["B1"]) values["B2"] = values["B2"].replace("A1", values["A1"]) </pre> 698cb9d57f8c0636a4998a61d934b75d18feca0b 484 480 2016-03-23T16:00:08Z David M. Rogers 2 /* Group Work Pages */ wikitext text/x-wiki '''<BIG>Introduction to Scientific Computing</BIG>''' Course Info * Course Numbers CHM 4932-004/6938-010, CRN: 22347/22348 * Credit Hours: 3 * Meeting Dates: January 22 - April 27, 2016 ** No Class Jan. 18 or Mar. 14-19 * Meeting Times: Mon. and Wed., 12:30-13:45 in SCA 222 ** Lab Session & Office Hours: Fri. 12:30-13:45 in SCA 222 (or SCA 433) == Overview == Mathematical models in the natural sciences take many shapes and forms. The moment they become more complicated than tracking a few variables over time, we have to put away our Excel spreadsheets and make use of a solid foundation in computational science. The course establishes this foundation by introducing data structures and algorithms used in everyday scientific computing using examples in the python scripting language. By the end of the Semester, students will be able to navigate the Linux command-line to go from a mathematical model to a numerical solution. Best practices for working with computer code and visualizing data will also be covered. == Topics == # Languages #* bash (shell) #* python (scripting) #* stack & register-based machine languages: overview of C and Fortran syntax & compiling with gcc, ‘thread safety’ #* Shared libraries & language inter-operability (FFI) # Algorithms #* Horner’s algorithm for polynomials #* Newton’s root finding algo. #* Overview of general optimization algo-s (example: linear & nonlin. least-squares) #* Numerical integration (scripted, plus gnu ODE) #* Communication (how HTTP get/put works) # Data Structures #* Linked Lists #* Trees (file system hierarchies) #* Graphs #* Arrays (dense & sparse) example: vectors & rotations / transpositions, densities and difference operators # Presentation & visualization #* Flat CSV files (and excel) #* Working with binary data #* Python matplotlib (2D images) #* Binning histograms & weighted averages # Best Practices #* High-level code design (modularity, interface specifications, unit testing, etc.) #* Code audit: open-source libraries, ex. Gnu Scientific Library, qsort in libc, Boost #* Source code versioning (example: git or mercurial) #* gdb & execution profiling #* documentation #* Makefiles == Grading == '''Grading Scale (out of 400 points possible)''' {| class="wikitable" |- ! Grade ! Undergraduate ! Graduate |- | A | 230 | 300 |- | B | 180 | 230 |- | C | 150 | 180 |- | D | 120 | 150 |} * Points Possible: ** 10 homework assignments (20 points per homework) ** 2 projects / competitions (100 points per project) * Homework Rules ** For work done in groups, credit is divided equally among participants - so the max homework grade for a group of 2 is 10 points each. ** For each homework, 1 re-do at full credit can be sent at any time after the due date, but must present a unique solution to previous work from yourself or others. ** All work must cite co-group members (if any) and the source of any code snippets used online. === Grading Rationale === Homework points will only be awarded for correct, working code and correct algorithmic analysis, while the homework problems will become progressively tougher. Undergraduates should be able to pass the course with an A if they have correctly answered most of the homework, and made a strong attempt at one of the projects. Graduate students should both perform well on the homework and successfully complete one or two projects. Essentially, this means you should do your own homework when possible and may do a project in a small group. The re-grading and group options for homework allow making up for missed assignments, and encourage returning to core concepts at a later point in the class. Students who have completed significant portions of the homework have thus demonstrated programming proficiency, and are qualified for at least B/C grades. == Projects == === Midterm === A description for the midterm project is now available [[Media:midterm.pdf|here]]. The MD section will be updated as we discuss it in class. The due date for the midterm will be Friday, March 11. === Final === TBA == Textbooks and Resources == * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-0072-7 Beginning Python, Hetland, 2005] (eBook avail. from USF Library) * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-3238-4 Python Algorithms, Hetland, 2010] (eBook avail. from USF Library) * [http://aosabook.org/en/index.html The Architecture of Open Source Applications] * [http://docs.python.org Python Documentation] * [https://developers.google.com/edu/python/ Google Introductory Python Notes] * [http://huffman.sourceforge.net/tao/tao-of-programming.html Tao of Programming] Other (possibly useful) materials: * [http://hackersdictionary.com/html/entry/larval-stage.html The Jargon File] * Chapters 7&8 of Modelling and Simulation, Birta and Arbez, Springer 2007 (eBook avail. from USF Library). * Chapters 4-6 of Models and Algorithms for Intelligent Data Analysis, Runkler, Springer 2012 (eBook avail. from USF Library). * Guide to Scientific Computing in C++, Francis and Whiteley, Springer, 2012. (eBook avail. from USF Library) * Extra info. On the basics: ** Chapters 3 and 7 of Mathematics in Computing, Regan, Springer 2013. (eBook avail. from USF Library) ** Instant feedback graphical programming with [https://www.khanacademy.org/cs/programming/ Khan Academy] * [http://www.meetup.com/python-178/ Local PyBulls Meetings] Code: * [http://carsonfarmer.com/2013/07/essential-python-geo-libraries Python Libraries Useful for Geospatial Problems] * [[Code#Python_Libraries|Python Libraries Useful for Computational Chemistry]] (very small list at present) Interactive Interpreters: * [http://www.codewars.com CodeWars] Recommended for building experience with practice problems. * [http://exercism.io Exercism] A command-line client with a similar learn-through-challenge philosophy. * [http://repl.it repl.it] A read-eval-print loop for several computer languages. * [http://en.cppreference.com/w/cpp/language CppReference] Documentation with an online evaluator for C++ code. === Notes === * [[Media:intro.pdf|Notes]] for Week 1 ** Over the first two weeks or so, we'll be practicing the basics - so read through Chapters 1-3 of Hetland's Beginning Python during this time. ** [[PythonTranslated|Important Definitions]] * [[Media:Week2.pdf|Notes]] for Week 2 ** [[Code:Oware|Oware code]] ** Solutions for some problems in Week 2's notes: <source lang="python"> # simple data types "a string" # : str x = [1, 2, 3] # : [int] # compound data type (1, "name", (x, x)) # : (int, str, ([int], [int])) # add_one : int -> int # str.__add__ : str -> str -> str # str.split : str -> [str] # str.__mod__ : str -> (Objects) -> str </source> * [[Media:Week3.pdf|Notes]] for Week 3-4 ** Reading assignment - read through Chapter 5 and 6 (and practice dictionaries from Ch. 4) ** [[Code:for_patterns|Abstracting patterns]] in for loops. * [[Media:Week5.pdf|Notes]] for Week 5-6 ** Reading assignment - Read Chapter 10-11 (and refer to Ch. 4) * By this point, we've covered all the basics: ** base types: str, int, float, [a] ** variables and substitution: j vs "4" vs 4 ** indexing and slicing into lists / strings: x[1:4] or x[i:j] ** control flow: if and for syntax ** functions implementing patterns: def next(r, x): return r*x*(1-x) * You should be able to use these for: ** finding and abstracting the pattern ** naming the type of a function ** determining which variable names are in scope * All that's left is learning common uses, patterns and even more syntax! * [[Media:Week7-8.pdf|Notes]] for Week 7-8 * [[Media:Week9-10.pdf|Notes]] for Week 9-10 * In-Class Examples * [[Gorillaz Code]] * [[File:Wat3-ccsd.txt]] Output of Multiwfn for a Na+(H20)_3 molecular cluster. === Homework === * [[CompSciHW1|Homework 1]] is due Monday, January 25. * [[CompSciHW2|Homework 2]] is due Monday, February 8. * [[CompSciHW3|Homework 3]] is due Friday, February 19. * [[CompSciHW4|Homework 4]] is due Friday, February 26. * [[CompSciHW5|Homework 5]] is due Friday, March 4. * [[CompSciHW6|Homework 6]] is due Friday, March 25. == Group Work Pages == Group 1 [https://docs.google.com/document/d/1k6vruCx78aV0pL8Kw7WWtsw_-6zgdoeP0OvujSzbsh0/edit?usp=sharing]: Group 2 [https://docs.google.com/document/d/1MgpVly2D1h9Xt_lFh5ywa3b70Ul9ES6OQZtg5l_n0NM/edit?usp=sharing] Group 3 [https://docs.google.com/document/d/1LT_J-vObN9tPa1JoQ1B_h04ENsL5Ko2xeFeRMp-99f8/edit?usp=sharing] Group 4 [https://docs.google.com/document/d/1hGlNlg1w7_3qCo6LE-y9rSZx1Chwc0FBUoxK6cyzWW8/edit?usp=sharing] a4dc5f33083818e20a904c25a6f4ba5cbb7c99b0 485 484 2016-03-23T16:00:53Z David M. Rogers 2 /* Notes */ wikitext text/x-wiki '''<BIG>Introduction to Scientific Computing</BIG>''' Course Info * Course Numbers CHM 4932-004/6938-010, CRN: 22347/22348 * Credit Hours: 3 * Meeting Dates: January 22 - April 27, 2016 ** No Class Jan. 18 or Mar. 14-19 * Meeting Times: Mon. and Wed., 12:30-13:45 in SCA 222 ** Lab Session & Office Hours: Fri. 12:30-13:45 in SCA 222 (or SCA 433) == Overview == Mathematical models in the natural sciences take many shapes and forms. The moment they become more complicated than tracking a few variables over time, we have to put away our Excel spreadsheets and make use of a solid foundation in computational science. The course establishes this foundation by introducing data structures and algorithms used in everyday scientific computing using examples in the python scripting language. By the end of the Semester, students will be able to navigate the Linux command-line to go from a mathematical model to a numerical solution. Best practices for working with computer code and visualizing data will also be covered. == Topics == # Languages #* bash (shell) #* python (scripting) #* stack & register-based machine languages: overview of C and Fortran syntax & compiling with gcc, ‘thread safety’ #* Shared libraries & language inter-operability (FFI) # Algorithms #* Horner’s algorithm for polynomials #* Newton’s root finding algo. #* Overview of general optimization algo-s (example: linear & nonlin. least-squares) #* Numerical integration (scripted, plus gnu ODE) #* Communication (how HTTP get/put works) # Data Structures #* Linked Lists #* Trees (file system hierarchies) #* Graphs #* Arrays (dense & sparse) example: vectors & rotations / transpositions, densities and difference operators # Presentation & visualization #* Flat CSV files (and excel) #* Working with binary data #* Python matplotlib (2D images) #* Binning histograms & weighted averages # Best Practices #* High-level code design (modularity, interface specifications, unit testing, etc.) #* Code audit: open-source libraries, ex. Gnu Scientific Library, qsort in libc, Boost #* Source code versioning (example: git or mercurial) #* gdb & execution profiling #* documentation #* Makefiles == Grading == '''Grading Scale (out of 400 points possible)''' {| class="wikitable" |- ! Grade ! Undergraduate ! Graduate |- | A | 230 | 300 |- | B | 180 | 230 |- | C | 150 | 180 |- | D | 120 | 150 |} * Points Possible: ** 10 homework assignments (20 points per homework) ** 2 projects / competitions (100 points per project) * Homework Rules ** For work done in groups, credit is divided equally among participants - so the max homework grade for a group of 2 is 10 points each. ** For each homework, 1 re-do at full credit can be sent at any time after the due date, but must present a unique solution to previous work from yourself or others. ** All work must cite co-group members (if any) and the source of any code snippets used online. === Grading Rationale === Homework points will only be awarded for correct, working code and correct algorithmic analysis, while the homework problems will become progressively tougher. Undergraduates should be able to pass the course with an A if they have correctly answered most of the homework, and made a strong attempt at one of the projects. Graduate students should both perform well on the homework and successfully complete one or two projects. Essentially, this means you should do your own homework when possible and may do a project in a small group. The re-grading and group options for homework allow making up for missed assignments, and encourage returning to core concepts at a later point in the class. Students who have completed significant portions of the homework have thus demonstrated programming proficiency, and are qualified for at least B/C grades. == Projects == === Midterm === A description for the midterm project is now available [[Media:midterm.pdf|here]]. The MD section will be updated as we discuss it in class. The due date for the midterm will be Friday, March 11. === Final === TBA == Textbooks and Resources == * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-0072-7 Beginning Python, Hetland, 2005] (eBook avail. from USF Library) * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-3238-4 Python Algorithms, Hetland, 2010] (eBook avail. from USF Library) * [http://aosabook.org/en/index.html The Architecture of Open Source Applications] * [http://docs.python.org Python Documentation] * [https://developers.google.com/edu/python/ Google Introductory Python Notes] * [http://huffman.sourceforge.net/tao/tao-of-programming.html Tao of Programming] Other (possibly useful) materials: * [http://hackersdictionary.com/html/entry/larval-stage.html The Jargon File] * Chapters 7&8 of Modelling and Simulation, Birta and Arbez, Springer 2007 (eBook avail. from USF Library). * Chapters 4-6 of Models and Algorithms for Intelligent Data Analysis, Runkler, Springer 2012 (eBook avail. from USF Library). * Guide to Scientific Computing in C++, Francis and Whiteley, Springer, 2012. (eBook avail. from USF Library) * Extra info. On the basics: ** Chapters 3 and 7 of Mathematics in Computing, Regan, Springer 2013. (eBook avail. from USF Library) ** Instant feedback graphical programming with [https://www.khanacademy.org/cs/programming/ Khan Academy] * [http://www.meetup.com/python-178/ Local PyBulls Meetings] Code: * [http://carsonfarmer.com/2013/07/essential-python-geo-libraries Python Libraries Useful for Geospatial Problems] * [[Code#Python_Libraries|Python Libraries Useful for Computational Chemistry]] (very small list at present) Interactive Interpreters: * [http://www.codewars.com CodeWars] Recommended for building experience with practice problems. * [http://exercism.io Exercism] A command-line client with a similar learn-through-challenge philosophy. * [http://repl.it repl.it] A read-eval-print loop for several computer languages. * [http://en.cppreference.com/w/cpp/language CppReference] Documentation with an online evaluator for C++ code. === Notes === * [[Media:intro.pdf|Notes]] for Week 1 ** Over the first two weeks or so, we'll be practicing the basics - so read through Chapters 1-3 of Hetland's Beginning Python during this time. ** [[PythonTranslated|Important Definitions]] * [[Media:Week2.pdf|Notes]] for Week 2 ** [[Code:Oware|Oware code]] ** Solutions for some problems in Week 2's notes: <source lang="python"> # simple data types "a string" # : str x = [1, 2, 3] # : [int] # compound data type (1, "name", (x, x)) # : (int, str, ([int], [int])) # add_one : int -> int # str.__add__ : str -> str -> str # str.split : str -> [str] # str.__mod__ : str -> (Objects) -> str </source> * [[Media:Week3.pdf|Notes]] for Week 3-4 ** Reading assignment - read through Chapter 5 and 6 (and practice dictionaries from Ch. 4) ** [[Code:for_patterns|Abstracting patterns]] in for loops. * [[Media:Week5.pdf|Notes]] for Week 5-6 ** Reading assignment - Read Chapter 10-11 (and refer to Ch. 4) * By this point, we've covered all the basics: ** base types: str, int, float, [a] ** variables and substitution: j vs "4" vs 4 ** indexing and slicing into lists / strings: x[1:4] or x[i:j] ** control flow: if and for syntax ** functions implementing patterns: def next(r, x): return r*x*(1-x) * You should be able to use these for: ** finding and abstracting the pattern ** naming the type of a function ** determining which variable names are in scope * All that's left is learning common uses, patterns and even more syntax! * [[Media:Week7-8.pdf|Notes]] for Week 7-8 * [[Media:Week9-10.pdf|Notes]] for Week 9-10 * In-Class Examples * [[Gorillaz Code]] * [[File:Wat3-ccsd.txt]] Output of Multiwfn for a Na+(H20)_3 molecular cluster. * [[File:water_rdf.txt]] Water oxygen-oxygen radial distribution function. === Homework === * [[CompSciHW1|Homework 1]] is due Monday, January 25. * [[CompSciHW2|Homework 2]] is due Monday, February 8. * [[CompSciHW3|Homework 3]] is due Friday, February 19. * [[CompSciHW4|Homework 4]] is due Friday, February 26. * [[CompSciHW5|Homework 5]] is due Friday, March 4. * [[CompSciHW6|Homework 6]] is due Friday, March 25. == Group Work Pages == Group 1 [https://docs.google.com/document/d/1k6vruCx78aV0pL8Kw7WWtsw_-6zgdoeP0OvujSzbsh0/edit?usp=sharing]: Group 2 [https://docs.google.com/document/d/1MgpVly2D1h9Xt_lFh5ywa3b70Ul9ES6OQZtg5l_n0NM/edit?usp=sharing] Group 3 [https://docs.google.com/document/d/1LT_J-vObN9tPa1JoQ1B_h04ENsL5Ko2xeFeRMp-99f8/edit?usp=sharing] Group 4 [https://docs.google.com/document/d/1hGlNlg1w7_3qCo6LE-y9rSZx1Chwc0FBUoxK6cyzWW8/edit?usp=sharing] 3281074b298f42f52cdce0b1ec489c6cda358f26 487 485 2016-03-23T16:03:58Z David M. Rogers 2 /* Notes */ wikitext text/x-wiki '''<BIG>Introduction to Scientific Computing</BIG>''' Course Info * Course Numbers CHM 4932-004/6938-010, CRN: 22347/22348 * Credit Hours: 3 * Meeting Dates: January 22 - April 27, 2016 ** No Class Jan. 18 or Mar. 14-19 * Meeting Times: Mon. and Wed., 12:30-13:45 in SCA 222 ** Lab Session & Office Hours: Fri. 12:30-13:45 in SCA 222 (or SCA 433) == Overview == Mathematical models in the natural sciences take many shapes and forms. The moment they become more complicated than tracking a few variables over time, we have to put away our Excel spreadsheets and make use of a solid foundation in computational science. The course establishes this foundation by introducing data structures and algorithms used in everyday scientific computing using examples in the python scripting language. By the end of the Semester, students will be able to navigate the Linux command-line to go from a mathematical model to a numerical solution. Best practices for working with computer code and visualizing data will also be covered. == Topics == # Languages #* bash (shell) #* python (scripting) #* stack & register-based machine languages: overview of C and Fortran syntax & compiling with gcc, ‘thread safety’ #* Shared libraries & language inter-operability (FFI) # Algorithms #* Horner’s algorithm for polynomials #* Newton’s root finding algo. #* Overview of general optimization algo-s (example: linear & nonlin. least-squares) #* Numerical integration (scripted, plus gnu ODE) #* Communication (how HTTP get/put works) # Data Structures #* Linked Lists #* Trees (file system hierarchies) #* Graphs #* Arrays (dense & sparse) example: vectors & rotations / transpositions, densities and difference operators # Presentation & visualization #* Flat CSV files (and excel) #* Working with binary data #* Python matplotlib (2D images) #* Binning histograms & weighted averages # Best Practices #* High-level code design (modularity, interface specifications, unit testing, etc.) #* Code audit: open-source libraries, ex. Gnu Scientific Library, qsort in libc, Boost #* Source code versioning (example: git or mercurial) #* gdb & execution profiling #* documentation #* Makefiles == Grading == '''Grading Scale (out of 400 points possible)''' {| class="wikitable" |- ! Grade ! Undergraduate ! Graduate |- | A | 230 | 300 |- | B | 180 | 230 |- | C | 150 | 180 |- | D | 120 | 150 |} * Points Possible: ** 10 homework assignments (20 points per homework) ** 2 projects / competitions (100 points per project) * Homework Rules ** For work done in groups, credit is divided equally among participants - so the max homework grade for a group of 2 is 10 points each. ** For each homework, 1 re-do at full credit can be sent at any time after the due date, but must present a unique solution to previous work from yourself or others. ** All work must cite co-group members (if any) and the source of any code snippets used online. === Grading Rationale === Homework points will only be awarded for correct, working code and correct algorithmic analysis, while the homework problems will become progressively tougher. Undergraduates should be able to pass the course with an A if they have correctly answered most of the homework, and made a strong attempt at one of the projects. Graduate students should both perform well on the homework and successfully complete one or two projects. Essentially, this means you should do your own homework when possible and may do a project in a small group. The re-grading and group options for homework allow making up for missed assignments, and encourage returning to core concepts at a later point in the class. Students who have completed significant portions of the homework have thus demonstrated programming proficiency, and are qualified for at least B/C grades. == Projects == === Midterm === A description for the midterm project is now available [[Media:midterm.pdf|here]]. The MD section will be updated as we discuss it in class. The due date for the midterm will be Friday, March 11. === Final === TBA == Textbooks and Resources == * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-0072-7 Beginning Python, Hetland, 2005] (eBook avail. from USF Library) * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-3238-4 Python Algorithms, Hetland, 2010] (eBook avail. from USF Library) * [http://aosabook.org/en/index.html The Architecture of Open Source Applications] * [http://docs.python.org Python Documentation] * [https://developers.google.com/edu/python/ Google Introductory Python Notes] * [http://huffman.sourceforge.net/tao/tao-of-programming.html Tao of Programming] Other (possibly useful) materials: * [http://hackersdictionary.com/html/entry/larval-stage.html The Jargon File] * Chapters 7&8 of Modelling and Simulation, Birta and Arbez, Springer 2007 (eBook avail. from USF Library). * Chapters 4-6 of Models and Algorithms for Intelligent Data Analysis, Runkler, Springer 2012 (eBook avail. from USF Library). * Guide to Scientific Computing in C++, Francis and Whiteley, Springer, 2012. (eBook avail. from USF Library) * Extra info. On the basics: ** Chapters 3 and 7 of Mathematics in Computing, Regan, Springer 2013. (eBook avail. from USF Library) ** Instant feedback graphical programming with [https://www.khanacademy.org/cs/programming/ Khan Academy] * [http://www.meetup.com/python-178/ Local PyBulls Meetings] Code: * [http://carsonfarmer.com/2013/07/essential-python-geo-libraries Python Libraries Useful for Geospatial Problems] * [[Code#Python_Libraries|Python Libraries Useful for Computational Chemistry]] (very small list at present) Interactive Interpreters: * [http://www.codewars.com CodeWars] Recommended for building experience with practice problems. * [http://exercism.io Exercism] A command-line client with a similar learn-through-challenge philosophy. * [http://repl.it repl.it] A read-eval-print loop for several computer languages. * [http://en.cppreference.com/w/cpp/language CppReference] Documentation with an online evaluator for C++ code. === Notes === * [[Media:intro.pdf|Notes]] for Week 1 ** Over the first two weeks or so, we'll be practicing the basics - so read through Chapters 1-3 of Hetland's Beginning Python during this time. ** [[PythonTranslated|Important Definitions]] * [[Media:Week2.pdf|Notes]] for Week 2 ** [[Code:Oware|Oware code]] ** Solutions for some problems in Week 2's notes: <source lang="python"> # simple data types "a string" # : str x = [1, 2, 3] # : [int] # compound data type (1, "name", (x, x)) # : (int, str, ([int], [int])) # add_one : int -> int # str.__add__ : str -> str -> str # str.split : str -> [str] # str.__mod__ : str -> (Objects) -> str </source> * [[Media:Week3.pdf|Notes]] for Week 3-4 ** Reading assignment - read through Chapter 5 and 6 (and practice dictionaries from Ch. 4) ** [[Code:for_patterns|Abstracting patterns]] in for loops. * [[Media:Week5.pdf|Notes]] for Week 5-6 ** Reading assignment - Read Chapter 10-11 (and refer to Ch. 4) * By this point, we've covered all the basics: ** base types: str, int, float, [a] ** variables and substitution: j vs "4" vs 4 ** indexing and slicing into lists / strings: x[1:4] or x[i:j] ** control flow: if and for syntax ** functions implementing patterns: def next(r, x): return r*x*(1-x) * You should be able to use these for: ** finding and abstracting the pattern ** naming the type of a function ** determining which variable names are in scope * All that's left is learning common uses, patterns and even more syntax! * [[Media:Week7-8.pdf|Notes]] for Week 7-8 * [[Media:Week9-10.pdf|Notes]] for Week 9-10 * In-Class Examples * [[Gorillaz Code]] * [[File:Wat3-ccsd.txt]] Output of Multiwfn for a Na+(H20)_3 molecular cluster. * [[File:water_rdf.txt]] Water center of mass radial distribution function. === Homework === * [[CompSciHW1|Homework 1]] is due Monday, January 25. * [[CompSciHW2|Homework 2]] is due Monday, February 8. * [[CompSciHW3|Homework 3]] is due Friday, February 19. * [[CompSciHW4|Homework 4]] is due Friday, February 26. * [[CompSciHW5|Homework 5]] is due Friday, March 4. * [[CompSciHW6|Homework 6]] is due Friday, March 25. == Group Work Pages == Group 1 [https://docs.google.com/document/d/1k6vruCx78aV0pL8Kw7WWtsw_-6zgdoeP0OvujSzbsh0/edit?usp=sharing]: Group 2 [https://docs.google.com/document/d/1MgpVly2D1h9Xt_lFh5ywa3b70Ul9ES6OQZtg5l_n0NM/edit?usp=sharing] Group 3 [https://docs.google.com/document/d/1LT_J-vObN9tPa1JoQ1B_h04ENsL5Ko2xeFeRMp-99f8/edit?usp=sharing] Group 4 [https://docs.google.com/document/d/1hGlNlg1w7_3qCo6LE-y9rSZx1Chwc0FBUoxK6cyzWW8/edit?usp=sharing] e898c71ee4ff6e46da5a242494ea4a457177ac11 488 487 2016-03-28T15:46:32Z David M. Rogers 2 /* Notes */ wikitext text/x-wiki '''<BIG>Introduction to Scientific Computing</BIG>''' Course Info * Course Numbers CHM 4932-004/6938-010, CRN: 22347/22348 * Credit Hours: 3 * Meeting Dates: January 22 - April 27, 2016 ** No Class Jan. 18 or Mar. 14-19 * Meeting Times: Mon. and Wed., 12:30-13:45 in SCA 222 ** Lab Session & Office Hours: Fri. 12:30-13:45 in SCA 222 (or SCA 433) == Overview == Mathematical models in the natural sciences take many shapes and forms. The moment they become more complicated than tracking a few variables over time, we have to put away our Excel spreadsheets and make use of a solid foundation in computational science. The course establishes this foundation by introducing data structures and algorithms used in everyday scientific computing using examples in the python scripting language. By the end of the Semester, students will be able to navigate the Linux command-line to go from a mathematical model to a numerical solution. Best practices for working with computer code and visualizing data will also be covered. == Topics == # Languages #* bash (shell) #* python (scripting) #* stack & register-based machine languages: overview of C and Fortran syntax & compiling with gcc, ‘thread safety’ #* Shared libraries & language inter-operability (FFI) # Algorithms #* Horner’s algorithm for polynomials #* Newton’s root finding algo. #* Overview of general optimization algo-s (example: linear & nonlin. least-squares) #* Numerical integration (scripted, plus gnu ODE) #* Communication (how HTTP get/put works) # Data Structures #* Linked Lists #* Trees (file system hierarchies) #* Graphs #* Arrays (dense & sparse) example: vectors & rotations / transpositions, densities and difference operators # Presentation & visualization #* Flat CSV files (and excel) #* Working with binary data #* Python matplotlib (2D images) #* Binning histograms & weighted averages # Best Practices #* High-level code design (modularity, interface specifications, unit testing, etc.) #* Code audit: open-source libraries, ex. Gnu Scientific Library, qsort in libc, Boost #* Source code versioning (example: git or mercurial) #* gdb & execution profiling #* documentation #* Makefiles == Grading == '''Grading Scale (out of 400 points possible)''' {| class="wikitable" |- ! Grade ! Undergraduate ! Graduate |- | A | 230 | 300 |- | B | 180 | 230 |- | C | 150 | 180 |- | D | 120 | 150 |} * Points Possible: ** 10 homework assignments (20 points per homework) ** 2 projects / competitions (100 points per project) * Homework Rules ** For work done in groups, credit is divided equally among participants - so the max homework grade for a group of 2 is 10 points each. ** For each homework, 1 re-do at full credit can be sent at any time after the due date, but must present a unique solution to previous work from yourself or others. ** All work must cite co-group members (if any) and the source of any code snippets used online. === Grading Rationale === Homework points will only be awarded for correct, working code and correct algorithmic analysis, while the homework problems will become progressively tougher. Undergraduates should be able to pass the course with an A if they have correctly answered most of the homework, and made a strong attempt at one of the projects. Graduate students should both perform well on the homework and successfully complete one or two projects. Essentially, this means you should do your own homework when possible and may do a project in a small group. The re-grading and group options for homework allow making up for missed assignments, and encourage returning to core concepts at a later point in the class. Students who have completed significant portions of the homework have thus demonstrated programming proficiency, and are qualified for at least B/C grades. == Projects == === Midterm === A description for the midterm project is now available [[Media:midterm.pdf|here]]. The MD section will be updated as we discuss it in class. The due date for the midterm will be Friday, March 11. === Final === TBA == Textbooks and Resources == * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-0072-7 Beginning Python, Hetland, 2005] (eBook avail. from USF Library) * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-3238-4 Python Algorithms, Hetland, 2010] (eBook avail. from USF Library) * [http://aosabook.org/en/index.html The Architecture of Open Source Applications] * [http://docs.python.org Python Documentation] * [https://developers.google.com/edu/python/ Google Introductory Python Notes] * [http://huffman.sourceforge.net/tao/tao-of-programming.html Tao of Programming] Other (possibly useful) materials: * [http://hackersdictionary.com/html/entry/larval-stage.html The Jargon File] * Chapters 7&8 of Modelling and Simulation, Birta and Arbez, Springer 2007 (eBook avail. from USF Library). * Chapters 4-6 of Models and Algorithms for Intelligent Data Analysis, Runkler, Springer 2012 (eBook avail. from USF Library). * Guide to Scientific Computing in C++, Francis and Whiteley, Springer, 2012. (eBook avail. from USF Library) * Extra info. On the basics: ** Chapters 3 and 7 of Mathematics in Computing, Regan, Springer 2013. (eBook avail. from USF Library) ** Instant feedback graphical programming with [https://www.khanacademy.org/cs/programming/ Khan Academy] * [http://www.meetup.com/python-178/ Local PyBulls Meetings] Code: * [http://carsonfarmer.com/2013/07/essential-python-geo-libraries Python Libraries Useful for Geospatial Problems] * [[Code#Python_Libraries|Python Libraries Useful for Computational Chemistry]] (very small list at present) Interactive Interpreters: * [http://www.codewars.com CodeWars] Recommended for building experience with practice problems. * [http://exercism.io Exercism] A command-line client with a similar learn-through-challenge philosophy. * [http://repl.it repl.it] A read-eval-print loop for several computer languages. * [http://en.cppreference.com/w/cpp/language CppReference] Documentation with an online evaluator for C++ code. === Notes === * [[Media:intro.pdf|Notes]] for Week 1 ** Over the first two weeks or so, we'll be practicing the basics - so read through Chapters 1-3 of Hetland's Beginning Python during this time. ** [[PythonTranslated|Important Definitions]] * [[Media:Week2.pdf|Notes]] for Week 2 ** [[Code:Oware|Oware code]] ** Solutions for some problems in Week 2's notes: <source lang="python"> # simple data types "a string" # : str x = [1, 2, 3] # : [int] # compound data type (1, "name", (x, x)) # : (int, str, ([int], [int])) # add_one : int -> int # str.__add__ : str -> str -> str # str.split : str -> [str] # str.__mod__ : str -> (Objects) -> str </source> * [[Media:Week3.pdf|Notes]] for Week 3-4 ** Reading assignment - read through Chapter 5 and 6 (and practice dictionaries from Ch. 4) ** [[Code:for_patterns|Abstracting patterns]] in for loops. * [[Media:Week5.pdf|Notes]] for Week 5-6 ** Reading assignment - Read Chapter 10-11 (and refer to Ch. 4) * By this point, we've covered all the basics: ** base types: str, int, float, [a] ** variables and substitution: j vs "4" vs 4 ** indexing and slicing into lists / strings: x[1:4] or x[i:j] ** control flow: if and for syntax ** functions implementing patterns: def next(r, x): return r*x*(1-x) * You should be able to use these for: ** finding and abstracting the pattern ** naming the type of a function ** determining which variable names are in scope * All that's left is learning common uses, patterns and even more syntax! * [[Media:Week7-8.pdf|Notes]] for Week 7-8 * [[Media:Week9-10.pdf|Notes]] for Week 9-10 * [[Media:Week11.pdf|Notes]] for Week 11 * In-Class Examples * [[Gorillaz Code]] * [[File:Wat3-ccsd.txt]] Output of Multiwfn for a Na+(H20)_3 molecular cluster. * [[File:water_rdf.txt]] Water center of mass radial distribution function. === Homework === * [[CompSciHW1|Homework 1]] is due Monday, January 25. * [[CompSciHW2|Homework 2]] is due Monday, February 8. * [[CompSciHW3|Homework 3]] is due Friday, February 19. * [[CompSciHW4|Homework 4]] is due Friday, February 26. * [[CompSciHW5|Homework 5]] is due Friday, March 4. * [[CompSciHW6|Homework 6]] is due Friday, March 25. == Group Work Pages == Group 1 [https://docs.google.com/document/d/1k6vruCx78aV0pL8Kw7WWtsw_-6zgdoeP0OvujSzbsh0/edit?usp=sharing]: Group 2 [https://docs.google.com/document/d/1MgpVly2D1h9Xt_lFh5ywa3b70Ul9ES6OQZtg5l_n0NM/edit?usp=sharing] Group 3 [https://docs.google.com/document/d/1LT_J-vObN9tPa1JoQ1B_h04ENsL5Ko2xeFeRMp-99f8/edit?usp=sharing] Group 4 [https://docs.google.com/document/d/1hGlNlg1w7_3qCo6LE-y9rSZx1Chwc0FBUoxK6cyzWW8/edit?usp=sharing] 20331adee1f1ccbb3bbe76aece69bbb5aa3f9b0a 491 488 2016-03-30T00:46:50Z David M. Rogers 2 /* Homework */ wikitext text/x-wiki '''<BIG>Introduction to Scientific Computing</BIG>''' Course Info * Course Numbers CHM 4932-004/6938-010, CRN: 22347/22348 * Credit Hours: 3 * Meeting Dates: January 22 - April 27, 2016 ** No Class Jan. 18 or Mar. 14-19 * Meeting Times: Mon. and Wed., 12:30-13:45 in SCA 222 ** Lab Session & Office Hours: Fri. 12:30-13:45 in SCA 222 (or SCA 433) == Overview == Mathematical models in the natural sciences take many shapes and forms. The moment they become more complicated than tracking a few variables over time, we have to put away our Excel spreadsheets and make use of a solid foundation in computational science. The course establishes this foundation by introducing data structures and algorithms used in everyday scientific computing using examples in the python scripting language. By the end of the Semester, students will be able to navigate the Linux command-line to go from a mathematical model to a numerical solution. Best practices for working with computer code and visualizing data will also be covered. == Topics == # Languages #* bash (shell) #* python (scripting) #* stack & register-based machine languages: overview of C and Fortran syntax & compiling with gcc, ‘thread safety’ #* Shared libraries & language inter-operability (FFI) # Algorithms #* Horner’s algorithm for polynomials #* Newton’s root finding algo. #* Overview of general optimization algo-s (example: linear & nonlin. least-squares) #* Numerical integration (scripted, plus gnu ODE) #* Communication (how HTTP get/put works) # Data Structures #* Linked Lists #* Trees (file system hierarchies) #* Graphs #* Arrays (dense & sparse) example: vectors & rotations / transpositions, densities and difference operators # Presentation & visualization #* Flat CSV files (and excel) #* Working with binary data #* Python matplotlib (2D images) #* Binning histograms & weighted averages # Best Practices #* High-level code design (modularity, interface specifications, unit testing, etc.) #* Code audit: open-source libraries, ex. Gnu Scientific Library, qsort in libc, Boost #* Source code versioning (example: git or mercurial) #* gdb & execution profiling #* documentation #* Makefiles == Grading == '''Grading Scale (out of 400 points possible)''' {| class="wikitable" |- ! Grade ! Undergraduate ! Graduate |- | A | 230 | 300 |- | B | 180 | 230 |- | C | 150 | 180 |- | D | 120 | 150 |} * Points Possible: ** 10 homework assignments (20 points per homework) ** 2 projects / competitions (100 points per project) * Homework Rules ** For work done in groups, credit is divided equally among participants - so the max homework grade for a group of 2 is 10 points each. ** For each homework, 1 re-do at full credit can be sent at any time after the due date, but must present a unique solution to previous work from yourself or others. ** All work must cite co-group members (if any) and the source of any code snippets used online. === Grading Rationale === Homework points will only be awarded for correct, working code and correct algorithmic analysis, while the homework problems will become progressively tougher. Undergraduates should be able to pass the course with an A if they have correctly answered most of the homework, and made a strong attempt at one of the projects. Graduate students should both perform well on the homework and successfully complete one or two projects. Essentially, this means you should do your own homework when possible and may do a project in a small group. The re-grading and group options for homework allow making up for missed assignments, and encourage returning to core concepts at a later point in the class. Students who have completed significant portions of the homework have thus demonstrated programming proficiency, and are qualified for at least B/C grades. == Projects == === Midterm === A description for the midterm project is now available [[Media:midterm.pdf|here]]. The MD section will be updated as we discuss it in class. The due date for the midterm will be Friday, March 11. === Final === TBA == Textbooks and Resources == * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-0072-7 Beginning Python, Hetland, 2005] (eBook avail. from USF Library) * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-3238-4 Python Algorithms, Hetland, 2010] (eBook avail. from USF Library) * [http://aosabook.org/en/index.html The Architecture of Open Source Applications] * [http://docs.python.org Python Documentation] * [https://developers.google.com/edu/python/ Google Introductory Python Notes] * [http://huffman.sourceforge.net/tao/tao-of-programming.html Tao of Programming] Other (possibly useful) materials: * [http://hackersdictionary.com/html/entry/larval-stage.html The Jargon File] * Chapters 7&8 of Modelling and Simulation, Birta and Arbez, Springer 2007 (eBook avail. from USF Library). * Chapters 4-6 of Models and Algorithms for Intelligent Data Analysis, Runkler, Springer 2012 (eBook avail. from USF Library). * Guide to Scientific Computing in C++, Francis and Whiteley, Springer, 2012. (eBook avail. from USF Library) * Extra info. On the basics: ** Chapters 3 and 7 of Mathematics in Computing, Regan, Springer 2013. (eBook avail. from USF Library) ** Instant feedback graphical programming with [https://www.khanacademy.org/cs/programming/ Khan Academy] * [http://www.meetup.com/python-178/ Local PyBulls Meetings] Code: * [http://carsonfarmer.com/2013/07/essential-python-geo-libraries Python Libraries Useful for Geospatial Problems] * [[Code#Python_Libraries|Python Libraries Useful for Computational Chemistry]] (very small list at present) Interactive Interpreters: * [http://www.codewars.com CodeWars] Recommended for building experience with practice problems. * [http://exercism.io Exercism] A command-line client with a similar learn-through-challenge philosophy. * [http://repl.it repl.it] A read-eval-print loop for several computer languages. * [http://en.cppreference.com/w/cpp/language CppReference] Documentation with an online evaluator for C++ code. === Notes === * [[Media:intro.pdf|Notes]] for Week 1 ** Over the first two weeks or so, we'll be practicing the basics - so read through Chapters 1-3 of Hetland's Beginning Python during this time. ** [[PythonTranslated|Important Definitions]] * [[Media:Week2.pdf|Notes]] for Week 2 ** [[Code:Oware|Oware code]] ** Solutions for some problems in Week 2's notes: <source lang="python"> # simple data types "a string" # : str x = [1, 2, 3] # : [int] # compound data type (1, "name", (x, x)) # : (int, str, ([int], [int])) # add_one : int -> int # str.__add__ : str -> str -> str # str.split : str -> [str] # str.__mod__ : str -> (Objects) -> str </source> * [[Media:Week3.pdf|Notes]] for Week 3-4 ** Reading assignment - read through Chapter 5 and 6 (and practice dictionaries from Ch. 4) ** [[Code:for_patterns|Abstracting patterns]] in for loops. * [[Media:Week5.pdf|Notes]] for Week 5-6 ** Reading assignment - Read Chapter 10-11 (and refer to Ch. 4) * By this point, we've covered all the basics: ** base types: str, int, float, [a] ** variables and substitution: j vs "4" vs 4 ** indexing and slicing into lists / strings: x[1:4] or x[i:j] ** control flow: if and for syntax ** functions implementing patterns: def next(r, x): return r*x*(1-x) * You should be able to use these for: ** finding and abstracting the pattern ** naming the type of a function ** determining which variable names are in scope * All that's left is learning common uses, patterns and even more syntax! * [[Media:Week7-8.pdf|Notes]] for Week 7-8 * [[Media:Week9-10.pdf|Notes]] for Week 9-10 * [[Media:Week11.pdf|Notes]] for Week 11 * In-Class Examples * [[Gorillaz Code]] * [[File:Wat3-ccsd.txt]] Output of Multiwfn for a Na+(H20)_3 molecular cluster. * [[File:water_rdf.txt]] Water center of mass radial distribution function. === Homework === * [[CompSciHW1|Homework 1]] is due Monday, January 25. * [[CompSciHW2|Homework 2]] is due Monday, February 8. * [[CompSciHW3|Homework 3]] is due Friday, February 19. * [[CompSciHW4|Homework 4]] is due Friday, February 26. * [[CompSciHW5|Homework 5]] is due Friday, March 4. * [[CompSciHW6|Homework 6]] is due Wednesday, March 30. * [[CompSciHW6|Homework 7]] is due Friday, April 1. == Group Work Pages == Group 1 [https://docs.google.com/document/d/1k6vruCx78aV0pL8Kw7WWtsw_-6zgdoeP0OvujSzbsh0/edit?usp=sharing]: Group 2 [https://docs.google.com/document/d/1MgpVly2D1h9Xt_lFh5ywa3b70Ul9ES6OQZtg5l_n0NM/edit?usp=sharing] Group 3 [https://docs.google.com/document/d/1LT_J-vObN9tPa1JoQ1B_h04ENsL5Ko2xeFeRMp-99f8/edit?usp=sharing] Group 4 [https://docs.google.com/document/d/1hGlNlg1w7_3qCo6LE-y9rSZx1Chwc0FBUoxK6cyzWW8/edit?usp=sharing] da1a5c174f61df4fb2918f2b7461d0008ede0c35 492 491 2016-03-30T00:54:18Z David M. Rogers 2 /* Homework */ wikitext text/x-wiki '''<BIG>Introduction to Scientific Computing</BIG>''' Course Info * Course Numbers CHM 4932-004/6938-010, CRN: 22347/22348 * Credit Hours: 3 * Meeting Dates: January 22 - April 27, 2016 ** No Class Jan. 18 or Mar. 14-19 * Meeting Times: Mon. and Wed., 12:30-13:45 in SCA 222 ** Lab Session & Office Hours: Fri. 12:30-13:45 in SCA 222 (or SCA 433) == Overview == Mathematical models in the natural sciences take many shapes and forms. The moment they become more complicated than tracking a few variables over time, we have to put away our Excel spreadsheets and make use of a solid foundation in computational science. The course establishes this foundation by introducing data structures and algorithms used in everyday scientific computing using examples in the python scripting language. By the end of the Semester, students will be able to navigate the Linux command-line to go from a mathematical model to a numerical solution. Best practices for working with computer code and visualizing data will also be covered. == Topics == # Languages #* bash (shell) #* python (scripting) #* stack & register-based machine languages: overview of C and Fortran syntax & compiling with gcc, ‘thread safety’ #* Shared libraries & language inter-operability (FFI) # Algorithms #* Horner’s algorithm for polynomials #* Newton’s root finding algo. #* Overview of general optimization algo-s (example: linear & nonlin. least-squares) #* Numerical integration (scripted, plus gnu ODE) #* Communication (how HTTP get/put works) # Data Structures #* Linked Lists #* Trees (file system hierarchies) #* Graphs #* Arrays (dense & sparse) example: vectors & rotations / transpositions, densities and difference operators # Presentation & visualization #* Flat CSV files (and excel) #* Working with binary data #* Python matplotlib (2D images) #* Binning histograms & weighted averages # Best Practices #* High-level code design (modularity, interface specifications, unit testing, etc.) #* Code audit: open-source libraries, ex. Gnu Scientific Library, qsort in libc, Boost #* Source code versioning (example: git or mercurial) #* gdb & execution profiling #* documentation #* Makefiles == Grading == '''Grading Scale (out of 400 points possible)''' {| class="wikitable" |- ! Grade ! Undergraduate ! Graduate |- | A | 230 | 300 |- | B | 180 | 230 |- | C | 150 | 180 |- | D | 120 | 150 |} * Points Possible: ** 10 homework assignments (20 points per homework) ** 2 projects / competitions (100 points per project) * Homework Rules ** For work done in groups, credit is divided equally among participants - so the max homework grade for a group of 2 is 10 points each. ** For each homework, 1 re-do at full credit can be sent at any time after the due date, but must present a unique solution to previous work from yourself or others. ** All work must cite co-group members (if any) and the source of any code snippets used online. === Grading Rationale === Homework points will only be awarded for correct, working code and correct algorithmic analysis, while the homework problems will become progressively tougher. Undergraduates should be able to pass the course with an A if they have correctly answered most of the homework, and made a strong attempt at one of the projects. Graduate students should both perform well on the homework and successfully complete one or two projects. Essentially, this means you should do your own homework when possible and may do a project in a small group. The re-grading and group options for homework allow making up for missed assignments, and encourage returning to core concepts at a later point in the class. Students who have completed significant portions of the homework have thus demonstrated programming proficiency, and are qualified for at least B/C grades. == Projects == === Midterm === A description for the midterm project is now available [[Media:midterm.pdf|here]]. The MD section will be updated as we discuss it in class. The due date for the midterm will be Friday, March 11. === Final === TBA == Textbooks and Resources == * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-0072-7 Beginning Python, Hetland, 2005] (eBook avail. from USF Library) * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-3238-4 Python Algorithms, Hetland, 2010] (eBook avail. from USF Library) * [http://aosabook.org/en/index.html The Architecture of Open Source Applications] * [http://docs.python.org Python Documentation] * [https://developers.google.com/edu/python/ Google Introductory Python Notes] * [http://huffman.sourceforge.net/tao/tao-of-programming.html Tao of Programming] Other (possibly useful) materials: * [http://hackersdictionary.com/html/entry/larval-stage.html The Jargon File] * Chapters 7&8 of Modelling and Simulation, Birta and Arbez, Springer 2007 (eBook avail. from USF Library). * Chapters 4-6 of Models and Algorithms for Intelligent Data Analysis, Runkler, Springer 2012 (eBook avail. from USF Library). * Guide to Scientific Computing in C++, Francis and Whiteley, Springer, 2012. (eBook avail. from USF Library) * Extra info. On the basics: ** Chapters 3 and 7 of Mathematics in Computing, Regan, Springer 2013. (eBook avail. from USF Library) ** Instant feedback graphical programming with [https://www.khanacademy.org/cs/programming/ Khan Academy] * [http://www.meetup.com/python-178/ Local PyBulls Meetings] Code: * [http://carsonfarmer.com/2013/07/essential-python-geo-libraries Python Libraries Useful for Geospatial Problems] * [[Code#Python_Libraries|Python Libraries Useful for Computational Chemistry]] (very small list at present) Interactive Interpreters: * [http://www.codewars.com CodeWars] Recommended for building experience with practice problems. * [http://exercism.io Exercism] A command-line client with a similar learn-through-challenge philosophy. * [http://repl.it repl.it] A read-eval-print loop for several computer languages. * [http://en.cppreference.com/w/cpp/language CppReference] Documentation with an online evaluator for C++ code. === Notes === * [[Media:intro.pdf|Notes]] for Week 1 ** Over the first two weeks or so, we'll be practicing the basics - so read through Chapters 1-3 of Hetland's Beginning Python during this time. ** [[PythonTranslated|Important Definitions]] * [[Media:Week2.pdf|Notes]] for Week 2 ** [[Code:Oware|Oware code]] ** Solutions for some problems in Week 2's notes: <source lang="python"> # simple data types "a string" # : str x = [1, 2, 3] # : [int] # compound data type (1, "name", (x, x)) # : (int, str, ([int], [int])) # add_one : int -> int # str.__add__ : str -> str -> str # str.split : str -> [str] # str.__mod__ : str -> (Objects) -> str </source> * [[Media:Week3.pdf|Notes]] for Week 3-4 ** Reading assignment - read through Chapter 5 and 6 (and practice dictionaries from Ch. 4) ** [[Code:for_patterns|Abstracting patterns]] in for loops. * [[Media:Week5.pdf|Notes]] for Week 5-6 ** Reading assignment - Read Chapter 10-11 (and refer to Ch. 4) * By this point, we've covered all the basics: ** base types: str, int, float, [a] ** variables and substitution: j vs "4" vs 4 ** indexing and slicing into lists / strings: x[1:4] or x[i:j] ** control flow: if and for syntax ** functions implementing patterns: def next(r, x): return r*x*(1-x) * You should be able to use these for: ** finding and abstracting the pattern ** naming the type of a function ** determining which variable names are in scope * All that's left is learning common uses, patterns and even more syntax! * [[Media:Week7-8.pdf|Notes]] for Week 7-8 * [[Media:Week9-10.pdf|Notes]] for Week 9-10 * [[Media:Week11.pdf|Notes]] for Week 11 * In-Class Examples * [[Gorillaz Code]] * [[File:Wat3-ccsd.txt]] Output of Multiwfn for a Na+(H20)_3 molecular cluster. * [[File:water_rdf.txt]] Water center of mass radial distribution function. === Homework === * [[CompSciHW1|Homework 1]] is due Monday, January 25. * [[CompSciHW2|Homework 2]] is due Monday, February 8. * [[CompSciHW3|Homework 3]] is due Friday, February 19. * [[CompSciHW4|Homework 4]] is due Friday, February 26. * [[CompSciHW5|Homework 5]] is due Friday, March 4. * [[CompSciHW6|Homework 6]] is due Wednesday, March 30. * [[CompSciHW7|Homework 7]] is due Friday, April 1. == Group Work Pages == Group 1 [https://docs.google.com/document/d/1k6vruCx78aV0pL8Kw7WWtsw_-6zgdoeP0OvujSzbsh0/edit?usp=sharing]: Group 2 [https://docs.google.com/document/d/1MgpVly2D1h9Xt_lFh5ywa3b70Ul9ES6OQZtg5l_n0NM/edit?usp=sharing] Group 3 [https://docs.google.com/document/d/1LT_J-vObN9tPa1JoQ1B_h04ENsL5Ko2xeFeRMp-99f8/edit?usp=sharing] Group 4 [https://docs.google.com/document/d/1hGlNlg1w7_3qCo6LE-y9rSZx1Chwc0FBUoxK6cyzWW8/edit?usp=sharing] 32672d6cd688999bd4972ef2df93ffa89a1ae57d 493 492 2016-03-30T16:22:34Z David M. Rogers 2 /* Group Work Pages */ wikitext text/x-wiki '''<BIG>Introduction to Scientific Computing</BIG>''' Course Info * Course Numbers CHM 4932-004/6938-010, CRN: 22347/22348 * Credit Hours: 3 * Meeting Dates: January 22 - April 27, 2016 ** No Class Jan. 18 or Mar. 14-19 * Meeting Times: Mon. and Wed., 12:30-13:45 in SCA 222 ** Lab Session & Office Hours: Fri. 12:30-13:45 in SCA 222 (or SCA 433) == Overview == Mathematical models in the natural sciences take many shapes and forms. The moment they become more complicated than tracking a few variables over time, we have to put away our Excel spreadsheets and make use of a solid foundation in computational science. The course establishes this foundation by introducing data structures and algorithms used in everyday scientific computing using examples in the python scripting language. By the end of the Semester, students will be able to navigate the Linux command-line to go from a mathematical model to a numerical solution. Best practices for working with computer code and visualizing data will also be covered. == Topics == # Languages #* bash (shell) #* python (scripting) #* stack & register-based machine languages: overview of C and Fortran syntax & compiling with gcc, ‘thread safety’ #* Shared libraries & language inter-operability (FFI) # Algorithms #* Horner’s algorithm for polynomials #* Newton’s root finding algo. #* Overview of general optimization algo-s (example: linear & nonlin. least-squares) #* Numerical integration (scripted, plus gnu ODE) #* Communication (how HTTP get/put works) # Data Structures #* Linked Lists #* Trees (file system hierarchies) #* Graphs #* Arrays (dense & sparse) example: vectors & rotations / transpositions, densities and difference operators # Presentation & visualization #* Flat CSV files (and excel) #* Working with binary data #* Python matplotlib (2D images) #* Binning histograms & weighted averages # Best Practices #* High-level code design (modularity, interface specifications, unit testing, etc.) #* Code audit: open-source libraries, ex. Gnu Scientific Library, qsort in libc, Boost #* Source code versioning (example: git or mercurial) #* gdb & execution profiling #* documentation #* Makefiles == Grading == '''Grading Scale (out of 400 points possible)''' {| class="wikitable" |- ! Grade ! Undergraduate ! Graduate |- | A | 230 | 300 |- | B | 180 | 230 |- | C | 150 | 180 |- | D | 120 | 150 |} * Points Possible: ** 10 homework assignments (20 points per homework) ** 2 projects / competitions (100 points per project) * Homework Rules ** For work done in groups, credit is divided equally among participants - so the max homework grade for a group of 2 is 10 points each. ** For each homework, 1 re-do at full credit can be sent at any time after the due date, but must present a unique solution to previous work from yourself or others. ** All work must cite co-group members (if any) and the source of any code snippets used online. === Grading Rationale === Homework points will only be awarded for correct, working code and correct algorithmic analysis, while the homework problems will become progressively tougher. Undergraduates should be able to pass the course with an A if they have correctly answered most of the homework, and made a strong attempt at one of the projects. Graduate students should both perform well on the homework and successfully complete one or two projects. Essentially, this means you should do your own homework when possible and may do a project in a small group. The re-grading and group options for homework allow making up for missed assignments, and encourage returning to core concepts at a later point in the class. Students who have completed significant portions of the homework have thus demonstrated programming proficiency, and are qualified for at least B/C grades. == Projects == === Midterm === A description for the midterm project is now available [[Media:midterm.pdf|here]]. The MD section will be updated as we discuss it in class. The due date for the midterm will be Friday, March 11. === Final === TBA == Textbooks and Resources == * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-0072-7 Beginning Python, Hetland, 2005] (eBook avail. from USF Library) * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-3238-4 Python Algorithms, Hetland, 2010] (eBook avail. from USF Library) * [http://aosabook.org/en/index.html The Architecture of Open Source Applications] * [http://docs.python.org Python Documentation] * [https://developers.google.com/edu/python/ Google Introductory Python Notes] * [http://huffman.sourceforge.net/tao/tao-of-programming.html Tao of Programming] Other (possibly useful) materials: * [http://hackersdictionary.com/html/entry/larval-stage.html The Jargon File] * Chapters 7&8 of Modelling and Simulation, Birta and Arbez, Springer 2007 (eBook avail. from USF Library). * Chapters 4-6 of Models and Algorithms for Intelligent Data Analysis, Runkler, Springer 2012 (eBook avail. from USF Library). * Guide to Scientific Computing in C++, Francis and Whiteley, Springer, 2012. (eBook avail. from USF Library) * Extra info. On the basics: ** Chapters 3 and 7 of Mathematics in Computing, Regan, Springer 2013. (eBook avail. from USF Library) ** Instant feedback graphical programming with [https://www.khanacademy.org/cs/programming/ Khan Academy] * [http://www.meetup.com/python-178/ Local PyBulls Meetings] Code: * [http://carsonfarmer.com/2013/07/essential-python-geo-libraries Python Libraries Useful for Geospatial Problems] * [[Code#Python_Libraries|Python Libraries Useful for Computational Chemistry]] (very small list at present) Interactive Interpreters: * [http://www.codewars.com CodeWars] Recommended for building experience with practice problems. * [http://exercism.io Exercism] A command-line client with a similar learn-through-challenge philosophy. * [http://repl.it repl.it] A read-eval-print loop for several computer languages. * [http://en.cppreference.com/w/cpp/language CppReference] Documentation with an online evaluator for C++ code. === Notes === * [[Media:intro.pdf|Notes]] for Week 1 ** Over the first two weeks or so, we'll be practicing the basics - so read through Chapters 1-3 of Hetland's Beginning Python during this time. ** [[PythonTranslated|Important Definitions]] * [[Media:Week2.pdf|Notes]] for Week 2 ** [[Code:Oware|Oware code]] ** Solutions for some problems in Week 2's notes: <source lang="python"> # simple data types "a string" # : str x = [1, 2, 3] # : [int] # compound data type (1, "name", (x, x)) # : (int, str, ([int], [int])) # add_one : int -> int # str.__add__ : str -> str -> str # str.split : str -> [str] # str.__mod__ : str -> (Objects) -> str </source> * [[Media:Week3.pdf|Notes]] for Week 3-4 ** Reading assignment - read through Chapter 5 and 6 (and practice dictionaries from Ch. 4) ** [[Code:for_patterns|Abstracting patterns]] in for loops. * [[Media:Week5.pdf|Notes]] for Week 5-6 ** Reading assignment - Read Chapter 10-11 (and refer to Ch. 4) * By this point, we've covered all the basics: ** base types: str, int, float, [a] ** variables and substitution: j vs "4" vs 4 ** indexing and slicing into lists / strings: x[1:4] or x[i:j] ** control flow: if and for syntax ** functions implementing patterns: def next(r, x): return r*x*(1-x) * You should be able to use these for: ** finding and abstracting the pattern ** naming the type of a function ** determining which variable names are in scope * All that's left is learning common uses, patterns and even more syntax! * [[Media:Week7-8.pdf|Notes]] for Week 7-8 * [[Media:Week9-10.pdf|Notes]] for Week 9-10 * [[Media:Week11.pdf|Notes]] for Week 11 * In-Class Examples * [[Gorillaz Code]] * [[File:Wat3-ccsd.txt]] Output of Multiwfn for a Na+(H20)_3 molecular cluster. * [[File:water_rdf.txt]] Water center of mass radial distribution function. === Homework === * [[CompSciHW1|Homework 1]] is due Monday, January 25. * [[CompSciHW2|Homework 2]] is due Monday, February 8. * [[CompSciHW3|Homework 3]] is due Friday, February 19. * [[CompSciHW4|Homework 4]] is due Friday, February 26. * [[CompSciHW5|Homework 5]] is due Friday, March 4. * [[CompSciHW6|Homework 6]] is due Wednesday, March 30. * [[CompSciHW7|Homework 7]] is due Friday, April 1. == Group Work Pages == Group 1 [https://docs.google.com/document/d/1k6vruCx78aV0pL8Kw7WWtsw_-6zgdoeP0OvujSzbsh0/edit?usp=sharing]: Group 2 [https://docs.google.com/document/d/1MgpVly2D1h9Xt_lFh5ywa3b70Ul9ES6OQZtg5l_n0NM/edit?usp=sharing] Group 3 [https://docs.google.com/document/d/1LT_J-vObN9tPa1JoQ1B_h04ENsL5Ko2xeFeRMp-99f8/edit?usp=sharing] Group 4 [https://docs.google.com/document/d/1hGlNlg1w7_3qCo6LE-y9rSZx1Chwc0FBUoxK6cyzWW8/edit?usp=sharing] <source lang="python"> import numpy as np import matplotlib.path as mpath import matplotlib.patches as mpatches import matplotlib.pyplot as plt Path = mpath.Path fig, ax = plt.subplots() #arrows = np.array([[[0.0, 0.0], [0.0, 2.0]]]) arrows = np.array([[0.0, 2.0], [-1,-1], [3,-0.5]]) codes = [Path.MOVETO, Path.LINETO, Path.LINETO, Path.LINETO, Path.LINETO, Path.LINETO] def path_from_vec(x,y,dx,dy): r = (dx*dx+dy*dy)**0.5 a = 0.5 c = 0.2*dx/r s = 0.2*dy/r x1 = x + (r-0.2)*dx/r y1 = y + (r-0.2)*dy/r pathdata = [(x,y), (x1,y1), (x1+s-a*c, y1-c-a*s), (x1+c, y1+s), (x1-s-a*c, y1+c-a*s), (x1,y1)] return pathdata def to_path(v, color='green'): verts = path_from_vec(0., 0., *v) path = mpath.Path(verts, codes) patch = mpatches.PathPatch(path, facecolor=color, edgecolor='k', alpha=0.5) ax.add_patch(patch) return patch class PathInteractor(object): """ An path editor. Key-bindings 't' toggle vertex markers on and off. When vertex markers are on, you can move them, delete them """ showverts = True epsilon = 5 # max pixel distance to count as a vertex hit def __init__(self, vecs): self.paths = [] for v in vecs: path = to_path(v) self.paths.append(path) path.set_animated(True) self.ax = self.paths[0].axes canvas = self.ax.figure.canvas self.vecs = vecs print vecs self.line, = ax.plot(vecs[:,0], vecs[:,1], 'o', markerfacecolor='r', animated=True) self._ind = None # the active vert canvas.mpl_connect('draw_event', self.draw_callback) canvas.mpl_connect('button_press_event', self.button_press_callback) canvas.mpl_connect('key_press_event', self.key_press_callback) canvas.mpl_connect('button_release_event', self.button_release_callback) canvas.mpl_connect('motion_notify_event', self.motion_notify_callback) self.canvas = canvas def draw_callback(self, event): self.background = self.canvas.copy_from_bbox(self.ax.bbox) for path in self.paths: self.ax.draw_artist(path) self.ax.draw_artist(self.line) self.canvas.blit(self.ax.bbox) #def pathpatch_changed(self, pathpatch): # 'this method is called whenever the pathpatchgon object is called' # # only copy the artist props to the line (except visibility) # vis = self.line.get_visible() # #plt.Artist.update_from(self.line, pathpatch) # #self.pathpatch.get_path().vertices[:] = self.vecs ? # self.vecs[self._ind] = x, y # self.line.set_data(zip(*self.vecs)) # # plt.Artist.update_from(self.line, self.vecs) # self.line.set_visible(vis) # don't use the pathpatch visibility state def get_ind_under_point(self, event): 'get the index of the vertex under point if within epsilon tolerance' # display coords xy = self.vecs xyt = self.paths[0].get_transform().transform(xy) xt, yt = xyt[:, 0], xyt[:, 1] d = np.sqrt((xt - event.x)**2 + (yt - event.y)**2) ind = d.argmin() if d[ind] >= self.epsilon: ind = None return ind def button_press_callback(self, event): 'whenever a mouse button is pressed' if not self.showverts: return if event.inaxes is None: return if event.button != 1: return self._ind = self.get_ind_under_point(event) def button_release_callback(self, event): 'whenever a mouse button is released' if not self.showverts: return if event.button != 1: return self._ind = None def key_press_callback(self, event): 'whenever a key is pressed' if not event.inaxes: return if event.key == 't': self.showverts = not self.showverts self.line.set_visible(self.showverts) if not self.showverts: self._ind = None self.canvas.draw() def motion_notify_callback(self, event): 'on mouse movement' if not self.showverts: return if self._ind is None: return if event.inaxes is None: return if event.button != 1: return x, y = event.xdata, event.ydata self.vecs[self._ind] = x, y self.line.set_data(zip(*self.vecs)) self.paths[self._ind].get_path().vertices[:] = \ path_from_vec(0., 0., *self.vecs[self._ind]) # update vec 0 based on callback if self._ind != 0: self.vecs[0] = update_vec(self.vecs) self.paths[0].get_path().vertices[:] = \ path_from_vec(0., 0., *self.vecs[0]) self.canvas.restore_region(self.background) for path in self.paths: self.ax.draw_artist(path) self.ax.draw_artist(self.line) self.canvas.blit(self.ax.bbox) def update_vec(x): return x[1]+1.0 interactor = PathInteractor(arrows) ax.set_title('drag vertices to update path') ax.set_xlim(-3, 4) ax.set_ylim(-3, 4) plt.show() </source> eab9cb6fedc439f4c4328491fe21a58fdb3e06a8 494 493 2016-03-31T18:29:04Z David M. Rogers 2 /* Group Work Pages */ wikitext text/x-wiki '''<BIG>Introduction to Scientific Computing</BIG>''' Course Info * Course Numbers CHM 4932-004/6938-010, CRN: 22347/22348 * Credit Hours: 3 * Meeting Dates: January 22 - April 27, 2016 ** No Class Jan. 18 or Mar. 14-19 * Meeting Times: Mon. and Wed., 12:30-13:45 in SCA 222 ** Lab Session & Office Hours: Fri. 12:30-13:45 in SCA 222 (or SCA 433) == Overview == Mathematical models in the natural sciences take many shapes and forms. The moment they become more complicated than tracking a few variables over time, we have to put away our Excel spreadsheets and make use of a solid foundation in computational science. The course establishes this foundation by introducing data structures and algorithms used in everyday scientific computing using examples in the python scripting language. By the end of the Semester, students will be able to navigate the Linux command-line to go from a mathematical model to a numerical solution. Best practices for working with computer code and visualizing data will also be covered. == Topics == # Languages #* bash (shell) #* python (scripting) #* stack & register-based machine languages: overview of C and Fortran syntax & compiling with gcc, ‘thread safety’ #* Shared libraries & language inter-operability (FFI) # Algorithms #* Horner’s algorithm for polynomials #* Newton’s root finding algo. #* Overview of general optimization algo-s (example: linear & nonlin. least-squares) #* Numerical integration (scripted, plus gnu ODE) #* Communication (how HTTP get/put works) # Data Structures #* Linked Lists #* Trees (file system hierarchies) #* Graphs #* Arrays (dense & sparse) example: vectors & rotations / transpositions, densities and difference operators # Presentation & visualization #* Flat CSV files (and excel) #* Working with binary data #* Python matplotlib (2D images) #* Binning histograms & weighted averages # Best Practices #* High-level code design (modularity, interface specifications, unit testing, etc.) #* Code audit: open-source libraries, ex. Gnu Scientific Library, qsort in libc, Boost #* Source code versioning (example: git or mercurial) #* gdb & execution profiling #* documentation #* Makefiles == Grading == '''Grading Scale (out of 400 points possible)''' {| class="wikitable" |- ! Grade ! Undergraduate ! Graduate |- | A | 230 | 300 |- | B | 180 | 230 |- | C | 150 | 180 |- | D | 120 | 150 |} * Points Possible: ** 10 homework assignments (20 points per homework) ** 2 projects / competitions (100 points per project) * Homework Rules ** For work done in groups, credit is divided equally among participants - so the max homework grade for a group of 2 is 10 points each. ** For each homework, 1 re-do at full credit can be sent at any time after the due date, but must present a unique solution to previous work from yourself or others. ** All work must cite co-group members (if any) and the source of any code snippets used online. === Grading Rationale === Homework points will only be awarded for correct, working code and correct algorithmic analysis, while the homework problems will become progressively tougher. Undergraduates should be able to pass the course with an A if they have correctly answered most of the homework, and made a strong attempt at one of the projects. Graduate students should both perform well on the homework and successfully complete one or two projects. Essentially, this means you should do your own homework when possible and may do a project in a small group. The re-grading and group options for homework allow making up for missed assignments, and encourage returning to core concepts at a later point in the class. Students who have completed significant portions of the homework have thus demonstrated programming proficiency, and are qualified for at least B/C grades. == Projects == === Midterm === A description for the midterm project is now available [[Media:midterm.pdf|here]]. The MD section will be updated as we discuss it in class. The due date for the midterm will be Friday, March 11. === Final === TBA == Textbooks and Resources == * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-0072-7 Beginning Python, Hetland, 2005] (eBook avail. from USF Library) * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-3238-4 Python Algorithms, Hetland, 2010] (eBook avail. from USF Library) * [http://aosabook.org/en/index.html The Architecture of Open Source Applications] * [http://docs.python.org Python Documentation] * [https://developers.google.com/edu/python/ Google Introductory Python Notes] * [http://huffman.sourceforge.net/tao/tao-of-programming.html Tao of Programming] Other (possibly useful) materials: * [http://hackersdictionary.com/html/entry/larval-stage.html The Jargon File] * Chapters 7&8 of Modelling and Simulation, Birta and Arbez, Springer 2007 (eBook avail. from USF Library). * Chapters 4-6 of Models and Algorithms for Intelligent Data Analysis, Runkler, Springer 2012 (eBook avail. from USF Library). * Guide to Scientific Computing in C++, Francis and Whiteley, Springer, 2012. (eBook avail. from USF Library) * Extra info. On the basics: ** Chapters 3 and 7 of Mathematics in Computing, Regan, Springer 2013. (eBook avail. from USF Library) ** Instant feedback graphical programming with [https://www.khanacademy.org/cs/programming/ Khan Academy] * [http://www.meetup.com/python-178/ Local PyBulls Meetings] Code: * [http://carsonfarmer.com/2013/07/essential-python-geo-libraries Python Libraries Useful for Geospatial Problems] * [[Code#Python_Libraries|Python Libraries Useful for Computational Chemistry]] (very small list at present) Interactive Interpreters: * [http://www.codewars.com CodeWars] Recommended for building experience with practice problems. * [http://exercism.io Exercism] A command-line client with a similar learn-through-challenge philosophy. * [http://repl.it repl.it] A read-eval-print loop for several computer languages. * [http://en.cppreference.com/w/cpp/language CppReference] Documentation with an online evaluator for C++ code. === Notes === * [[Media:intro.pdf|Notes]] for Week 1 ** Over the first two weeks or so, we'll be practicing the basics - so read through Chapters 1-3 of Hetland's Beginning Python during this time. ** [[PythonTranslated|Important Definitions]] * [[Media:Week2.pdf|Notes]] for Week 2 ** [[Code:Oware|Oware code]] ** Solutions for some problems in Week 2's notes: <source lang="python"> # simple data types "a string" # : str x = [1, 2, 3] # : [int] # compound data type (1, "name", (x, x)) # : (int, str, ([int], [int])) # add_one : int -> int # str.__add__ : str -> str -> str # str.split : str -> [str] # str.__mod__ : str -> (Objects) -> str </source> * [[Media:Week3.pdf|Notes]] for Week 3-4 ** Reading assignment - read through Chapter 5 and 6 (and practice dictionaries from Ch. 4) ** [[Code:for_patterns|Abstracting patterns]] in for loops. * [[Media:Week5.pdf|Notes]] for Week 5-6 ** Reading assignment - Read Chapter 10-11 (and refer to Ch. 4) * By this point, we've covered all the basics: ** base types: str, int, float, [a] ** variables and substitution: j vs "4" vs 4 ** indexing and slicing into lists / strings: x[1:4] or x[i:j] ** control flow: if and for syntax ** functions implementing patterns: def next(r, x): return r*x*(1-x) * You should be able to use these for: ** finding and abstracting the pattern ** naming the type of a function ** determining which variable names are in scope * All that's left is learning common uses, patterns and even more syntax! * [[Media:Week7-8.pdf|Notes]] for Week 7-8 * [[Media:Week9-10.pdf|Notes]] for Week 9-10 * [[Media:Week11.pdf|Notes]] for Week 11 * In-Class Examples * [[Gorillaz Code]] * [[File:Wat3-ccsd.txt]] Output of Multiwfn for a Na+(H20)_3 molecular cluster. * [[File:water_rdf.txt]] Water center of mass radial distribution function. === Homework === * [[CompSciHW1|Homework 1]] is due Monday, January 25. * [[CompSciHW2|Homework 2]] is due Monday, February 8. * [[CompSciHW3|Homework 3]] is due Friday, February 19. * [[CompSciHW4|Homework 4]] is due Friday, February 26. * [[CompSciHW5|Homework 5]] is due Friday, March 4. * [[CompSciHW6|Homework 6]] is due Wednesday, March 30. * [[CompSciHW7|Homework 7]] is due Friday, April 1. == Group Work Pages == Group 1 [https://docs.google.com/document/d/1k6vruCx78aV0pL8Kw7WWtsw_-6zgdoeP0OvujSzbsh0/edit?usp=sharing]: Group 2 [https://docs.google.com/document/d/1MgpVly2D1h9Xt_lFh5ywa3b70Ul9ES6OQZtg5l_n0NM/edit?usp=sharing] Group 3 [https://docs.google.com/document/d/1LT_J-vObN9tPa1JoQ1B_h04ENsL5Ko2xeFeRMp-99f8/edit?usp=sharing] Group 4 [https://docs.google.com/document/d/1hGlNlg1w7_3qCo6LE-y9rSZx1Chwc0FBUoxK6cyzWW8/edit?usp=sharing] * [[Code:Vectors|Interactive Vector Example]] 76f63d4b401aab85a51e64e63878579128273c9b 496 494 2016-04-04T14:37:42Z David M. Rogers 2 /* Textbooks and Resources */ wikitext text/x-wiki '''<BIG>Introduction to Scientific Computing</BIG>''' Course Info * Course Numbers CHM 4932-004/6938-010, CRN: 22347/22348 * Credit Hours: 3 * Meeting Dates: January 22 - April 27, 2016 ** No Class Jan. 18 or Mar. 14-19 * Meeting Times: Mon. and Wed., 12:30-13:45 in SCA 222 ** Lab Session & Office Hours: Fri. 12:30-13:45 in SCA 222 (or SCA 433) == Overview == Mathematical models in the natural sciences take many shapes and forms. The moment they become more complicated than tracking a few variables over time, we have to put away our Excel spreadsheets and make use of a solid foundation in computational science. The course establishes this foundation by introducing data structures and algorithms used in everyday scientific computing using examples in the python scripting language. By the end of the Semester, students will be able to navigate the Linux command-line to go from a mathematical model to a numerical solution. Best practices for working with computer code and visualizing data will also be covered. == Topics == # Languages #* bash (shell) #* python (scripting) #* stack & register-based machine languages: overview of C and Fortran syntax & compiling with gcc, ‘thread safety’ #* Shared libraries & language inter-operability (FFI) # Algorithms #* Horner’s algorithm for polynomials #* Newton’s root finding algo. #* Overview of general optimization algo-s (example: linear & nonlin. least-squares) #* Numerical integration (scripted, plus gnu ODE) #* Communication (how HTTP get/put works) # Data Structures #* Linked Lists #* Trees (file system hierarchies) #* Graphs #* Arrays (dense & sparse) example: vectors & rotations / transpositions, densities and difference operators # Presentation & visualization #* Flat CSV files (and excel) #* Working with binary data #* Python matplotlib (2D images) #* Binning histograms & weighted averages # Best Practices #* High-level code design (modularity, interface specifications, unit testing, etc.) #* Code audit: open-source libraries, ex. Gnu Scientific Library, qsort in libc, Boost #* Source code versioning (example: git or mercurial) #* gdb & execution profiling #* documentation #* Makefiles == Grading == '''Grading Scale (out of 400 points possible)''' {| class="wikitable" |- ! Grade ! Undergraduate ! Graduate |- | A | 230 | 300 |- | B | 180 | 230 |- | C | 150 | 180 |- | D | 120 | 150 |} * Points Possible: ** 10 homework assignments (20 points per homework) ** 2 projects / competitions (100 points per project) * Homework Rules ** For work done in groups, credit is divided equally among participants - so the max homework grade for a group of 2 is 10 points each. ** For each homework, 1 re-do at full credit can be sent at any time after the due date, but must present a unique solution to previous work from yourself or others. ** All work must cite co-group members (if any) and the source of any code snippets used online. === Grading Rationale === Homework points will only be awarded for correct, working code and correct algorithmic analysis, while the homework problems will become progressively tougher. Undergraduates should be able to pass the course with an A if they have correctly answered most of the homework, and made a strong attempt at one of the projects. Graduate students should both perform well on the homework and successfully complete one or two projects. Essentially, this means you should do your own homework when possible and may do a project in a small group. The re-grading and group options for homework allow making up for missed assignments, and encourage returning to core concepts at a later point in the class. Students who have completed significant portions of the homework have thus demonstrated programming proficiency, and are qualified for at least B/C grades. == Projects == === Midterm === A description for the midterm project is now available [[Media:midterm.pdf|here]]. The MD section will be updated as we discuss it in class. The due date for the midterm will be Friday, March 11. === Final === TBA == Textbooks and Resources == * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-0072-7 Beginning Python, Hetland, 2005] (eBook avail. from USF Library) * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-3238-4 Python Algorithms, Hetland, 2010] (eBook avail. from USF Library) * [http://aosabook.org/en/index.html The Architecture of Open Source Applications] * [http://docs.python.org Python Documentation] * [https://developers.google.com/edu/python/ Google Introductory Python Notes] * [http://huffman.sourceforge.net/tao/tao-of-programming.html Tao of Programming] Other (possibly useful) materials: * [http://hackersdictionary.com/html/entry/larval-stage.html The Jargon File] * Chapters 7&8 of Modelling and Simulation, Birta and Arbez, Springer 2007 (eBook avail. from USF Library). * Chapters 4-6 of Models and Algorithms for Intelligent Data Analysis, Runkler, Springer 2012 (eBook avail. from USF Library). * Guide to Scientific Computing in C++, Francis and Whiteley, Springer, 2012. (eBook avail. from USF Library) * Extra info. On the basics: ** Chapters 3 and 7 of Mathematics in Computing, Regan, Springer 2013. (eBook avail. from USF Library) ** Instant feedback graphical programming with [https://www.khanacademy.org/cs/programming/ Khan Academy] * [http://www.meetup.com/python-178/ Local PyBulls Meetings] Code: * [http://carsonfarmer.com/2013/07/essential-python-geo-libraries Python Libraries Useful for Geospatial Problems] * [[Code#Python_Libraries|Python Libraries Useful for Computational Chemistry]] (very small list at present) Interactive Interpreters: * [http://www.codewars.com CodeWars] Recommended for building experience with practice problems. * [http://codecombat.com/ CodeCombat] A very visual way to interact with your python code. * [http://exercism.io Exercism] A command-line client with a similar learn-through-challenge philosophy. * [http://repl.it repl.it] A read-eval-print loop for several computer languages. * [http://en.cppreference.com/w/cpp/language CppReference] Documentation with an online evaluator for C++ code. === Notes === * [[Media:intro.pdf|Notes]] for Week 1 ** Over the first two weeks or so, we'll be practicing the basics - so read through Chapters 1-3 of Hetland's Beginning Python during this time. ** [[PythonTranslated|Important Definitions]] * [[Media:Week2.pdf|Notes]] for Week 2 ** [[Code:Oware|Oware code]] ** Solutions for some problems in Week 2's notes: <source lang="python"> # simple data types "a string" # : str x = [1, 2, 3] # : [int] # compound data type (1, "name", (x, x)) # : (int, str, ([int], [int])) # add_one : int -> int # str.__add__ : str -> str -> str # str.split : str -> [str] # str.__mod__ : str -> (Objects) -> str </source> * [[Media:Week3.pdf|Notes]] for Week 3-4 ** Reading assignment - read through Chapter 5 and 6 (and practice dictionaries from Ch. 4) ** [[Code:for_patterns|Abstracting patterns]] in for loops. * [[Media:Week5.pdf|Notes]] for Week 5-6 ** Reading assignment - Read Chapter 10-11 (and refer to Ch. 4) * By this point, we've covered all the basics: ** base types: str, int, float, [a] ** variables and substitution: j vs "4" vs 4 ** indexing and slicing into lists / strings: x[1:4] or x[i:j] ** control flow: if and for syntax ** functions implementing patterns: def next(r, x): return r*x*(1-x) * You should be able to use these for: ** finding and abstracting the pattern ** naming the type of a function ** determining which variable names are in scope * All that's left is learning common uses, patterns and even more syntax! * [[Media:Week7-8.pdf|Notes]] for Week 7-8 * [[Media:Week9-10.pdf|Notes]] for Week 9-10 * [[Media:Week11.pdf|Notes]] for Week 11 * In-Class Examples * [[Gorillaz Code]] * [[File:Wat3-ccsd.txt]] Output of Multiwfn for a Na+(H20)_3 molecular cluster. * [[File:water_rdf.txt]] Water center of mass radial distribution function. === Homework === * [[CompSciHW1|Homework 1]] is due Monday, January 25. * [[CompSciHW2|Homework 2]] is due Monday, February 8. * [[CompSciHW3|Homework 3]] is due Friday, February 19. * [[CompSciHW4|Homework 4]] is due Friday, February 26. * [[CompSciHW5|Homework 5]] is due Friday, March 4. * [[CompSciHW6|Homework 6]] is due Wednesday, March 30. * [[CompSciHW7|Homework 7]] is due Friday, April 1. == Group Work Pages == Group 1 [https://docs.google.com/document/d/1k6vruCx78aV0pL8Kw7WWtsw_-6zgdoeP0OvujSzbsh0/edit?usp=sharing]: Group 2 [https://docs.google.com/document/d/1MgpVly2D1h9Xt_lFh5ywa3b70Ul9ES6OQZtg5l_n0NM/edit?usp=sharing] Group 3 [https://docs.google.com/document/d/1LT_J-vObN9tPa1JoQ1B_h04ENsL5Ko2xeFeRMp-99f8/edit?usp=sharing] Group 4 [https://docs.google.com/document/d/1hGlNlg1w7_3qCo6LE-y9rSZx1Chwc0FBUoxK6cyzWW8/edit?usp=sharing] * [[Code:Vectors|Interactive Vector Example]] e10317bac89c2679190b2382e864325842f78bcb 500 496 2016-04-04T17:58:37Z David M. Rogers 2 /* Homework */ wikitext text/x-wiki '''<BIG>Introduction to Scientific Computing</BIG>''' Course Info * Course Numbers CHM 4932-004/6938-010, CRN: 22347/22348 * Credit Hours: 3 * Meeting Dates: January 22 - April 27, 2016 ** No Class Jan. 18 or Mar. 14-19 * Meeting Times: Mon. and Wed., 12:30-13:45 in SCA 222 ** Lab Session & Office Hours: Fri. 12:30-13:45 in SCA 222 (or SCA 433) == Overview == Mathematical models in the natural sciences take many shapes and forms. The moment they become more complicated than tracking a few variables over time, we have to put away our Excel spreadsheets and make use of a solid foundation in computational science. The course establishes this foundation by introducing data structures and algorithms used in everyday scientific computing using examples in the python scripting language. By the end of the Semester, students will be able to navigate the Linux command-line to go from a mathematical model to a numerical solution. Best practices for working with computer code and visualizing data will also be covered. == Topics == # Languages #* bash (shell) #* python (scripting) #* stack & register-based machine languages: overview of C and Fortran syntax & compiling with gcc, ‘thread safety’ #* Shared libraries & language inter-operability (FFI) # Algorithms #* Horner’s algorithm for polynomials #* Newton’s root finding algo. #* Overview of general optimization algo-s (example: linear & nonlin. least-squares) #* Numerical integration (scripted, plus gnu ODE) #* Communication (how HTTP get/put works) # Data Structures #* Linked Lists #* Trees (file system hierarchies) #* Graphs #* Arrays (dense & sparse) example: vectors & rotations / transpositions, densities and difference operators # Presentation & visualization #* Flat CSV files (and excel) #* Working with binary data #* Python matplotlib (2D images) #* Binning histograms & weighted averages # Best Practices #* High-level code design (modularity, interface specifications, unit testing, etc.) #* Code audit: open-source libraries, ex. Gnu Scientific Library, qsort in libc, Boost #* Source code versioning (example: git or mercurial) #* gdb & execution profiling #* documentation #* Makefiles == Grading == '''Grading Scale (out of 400 points possible)''' {| class="wikitable" |- ! Grade ! Undergraduate ! Graduate |- | A | 230 | 300 |- | B | 180 | 230 |- | C | 150 | 180 |- | D | 120 | 150 |} * Points Possible: ** 10 homework assignments (20 points per homework) ** 2 projects / competitions (100 points per project) * Homework Rules ** For work done in groups, credit is divided equally among participants - so the max homework grade for a group of 2 is 10 points each. ** For each homework, 1 re-do at full credit can be sent at any time after the due date, but must present a unique solution to previous work from yourself or others. ** All work must cite co-group members (if any) and the source of any code snippets used online. === Grading Rationale === Homework points will only be awarded for correct, working code and correct algorithmic analysis, while the homework problems will become progressively tougher. Undergraduates should be able to pass the course with an A if they have correctly answered most of the homework, and made a strong attempt at one of the projects. Graduate students should both perform well on the homework and successfully complete one or two projects. Essentially, this means you should do your own homework when possible and may do a project in a small group. The re-grading and group options for homework allow making up for missed assignments, and encourage returning to core concepts at a later point in the class. Students who have completed significant portions of the homework have thus demonstrated programming proficiency, and are qualified for at least B/C grades. == Projects == === Midterm === A description for the midterm project is now available [[Media:midterm.pdf|here]]. The MD section will be updated as we discuss it in class. The due date for the midterm will be Friday, March 11. === Final === TBA == Textbooks and Resources == * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-0072-7 Beginning Python, Hetland, 2005] (eBook avail. from USF Library) * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-3238-4 Python Algorithms, Hetland, 2010] (eBook avail. from USF Library) * [http://aosabook.org/en/index.html The Architecture of Open Source Applications] * [http://docs.python.org Python Documentation] * [https://developers.google.com/edu/python/ Google Introductory Python Notes] * [http://huffman.sourceforge.net/tao/tao-of-programming.html Tao of Programming] Other (possibly useful) materials: * [http://hackersdictionary.com/html/entry/larval-stage.html The Jargon File] * Chapters 7&8 of Modelling and Simulation, Birta and Arbez, Springer 2007 (eBook avail. from USF Library). * Chapters 4-6 of Models and Algorithms for Intelligent Data Analysis, Runkler, Springer 2012 (eBook avail. from USF Library). * Guide to Scientific Computing in C++, Francis and Whiteley, Springer, 2012. (eBook avail. from USF Library) * Extra info. On the basics: ** Chapters 3 and 7 of Mathematics in Computing, Regan, Springer 2013. (eBook avail. from USF Library) ** Instant feedback graphical programming with [https://www.khanacademy.org/cs/programming/ Khan Academy] * [http://www.meetup.com/python-178/ Local PyBulls Meetings] Code: * [http://carsonfarmer.com/2013/07/essential-python-geo-libraries Python Libraries Useful for Geospatial Problems] * [[Code#Python_Libraries|Python Libraries Useful for Computational Chemistry]] (very small list at present) Interactive Interpreters: * [http://www.codewars.com CodeWars] Recommended for building experience with practice problems. * [http://codecombat.com/ CodeCombat] A very visual way to interact with your python code. * [http://exercism.io Exercism] A command-line client with a similar learn-through-challenge philosophy. * [http://repl.it repl.it] A read-eval-print loop for several computer languages. * [http://en.cppreference.com/w/cpp/language CppReference] Documentation with an online evaluator for C++ code. === Notes === * [[Media:intro.pdf|Notes]] for Week 1 ** Over the first two weeks or so, we'll be practicing the basics - so read through Chapters 1-3 of Hetland's Beginning Python during this time. ** [[PythonTranslated|Important Definitions]] * [[Media:Week2.pdf|Notes]] for Week 2 ** [[Code:Oware|Oware code]] ** Solutions for some problems in Week 2's notes: <source lang="python"> # simple data types "a string" # : str x = [1, 2, 3] # : [int] # compound data type (1, "name", (x, x)) # : (int, str, ([int], [int])) # add_one : int -> int # str.__add__ : str -> str -> str # str.split : str -> [str] # str.__mod__ : str -> (Objects) -> str </source> * [[Media:Week3.pdf|Notes]] for Week 3-4 ** Reading assignment - read through Chapter 5 and 6 (and practice dictionaries from Ch. 4) ** [[Code:for_patterns|Abstracting patterns]] in for loops. * [[Media:Week5.pdf|Notes]] for Week 5-6 ** Reading assignment - Read Chapter 10-11 (and refer to Ch. 4) * By this point, we've covered all the basics: ** base types: str, int, float, [a] ** variables and substitution: j vs "4" vs 4 ** indexing and slicing into lists / strings: x[1:4] or x[i:j] ** control flow: if and for syntax ** functions implementing patterns: def next(r, x): return r*x*(1-x) * You should be able to use these for: ** finding and abstracting the pattern ** naming the type of a function ** determining which variable names are in scope * All that's left is learning common uses, patterns and even more syntax! * [[Media:Week7-8.pdf|Notes]] for Week 7-8 * [[Media:Week9-10.pdf|Notes]] for Week 9-10 * [[Media:Week11.pdf|Notes]] for Week 11 * In-Class Examples * [[Gorillaz Code]] * [[File:Wat3-ccsd.txt]] Output of Multiwfn for a Na+(H20)_3 molecular cluster. * [[File:water_rdf.txt]] Water center of mass radial distribution function. === Homework === * [[CompSciHW1|Homework 1]] is due Monday, January 25. * [[CompSciHW2|Homework 2]] is due Monday, February 8. * [[CompSciHW3|Homework 3]] is due Friday, February 19. * [[CompSciHW4|Homework 4]] is due Friday, February 26. * [[CompSciHW5|Homework 5]] is due Friday, March 4. * [[CompSciHW6|Homework 6]] is due Wednesday, March 30. * [[CompSciHW7|Homework 7]] is due Friday, April 1. * [[CompSciHW8|Homework 8]] is due Friday, April 8. == Group Work Pages == Group 1 [https://docs.google.com/document/d/1k6vruCx78aV0pL8Kw7WWtsw_-6zgdoeP0OvujSzbsh0/edit?usp=sharing]: Group 2 [https://docs.google.com/document/d/1MgpVly2D1h9Xt_lFh5ywa3b70Ul9ES6OQZtg5l_n0NM/edit?usp=sharing] Group 3 [https://docs.google.com/document/d/1LT_J-vObN9tPa1JoQ1B_h04ENsL5Ko2xeFeRMp-99f8/edit?usp=sharing] Group 4 [https://docs.google.com/document/d/1hGlNlg1w7_3qCo6LE-y9rSZx1Chwc0FBUoxK6cyzWW8/edit?usp=sharing] * [[Code:Vectors|Interactive Vector Example]] f61540bbef756bb1f47aa81c461d66dd0e50c76f 505 500 2016-04-06T16:02:12Z David M. Rogers 2 /* Notes */ wikitext text/x-wiki '''<BIG>Introduction to Scientific Computing</BIG>''' Course Info * Course Numbers CHM 4932-004/6938-010, CRN: 22347/22348 * Credit Hours: 3 * Meeting Dates: January 22 - April 27, 2016 ** No Class Jan. 18 or Mar. 14-19 * Meeting Times: Mon. and Wed., 12:30-13:45 in SCA 222 ** Lab Session & Office Hours: Fri. 12:30-13:45 in SCA 222 (or SCA 433) == Overview == Mathematical models in the natural sciences take many shapes and forms. The moment they become more complicated than tracking a few variables over time, we have to put away our Excel spreadsheets and make use of a solid foundation in computational science. The course establishes this foundation by introducing data structures and algorithms used in everyday scientific computing using examples in the python scripting language. By the end of the Semester, students will be able to navigate the Linux command-line to go from a mathematical model to a numerical solution. Best practices for working with computer code and visualizing data will also be covered. == Topics == # Languages #* bash (shell) #* python (scripting) #* stack & register-based machine languages: overview of C and Fortran syntax & compiling with gcc, ‘thread safety’ #* Shared libraries & language inter-operability (FFI) # Algorithms #* Horner’s algorithm for polynomials #* Newton’s root finding algo. #* Overview of general optimization algo-s (example: linear & nonlin. least-squares) #* Numerical integration (scripted, plus gnu ODE) #* Communication (how HTTP get/put works) # Data Structures #* Linked Lists #* Trees (file system hierarchies) #* Graphs #* Arrays (dense & sparse) example: vectors & rotations / transpositions, densities and difference operators # Presentation & visualization #* Flat CSV files (and excel) #* Working with binary data #* Python matplotlib (2D images) #* Binning histograms & weighted averages # Best Practices #* High-level code design (modularity, interface specifications, unit testing, etc.) #* Code audit: open-source libraries, ex. Gnu Scientific Library, qsort in libc, Boost #* Source code versioning (example: git or mercurial) #* gdb & execution profiling #* documentation #* Makefiles == Grading == '''Grading Scale (out of 400 points possible)''' {| class="wikitable" |- ! Grade ! Undergraduate ! Graduate |- | A | 230 | 300 |- | B | 180 | 230 |- | C | 150 | 180 |- | D | 120 | 150 |} * Points Possible: ** 10 homework assignments (20 points per homework) ** 2 projects / competitions (100 points per project) * Homework Rules ** For work done in groups, credit is divided equally among participants - so the max homework grade for a group of 2 is 10 points each. ** For each homework, 1 re-do at full credit can be sent at any time after the due date, but must present a unique solution to previous work from yourself or others. ** All work must cite co-group members (if any) and the source of any code snippets used online. === Grading Rationale === Homework points will only be awarded for correct, working code and correct algorithmic analysis, while the homework problems will become progressively tougher. Undergraduates should be able to pass the course with an A if they have correctly answered most of the homework, and made a strong attempt at one of the projects. Graduate students should both perform well on the homework and successfully complete one or two projects. Essentially, this means you should do your own homework when possible and may do a project in a small group. The re-grading and group options for homework allow making up for missed assignments, and encourage returning to core concepts at a later point in the class. Students who have completed significant portions of the homework have thus demonstrated programming proficiency, and are qualified for at least B/C grades. == Projects == === Midterm === A description for the midterm project is now available [[Media:midterm.pdf|here]]. The MD section will be updated as we discuss it in class. The due date for the midterm will be Friday, March 11. === Final === TBA == Textbooks and Resources == * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-0072-7 Beginning Python, Hetland, 2005] (eBook avail. from USF Library) * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-3238-4 Python Algorithms, Hetland, 2010] (eBook avail. from USF Library) * [http://aosabook.org/en/index.html The Architecture of Open Source Applications] * [http://docs.python.org Python Documentation] * [https://developers.google.com/edu/python/ Google Introductory Python Notes] * [http://huffman.sourceforge.net/tao/tao-of-programming.html Tao of Programming] Other (possibly useful) materials: * [http://hackersdictionary.com/html/entry/larval-stage.html The Jargon File] * Chapters 7&8 of Modelling and Simulation, Birta and Arbez, Springer 2007 (eBook avail. from USF Library). * Chapters 4-6 of Models and Algorithms for Intelligent Data Analysis, Runkler, Springer 2012 (eBook avail. from USF Library). * Guide to Scientific Computing in C++, Francis and Whiteley, Springer, 2012. (eBook avail. from USF Library) * Extra info. On the basics: ** Chapters 3 and 7 of Mathematics in Computing, Regan, Springer 2013. (eBook avail. from USF Library) ** Instant feedback graphical programming with [https://www.khanacademy.org/cs/programming/ Khan Academy] * [http://www.meetup.com/python-178/ Local PyBulls Meetings] Code: * [http://carsonfarmer.com/2013/07/essential-python-geo-libraries Python Libraries Useful for Geospatial Problems] * [[Code#Python_Libraries|Python Libraries Useful for Computational Chemistry]] (very small list at present) Interactive Interpreters: * [http://www.codewars.com CodeWars] Recommended for building experience with practice problems. * [http://codecombat.com/ CodeCombat] A very visual way to interact with your python code. * [http://exercism.io Exercism] A command-line client with a similar learn-through-challenge philosophy. * [http://repl.it repl.it] A read-eval-print loop for several computer languages. * [http://en.cppreference.com/w/cpp/language CppReference] Documentation with an online evaluator for C++ code. === Notes === * [[Media:intro.pdf|Notes]] for Week 1 ** Over the first two weeks or so, we'll be practicing the basics - so read through Chapters 1-3 of Hetland's Beginning Python during this time. ** [[PythonTranslated|Important Definitions]] * [[Media:Week2.pdf|Notes]] for Week 2 ** [[Code:Oware|Oware code]] ** Solutions for some problems in Week 2's notes: <source lang="python"> # simple data types "a string" # : str x = [1, 2, 3] # : [int] # compound data type (1, "name", (x, x)) # : (int, str, ([int], [int])) # add_one : int -> int # str.__add__ : str -> str -> str # str.split : str -> [str] # str.__mod__ : str -> (Objects) -> str </source> * [[Media:Week3.pdf|Notes]] for Week 3-4 ** Reading assignment - read through Chapter 5 and 6 (and practice dictionaries from Ch. 4) ** [[Code:for_patterns|Abstracting patterns]] in for loops. * [[Media:Week5.pdf|Notes]] for Week 5-6 ** Reading assignment - Read Chapter 10-11 (and refer to Ch. 4) * By this point, we've covered all the basics: ** base types: str, int, float, [a] ** variables and substitution: j vs "4" vs 4 ** indexing and slicing into lists / strings: x[1:4] or x[i:j] ** control flow: if and for syntax ** functions implementing patterns: def next(r, x): return r*x*(1-x) * You should be able to use these for: ** finding and abstracting the pattern ** naming the type of a function ** determining which variable names are in scope * All that's left is learning common uses, patterns and even more syntax! * [[Media:Week7-8.pdf|Notes]] for Week 7-8 * [[Media:Week9-10.pdf|Notes]] for Week 9-10 * [[Media:Week11.pdf|Notes]] for Week 11 * [[Media:Week12.pdf|Notes]] for Week 12 * In-Class Examples * [[Gorillaz Code]] * [[File:Wat3-ccsd.txt]] Output of Multiwfn for a Na+(H20)_3 molecular cluster. * [[File:water_rdf.txt]] Water center of mass radial distribution function. === Homework === * [[CompSciHW1|Homework 1]] is due Monday, January 25. * [[CompSciHW2|Homework 2]] is due Monday, February 8. * [[CompSciHW3|Homework 3]] is due Friday, February 19. * [[CompSciHW4|Homework 4]] is due Friday, February 26. * [[CompSciHW5|Homework 5]] is due Friday, March 4. * [[CompSciHW6|Homework 6]] is due Wednesday, March 30. * [[CompSciHW7|Homework 7]] is due Friday, April 1. * [[CompSciHW8|Homework 8]] is due Friday, April 8. == Group Work Pages == Group 1 [https://docs.google.com/document/d/1k6vruCx78aV0pL8Kw7WWtsw_-6zgdoeP0OvujSzbsh0/edit?usp=sharing]: Group 2 [https://docs.google.com/document/d/1MgpVly2D1h9Xt_lFh5ywa3b70Ul9ES6OQZtg5l_n0NM/edit?usp=sharing] Group 3 [https://docs.google.com/document/d/1LT_J-vObN9tPa1JoQ1B_h04ENsL5Ko2xeFeRMp-99f8/edit?usp=sharing] Group 4 [https://docs.google.com/document/d/1hGlNlg1w7_3qCo6LE-y9rSZx1Chwc0FBUoxK6cyzWW8/edit?usp=sharing] * [[Code:Vectors|Interactive Vector Example]] aacbc33da9d7eb296df8c808771c3a646294b94c 508 505 2016-04-08T15:00:51Z David M. Rogers 2 /* Projects */ wikitext text/x-wiki '''<BIG>Introduction to Scientific Computing</BIG>''' Course Info * Course Numbers CHM 4932-004/6938-010, CRN: 22347/22348 * Credit Hours: 3 * Meeting Dates: January 22 - April 27, 2016 ** No Class Jan. 18 or Mar. 14-19 * Meeting Times: Mon. and Wed., 12:30-13:45 in SCA 222 ** Lab Session & Office Hours: Fri. 12:30-13:45 in SCA 222 (or SCA 433) == Overview == Mathematical models in the natural sciences take many shapes and forms. The moment they become more complicated than tracking a few variables over time, we have to put away our Excel spreadsheets and make use of a solid foundation in computational science. The course establishes this foundation by introducing data structures and algorithms used in everyday scientific computing using examples in the python scripting language. By the end of the Semester, students will be able to navigate the Linux command-line to go from a mathematical model to a numerical solution. Best practices for working with computer code and visualizing data will also be covered. == Topics == # Languages #* bash (shell) #* python (scripting) #* stack & register-based machine languages: overview of C and Fortran syntax & compiling with gcc, ‘thread safety’ #* Shared libraries & language inter-operability (FFI) # Algorithms #* Horner’s algorithm for polynomials #* Newton’s root finding algo. #* Overview of general optimization algo-s (example: linear & nonlin. least-squares) #* Numerical integration (scripted, plus gnu ODE) #* Communication (how HTTP get/put works) # Data Structures #* Linked Lists #* Trees (file system hierarchies) #* Graphs #* Arrays (dense & sparse) example: vectors & rotations / transpositions, densities and difference operators # Presentation & visualization #* Flat CSV files (and excel) #* Working with binary data #* Python matplotlib (2D images) #* Binning histograms & weighted averages # Best Practices #* High-level code design (modularity, interface specifications, unit testing, etc.) #* Code audit: open-source libraries, ex. Gnu Scientific Library, qsort in libc, Boost #* Source code versioning (example: git or mercurial) #* gdb & execution profiling #* documentation #* Makefiles == Grading == '''Grading Scale (out of 400 points possible)''' {| class="wikitable" |- ! Grade ! Undergraduate ! Graduate |- | A | 230 | 300 |- | B | 180 | 230 |- | C | 150 | 180 |- | D | 120 | 150 |} * Points Possible: ** 10 homework assignments (20 points per homework) ** 2 projects / competitions (100 points per project) * Homework Rules ** For work done in groups, credit is divided equally among participants - so the max homework grade for a group of 2 is 10 points each. ** For each homework, 1 re-do at full credit can be sent at any time after the due date, but must present a unique solution to previous work from yourself or others. ** All work must cite co-group members (if any) and the source of any code snippets used online. === Grading Rationale === Homework points will only be awarded for correct, working code and correct algorithmic analysis, while the homework problems will become progressively tougher. Undergraduates should be able to pass the course with an A if they have correctly answered most of the homework, and made a strong attempt at one of the projects. Graduate students should both perform well on the homework and successfully complete one or two projects. Essentially, this means you should do your own homework when possible and may do a project in a small group. The re-grading and group options for homework allow making up for missed assignments, and encourage returning to core concepts at a later point in the class. Students who have completed significant portions of the homework have thus demonstrated programming proficiency, and are qualified for at least B/C grades. == Projects == === Midterm === A description for the midterm project is now available [[Media:midterm.pdf|here]]. The MD section will be updated as we discuss it in class. The due date for the midterm will be Friday, March 11. === Final === A description for the final project is now available [[Media:final.pdf|here]]. The due date for the final will be Friday, Aoril 29. == Textbooks and Resources == * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-0072-7 Beginning Python, Hetland, 2005] (eBook avail. from USF Library) * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-3238-4 Python Algorithms, Hetland, 2010] (eBook avail. from USF Library) * [http://aosabook.org/en/index.html The Architecture of Open Source Applications] * [http://docs.python.org Python Documentation] * [https://developers.google.com/edu/python/ Google Introductory Python Notes] * [http://huffman.sourceforge.net/tao/tao-of-programming.html Tao of Programming] Other (possibly useful) materials: * [http://hackersdictionary.com/html/entry/larval-stage.html The Jargon File] * Chapters 7&8 of Modelling and Simulation, Birta and Arbez, Springer 2007 (eBook avail. from USF Library). * Chapters 4-6 of Models and Algorithms for Intelligent Data Analysis, Runkler, Springer 2012 (eBook avail. from USF Library). * Guide to Scientific Computing in C++, Francis and Whiteley, Springer, 2012. (eBook avail. from USF Library) * Extra info. On the basics: ** Chapters 3 and 7 of Mathematics in Computing, Regan, Springer 2013. (eBook avail. from USF Library) ** Instant feedback graphical programming with [https://www.khanacademy.org/cs/programming/ Khan Academy] * [http://www.meetup.com/python-178/ Local PyBulls Meetings] Code: * [http://carsonfarmer.com/2013/07/essential-python-geo-libraries Python Libraries Useful for Geospatial Problems] * [[Code#Python_Libraries|Python Libraries Useful for Computational Chemistry]] (very small list at present) Interactive Interpreters: * [http://www.codewars.com CodeWars] Recommended for building experience with practice problems. * [http://codecombat.com/ CodeCombat] A very visual way to interact with your python code. * [http://exercism.io Exercism] A command-line client with a similar learn-through-challenge philosophy. * [http://repl.it repl.it] A read-eval-print loop for several computer languages. * [http://en.cppreference.com/w/cpp/language CppReference] Documentation with an online evaluator for C++ code. === Notes === * [[Media:intro.pdf|Notes]] for Week 1 ** Over the first two weeks or so, we'll be practicing the basics - so read through Chapters 1-3 of Hetland's Beginning Python during this time. ** [[PythonTranslated|Important Definitions]] * [[Media:Week2.pdf|Notes]] for Week 2 ** [[Code:Oware|Oware code]] ** Solutions for some problems in Week 2's notes: <source lang="python"> # simple data types "a string" # : str x = [1, 2, 3] # : [int] # compound data type (1, "name", (x, x)) # : (int, str, ([int], [int])) # add_one : int -> int # str.__add__ : str -> str -> str # str.split : str -> [str] # str.__mod__ : str -> (Objects) -> str </source> * [[Media:Week3.pdf|Notes]] for Week 3-4 ** Reading assignment - read through Chapter 5 and 6 (and practice dictionaries from Ch. 4) ** [[Code:for_patterns|Abstracting patterns]] in for loops. * [[Media:Week5.pdf|Notes]] for Week 5-6 ** Reading assignment - Read Chapter 10-11 (and refer to Ch. 4) * By this point, we've covered all the basics: ** base types: str, int, float, [a] ** variables and substitution: j vs "4" vs 4 ** indexing and slicing into lists / strings: x[1:4] or x[i:j] ** control flow: if and for syntax ** functions implementing patterns: def next(r, x): return r*x*(1-x) * You should be able to use these for: ** finding and abstracting the pattern ** naming the type of a function ** determining which variable names are in scope * All that's left is learning common uses, patterns and even more syntax! * [[Media:Week7-8.pdf|Notes]] for Week 7-8 * [[Media:Week9-10.pdf|Notes]] for Week 9-10 * [[Media:Week11.pdf|Notes]] for Week 11 * [[Media:Week12.pdf|Notes]] for Week 12 * In-Class Examples * [[Gorillaz Code]] * [[File:Wat3-ccsd.txt]] Output of Multiwfn for a Na+(H20)_3 molecular cluster. * [[File:water_rdf.txt]] Water center of mass radial distribution function. === Homework === * [[CompSciHW1|Homework 1]] is due Monday, January 25. * [[CompSciHW2|Homework 2]] is due Monday, February 8. * [[CompSciHW3|Homework 3]] is due Friday, February 19. * [[CompSciHW4|Homework 4]] is due Friday, February 26. * [[CompSciHW5|Homework 5]] is due Friday, March 4. * [[CompSciHW6|Homework 6]] is due Wednesday, March 30. * [[CompSciHW7|Homework 7]] is due Friday, April 1. * [[CompSciHW8|Homework 8]] is due Friday, April 8. == Group Work Pages == Group 1 [https://docs.google.com/document/d/1k6vruCx78aV0pL8Kw7WWtsw_-6zgdoeP0OvujSzbsh0/edit?usp=sharing]: Group 2 [https://docs.google.com/document/d/1MgpVly2D1h9Xt_lFh5ywa3b70Ul9ES6OQZtg5l_n0NM/edit?usp=sharing] Group 3 [https://docs.google.com/document/d/1LT_J-vObN9tPa1JoQ1B_h04ENsL5Ko2xeFeRMp-99f8/edit?usp=sharing] Group 4 [https://docs.google.com/document/d/1hGlNlg1w7_3qCo6LE-y9rSZx1Chwc0FBUoxK6cyzWW8/edit?usp=sharing] * [[Code:Vectors|Interactive Vector Example]] c9af3a9f51793ea490d86732c4efe7ffa86a6c60 510 508 2016-04-11T16:20:46Z David M. Rogers 2 /* Notes */ wikitext text/x-wiki '''<BIG>Introduction to Scientific Computing</BIG>''' Course Info * Course Numbers CHM 4932-004/6938-010, CRN: 22347/22348 * Credit Hours: 3 * Meeting Dates: January 22 - April 27, 2016 ** No Class Jan. 18 or Mar. 14-19 * Meeting Times: Mon. and Wed., 12:30-13:45 in SCA 222 ** Lab Session & Office Hours: Fri. 12:30-13:45 in SCA 222 (or SCA 433) == Overview == Mathematical models in the natural sciences take many shapes and forms. The moment they become more complicated than tracking a few variables over time, we have to put away our Excel spreadsheets and make use of a solid foundation in computational science. The course establishes this foundation by introducing data structures and algorithms used in everyday scientific computing using examples in the python scripting language. By the end of the Semester, students will be able to navigate the Linux command-line to go from a mathematical model to a numerical solution. Best practices for working with computer code and visualizing data will also be covered. == Topics == # Languages #* bash (shell) #* python (scripting) #* stack & register-based machine languages: overview of C and Fortran syntax & compiling with gcc, ‘thread safety’ #* Shared libraries & language inter-operability (FFI) # Algorithms #* Horner’s algorithm for polynomials #* Newton’s root finding algo. #* Overview of general optimization algo-s (example: linear & nonlin. least-squares) #* Numerical integration (scripted, plus gnu ODE) #* Communication (how HTTP get/put works) # Data Structures #* Linked Lists #* Trees (file system hierarchies) #* Graphs #* Arrays (dense & sparse) example: vectors & rotations / transpositions, densities and difference operators # Presentation & visualization #* Flat CSV files (and excel) #* Working with binary data #* Python matplotlib (2D images) #* Binning histograms & weighted averages # Best Practices #* High-level code design (modularity, interface specifications, unit testing, etc.) #* Code audit: open-source libraries, ex. Gnu Scientific Library, qsort in libc, Boost #* Source code versioning (example: git or mercurial) #* gdb & execution profiling #* documentation #* Makefiles == Grading == '''Grading Scale (out of 400 points possible)''' {| class="wikitable" |- ! Grade ! Undergraduate ! Graduate |- | A | 230 | 300 |- | B | 180 | 230 |- | C | 150 | 180 |- | D | 120 | 150 |} * Points Possible: ** 10 homework assignments (20 points per homework) ** 2 projects / competitions (100 points per project) * Homework Rules ** For work done in groups, credit is divided equally among participants - so the max homework grade for a group of 2 is 10 points each. ** For each homework, 1 re-do at full credit can be sent at any time after the due date, but must present a unique solution to previous work from yourself or others. ** All work must cite co-group members (if any) and the source of any code snippets used online. === Grading Rationale === Homework points will only be awarded for correct, working code and correct algorithmic analysis, while the homework problems will become progressively tougher. Undergraduates should be able to pass the course with an A if they have correctly answered most of the homework, and made a strong attempt at one of the projects. Graduate students should both perform well on the homework and successfully complete one or two projects. Essentially, this means you should do your own homework when possible and may do a project in a small group. The re-grading and group options for homework allow making up for missed assignments, and encourage returning to core concepts at a later point in the class. Students who have completed significant portions of the homework have thus demonstrated programming proficiency, and are qualified for at least B/C grades. == Projects == === Midterm === A description for the midterm project is now available [[Media:midterm.pdf|here]]. The MD section will be updated as we discuss it in class. The due date for the midterm will be Friday, March 11. === Final === A description for the final project is now available [[Media:final.pdf|here]]. The due date for the final will be Friday, Aoril 29. == Textbooks and Resources == * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-0072-7 Beginning Python, Hetland, 2005] (eBook avail. from USF Library) * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-3238-4 Python Algorithms, Hetland, 2010] (eBook avail. from USF Library) * [http://aosabook.org/en/index.html The Architecture of Open Source Applications] * [http://docs.python.org Python Documentation] * [https://developers.google.com/edu/python/ Google Introductory Python Notes] * [http://huffman.sourceforge.net/tao/tao-of-programming.html Tao of Programming] Other (possibly useful) materials: * [http://hackersdictionary.com/html/entry/larval-stage.html The Jargon File] * Chapters 7&8 of Modelling and Simulation, Birta and Arbez, Springer 2007 (eBook avail. from USF Library). * Chapters 4-6 of Models and Algorithms for Intelligent Data Analysis, Runkler, Springer 2012 (eBook avail. from USF Library). * Guide to Scientific Computing in C++, Francis and Whiteley, Springer, 2012. (eBook avail. from USF Library) * Extra info. On the basics: ** Chapters 3 and 7 of Mathematics in Computing, Regan, Springer 2013. (eBook avail. from USF Library) ** Instant feedback graphical programming with [https://www.khanacademy.org/cs/programming/ Khan Academy] * [http://www.meetup.com/python-178/ Local PyBulls Meetings] Code: * [http://carsonfarmer.com/2013/07/essential-python-geo-libraries Python Libraries Useful for Geospatial Problems] * [[Code#Python_Libraries|Python Libraries Useful for Computational Chemistry]] (very small list at present) Interactive Interpreters: * [http://www.codewars.com CodeWars] Recommended for building experience with practice problems. * [http://codecombat.com/ CodeCombat] A very visual way to interact with your python code. * [http://exercism.io Exercism] A command-line client with a similar learn-through-challenge philosophy. * [http://repl.it repl.it] A read-eval-print loop for several computer languages. * [http://en.cppreference.com/w/cpp/language CppReference] Documentation with an online evaluator for C++ code. === Notes === * [[Media:intro.pdf|Notes]] for Week 1 ** Over the first two weeks or so, we'll be practicing the basics - so read through Chapters 1-3 of Hetland's Beginning Python during this time. ** [[PythonTranslated|Important Definitions]] * [[Media:Week2.pdf|Notes]] for Week 2 ** [[Code:Oware|Oware code]] ** Solutions for some problems in Week 2's notes: <source lang="python"> # simple data types "a string" # : str x = [1, 2, 3] # : [int] # compound data type (1, "name", (x, x)) # : (int, str, ([int], [int])) # add_one : int -> int # str.__add__ : str -> str -> str # str.split : str -> [str] # str.__mod__ : str -> (Objects) -> str </source> * [[Media:Week3.pdf|Notes]] for Week 3-4 ** Reading assignment - read through Chapter 5 and 6 (and practice dictionaries from Ch. 4) ** [[Code:for_patterns|Abstracting patterns]] in for loops. * [[Media:Week5.pdf|Notes]] for Week 5-6 ** Reading assignment - Read Chapter 10-11 (and refer to Ch. 4) * By this point, we've covered all the basics: ** base types: str, int, float, [a] ** variables and substitution: j vs "4" vs 4 ** indexing and slicing into lists / strings: x[1:4] or x[i:j] ** control flow: if and for syntax ** functions implementing patterns: def next(r, x): return r*x*(1-x) * You should be able to use these for: ** finding and abstracting the pattern ** naming the type of a function ** determining which variable names are in scope * All that's left is learning common uses, patterns and even more syntax! * [[Media:Week7-8.pdf|Notes]] for Week 7-8 * [[Media:Week9-10.pdf|Notes]] for Week 9-10 * [[Media:Week11.pdf|Notes]] for Week 11 * [[Media:Week12.pdf|Notes]] for Week 12 * [[Media:Week13.pdf|Notes]] for Week 13 * In-Class Examples * [[Gorillaz Code]] * [[File:Wat3-ccsd.txt]] Output of Multiwfn for a Na+(H20)_3 molecular cluster. * [[File:water_rdf.txt]] Water center of mass radial distribution function. === Homework === * [[CompSciHW1|Homework 1]] is due Monday, January 25. * [[CompSciHW2|Homework 2]] is due Monday, February 8. * [[CompSciHW3|Homework 3]] is due Friday, February 19. * [[CompSciHW4|Homework 4]] is due Friday, February 26. * [[CompSciHW5|Homework 5]] is due Friday, March 4. * [[CompSciHW6|Homework 6]] is due Wednesday, March 30. * [[CompSciHW7|Homework 7]] is due Friday, April 1. * [[CompSciHW8|Homework 8]] is due Friday, April 8. == Group Work Pages == Group 1 [https://docs.google.com/document/d/1k6vruCx78aV0pL8Kw7WWtsw_-6zgdoeP0OvujSzbsh0/edit?usp=sharing]: Group 2 [https://docs.google.com/document/d/1MgpVly2D1h9Xt_lFh5ywa3b70Ul9ES6OQZtg5l_n0NM/edit?usp=sharing] Group 3 [https://docs.google.com/document/d/1LT_J-vObN9tPa1JoQ1B_h04ENsL5Ko2xeFeRMp-99f8/edit?usp=sharing] Group 4 [https://docs.google.com/document/d/1hGlNlg1w7_3qCo6LE-y9rSZx1Chwc0FBUoxK6cyzWW8/edit?usp=sharing] * [[Code:Vectors|Interactive Vector Example]] dd2c6f0e266e9f14d5cc5296e396f024906edd3d File:Wat3-ccsd.txt 6 104 467 2016-02-29T17:15:48Z David M. Rogers 2 wikitext text/x-wiki da39a3ee5e6b4b0d3255bfef95601890afd80709 CompSciHW5 0 98 470 458 2016-03-04T19:47:12Z David M. Rogers 2 wikitext text/x-wiki Homework 5 - Due Friday, March 4, 2016 <pre> 1) Use numpy and pyplot to plot the following functions: (remember to start by choosing an appropriate range for x) a) f(x) = sin(x) cos(2x) b) g(x) = x (if x is in 0,1), 2-x (if x is in 1,2), 0 otherwise c) h(x) = exp(-x*x/(2*sigma)), for sigma = 1, 2, and 3 d) w(x) = g(x) - 4*g(x-2.0) e) u(x, y) = sin(x)*cos(3*y) - cos(2*x)*sin(y) [Hint: use pylab.imshow()] 2) Name the type of the following functions: (remember that *a means a list is input and **a means a dictionary) a) def joinwith(space, *a): return space.join(a) b) def map_on_n(f, n): return [f(i) for i in range(n)] c) def get_elem(k="default", **d): return d[k] + 2.0 d) def chaos(*a, **b): return random.random()*random.random() e) def sliceof(st, stop, step, *a): return a[st:stop:step] </pre> Hint: Try defining x as an array of x-values, and f,g,h, etc. as a python function with type float -> float. Then plot(x, f(x)) or calculate the values using vals = map(f, x) The first one tricks the function into the type (array -> array), and the second computes 1 float at a time. <source lang="python"> N = 100 x = np.linspace(-3.0, 3.0, N) # plotting 1D functions y = np.linspace(-2.0, 2.0, N) X, Y = np.meshgrid(x, y) # plotting 2D functions (1.e) </source> 452d087c2d205b7cd808bfe8b5ac1dffb3c74677 471 470 2016-03-04T19:47:43Z David M. Rogers 2 wikitext text/x-wiki Homework 5 - Due Friday, March 4, 2016 <pre> 1) Use numpy and pyplot to plot the following functions: (remember to start by choosing an appropriate range for x) a) f(x) = sin(x) cos(2x) b) g(x) = x (if x is in 0,1), 2-x (if x is in 1,2), 0 otherwise c) h(x) = exp(-x*x/(2*sigma)), for sigma = 1, 2, and 3 d) w(x) = g(x) - 4*g(x-2.0) e) u(x, y) = sin(x)*cos(3*y) - cos(2*x)*sin(y) [Hint: use pylab.imshow()] 2) Name the type of the following functions: (remember that *a means a list is input and **a means a dictionary) a) def joinwith(space, *a): return space.join(a) b) def map_on_n(f, n): return [f(i) for i in range(n)] c) def get_elem(k="default", **d): return d[k] + 2.0 d) def chaos(*a, **b): return random.random()*random.random() e) def sliceof(st, stop, step, *a): return a[st:stop:step] </pre> Hint: Try defining x as an array of x-values, and f,g,h, etc. as a python function with type float -> float. Then plot(x, f(x)) or calculate the values using vals = map(f, x) The first one tricks the function into the type (array -> array), and the second computes 1 float at a time. <source lang="python"> import numpy as np from pylab import plot, show, imshow N = 100 x = np.linspace(-3.0, 3.0, N) # plotting 1D functions y = np.linspace(-2.0, 2.0, N) X, Y = np.meshgrid(x, y) # plotting 2D functions (1.e) </source> a0357c0ea858280ecbd97f3b188905f151647d50 Code:gmxliquid 0 65 472 318 2016-03-05T15:35:33Z David M. Rogers 2 wikitext text/x-wiki In this tutorial, I'm assuming you already have the gromacs commands (grompp, mdrun, etc.) loaded. On circe at USF, this is done with: module load apps/gromacs/4.5.5 You'll also need the starting files [[Media:liq_files.tgz|here]]. Or, on circe, just run cp -R /shares/mri_workshop/Liquids . cd Liquids = Create an input system = First, we do some size calculations in the python prompt. >>> # Compute number of EtOH molecules >>> # 8 nm^3 = 8e-21 cc >>> # 0.4 % By vol. >>> # rho_EtOH = 0.78924 g / cc >>> # FW = 46 g/mol >>> >>> 8e-21*0.4*0.78924/46.0*6.022e23 33 Next, we need to generate an 8 nm<math>^3</math> box with 33 EtOH molecules genbox -box 2 2 2 -ci etoh.pdb -o box.pdb -nmol 33 nano topol.top # check for line "ETH 33" (no changes required) If the topology file and forcefields are 'there', we can create a test simulation using just these molecules. We'll do this just to check that grompp works grompp -c box.pdb -f equ.mdp -o equ.tpr Next, the complete water+EtOH mixture can be made by filling the voids with water. We'll use TIP4P here. genbox -cs tip4p -cp box.pdb -o sys.pdb Since this last command added waters, you have to update the topology file, adding "SOL 133" (or your number of waters) nano topol.top = run minimization = Molecular structures can be touchy, since contacting atoms causes large forces and 'blows up' a system. The risk of this can be reduced by minimizing the energy of initial starting systems. First, we have to create a file describing how gromacs should do the minimization. grompp -p topol.top -f min.mdp -c sys.pdb -o min A lot of backup files (starting with '#') accumulate, and we remove them like so: rm -f \#* mdout.mdp Now we're ready to run minimization. Since the system is small, minimization is cheap and fast - so we do it on the head node. For larger systems, this command would be put in a job-script. mdrun -deffnm min Now we're ready to take the minimized structure and run dynamics. This first round is called equilibration, since we intend to let the system settle into a thermal equilibrium state. grompp -c min.gro -f equ.mdp -o equ.tpr To run this one, we'll use the cluster by writing down the command in a script file. That script gets sent to the cluster. No changes to equ.sh should be required. nano equ.sh sbatch equ.sh squeue -u `whoami` As the job is running you can read through the log file. less equ.log tail -f equ.log # enter Ctl-C to stop tailing Note that the energy is output at every time-step. Why is the total energy changing with time? What about the total volume? = run dynamics = Running dynamics uses the same procedure as before, but now we need to worry about how much and which output to produce. nano run.mdp # no changes required grompp -c equ.gro -f run.mdp -o run.tpr Check and start the job (no changes required). nano run.sh sbatch run.sh squeue -u `whoami` Read through run.log less run.log tail -f run.log # enter Ctl-C to stop tailing Notice that the total energy remains relatively constant now, but the individual energies are still very noisy. What does this say about the shape of the molecules? = analyze dynamic data = Let's first check what happened during equilibration. Since the volume was allowed to change, we should be able to plot it vs. time: g_energy -f equ.edr -o equ.en.xvg # Select: Potential Kinetic-En. Total-Energy Volume * At what time does the potential energy stabilize? * What is the density? ** answer: (33*46 + 18*133)/Avogadro / 7.0333834916722191e-21 = 0.9236 g/mL ** These two quantities inform on the heat and volume change of mixing. ** Pure H2O (TIP4P): rho = 1.001, H ~ 11.6 kcal/mol, D = 3.9e-5 cm^2/s, eps = 52 ** Pure H2O (expt): rho = 0.9971, H = 10.5 kcal/mol, D = 2.3e-5 cm^2/s, eps = 78.4 ** Gas-phase TIP4P energy = 0 (no self interactions in the model) ** Gas-phase OPLSAA-EtOH energy = 25 kJ/mol (<math>\pm</math>1) ** (J. Chem. Phys. 123, 234505, 2005) ** Pure EtOH: rho = 0.7873, H = 10.0 kcal/mol, D = 1.0e-5 cm^2/s, eps(expt) = 23 ** (J. Phys. Chem. B 1997, 101, 78-86, J. Phys. Chem. B, 2014, 118 (34), 10156-66) Gnuplot can make this plot with plot 'equ.en.xvg' u 1:2 w l, 'equ.en.xvg' u 1:5 axis x1y2 w l The radial distribution function is a classical measure of the structuring of liquid water. The one we calculate here shows the density of molecules within spherical shells around the central molecule. g_rdf -rdf mol_com -ng 2 -s run -f run.trr -o run.w-rdf.xvg # select Water as "reference group", select "Water", then "ETH" # re-run for ETH-ETH rdf g_rdf -rdf mol_com -ng 1 -s run -f run.trr -o run.e-rdf.xvg gnuplot can plot these together with: plot 'run.w-rdf.xvg' u 1:2 w l, 'run.w-rdf.xvg' u 1:3 w l, 'run.e-rdf.xvg' u 1:2 w l Notice how waters stack much more closely together than EtOH? How is this related to their liquid densities? The dielectric of a liquid measures its ability to be polarized by an applied field. High dielectric materials make good capacitors. g_dipoles -f run.trr -s run.tpr -c dipcorr.xvg -corr total -P 1 <pre><nowiki> Dipole moment (Debye) --------------------- Average = 2.2234 Std. Dev. = 0.1095 Error = 0.0001 The following averages for the complete trajectory have been calculated: Total < M_x > = 7.79882 Debye Total < M_y > = -1.11977 Debye Total < M_z > = 9.49511 Debye Total < M_x^2 > = 882.516 Debye^2 Total < M_y^2 > = 1239.78 Debye^2 Total < M_z^2 > = 925.457 Debye^2 Total < |M|^2 > = 3047.75 Debye^2 Total |< M >|^2 = 152.233 Debye^2 < |M|^2 > - |< M >|^2 = 2895.52 Debye^2 Finite system Kirkwood g factor G_k = 3.52836 Infinite system Kirkwood g factor g_k = 2.37948 Epsilon = 43.1739 </nowiki></pre> Water and EtOH are constantly undergoing random collisions in solution. The net effect of this is diffusion of the two molecules. Einstein showed that this can be tracked by watching the mean squared displacement of the molecules over time. Since the distance traveled over a random walk with diffusion constant <math>D</math> has a Gaussian distribution with variance <math>2D\Delta t</math>, where <math>\Delta t</math> is the elapsed time, the mean squared displacement vs time should be a straight line with slope <math>2D</math>. Of course, over short times, this picture is only approximate, but it usually holds over longer times. g_msd -f run.trr -ngroup 2 -o run.msd.xvg <pre><nowiki> Fitting from 100 to 900 ps D[ Water] 1.4336 (+/- 0.0850) 1e-5 cm^2/s D[ ETH] 0.7312 (+/- 0.1279) 1e-5 cm^2/s </nowiki></pre> How do these compare with the literature values (above) for the pure liquids? More detail on velocity correlation: g_velacc -mol -s run -f run.trr -o run.w-acf.xvg # Choose group 3 (Water) g_velacc -mol -s run -f run.trr -o run.e-acf.xvg # Choose group 2 (ETH) you can compare these to some of the above references. d6ebbd4523bb11fa88ddf3a983ae97f7448c6c3e Gorrilaz Code 0 105 475 2016-03-07T16:30:33Z David M. Rogers 2 David M. Rogers moved page [[Gorrilaz Code]] to [[Gorillaz Code]]: misspelling wikitext text/x-wiki #REDIRECT [[Gorillaz Code]] e36eefeba72c6293b0a63cd73e5bb3ddddcc855d File:Week7-8.pdf 6 106 477 2016-03-07T16:34:29Z David M. Rogers 2 wikitext text/x-wiki da39a3ee5e6b4b0d3255bfef95601890afd80709 CompSciHW6 0 99 478 459 2016-03-21T14:41:32Z David M. Rogers 2 wikitext text/x-wiki Homework 6 - Due Friday, March 25 <pre> 1) Create a function that parses the following files: a) mat33 = """ 1.0 2.0 3.0 -2.0 0.0 1.0 1.0 1.1 1.2 """ # output a matrix b) csv = """ # time temperature sea_level 0.0, 300.0, 44.5 1.5, 299.5, 44.0 3.0, 299.8, 44.2 4.5, 301.0, 43.9 """ # output a list of strings and a matrix c) name_val = """ seed = 1553 name = "test name" trials = 10 tolerance = 1e-8 """ # output a dictionary d) group_data = """ [Group 1] 1 2 3 4 5 6 [Group 2] 4 5 11 14 1 [Group 3] 7 8 9 10 11 """ # output a dictionary of [int] 2) Complete this function by adding a for loop to fill each element of a vector with a function (g(i)): from numpy import * def vec_from_func(n, g): # int -> (int -> float) -> array x = zeros(n, float) for ... return x g_arr = 3) Complete this function by adding a nested for-loop to fill each element of a matrix with a function, u(i,j): from numpy import * def mat_from_func(n,m, g): # int -> int -> (int -> int -> float) -> array M = zeros((n,m), float) for ... for ... return M </pre> 93413bfdc714332e4ed5dcc0498b6506252ccf1e 482 478 2016-03-21T17:12:12Z David M. Rogers 2 wikitext text/x-wiki Homework 6 - Due Friday, March 25 <pre> 1) Create a function that parses the following files: a) mat33 = """ 1.0 2.0 3.0 -2.0 0.0 1.0 1.0 1.1 1.2 """ # output a matrix # example function structure def parse_mat(s): mat = [] # build a list of lists ... return array(mat) # make into an array b) csv = """ # time temperature sea_level 0.0, 300.0, 44.5 1.5, 299.5, 44.0 3.0, 299.8, 44.2 4.5, 301.0, 43.9 """ # output a list of strings and a matrix c) name_val = """ seed = 1553 name = "test name" trials = 10 tolerance = 1e-8 """ # output a dictionary d) group_data = """ [Group 1] 1 2 3 4 5 6 [Group 2] 4 5 11 14 1 [Group 3] 7 8 9 10 11 """ # output a dictionary of [int] 2) Complete this function by adding a for loop to fill each element of a vector with a function (g(i)): from numpy import * def vec_from_func(n, g): # int -> (int -> float) -> array x = zeros(n, float) for ... return x # example call def square_x(x): # int -> float return 1.0*x*x g_arr = vec_from_func(10, square_x) 3) Complete this function by adding a nested for-loop to fill each element of a matrix with a function, u(i,j): from numpy import * def mat_from_func(n,m, g): # int -> int -> (int -> int -> float) -> array M = zeros((n,m), float) for ... for ... return M </pre> d3447784e78d069c544a9062338592281c1ef95a 483 482 2016-03-21T17:50:00Z David M. Rogers 2 wikitext text/x-wiki Homework 6 - Due Friday, March 25 <pre> 1) Create a function that parses the following files: a) mat33 = """ 1.0 2.0 3.0 -2.0 0.0 1.0 1.0 1.1 1.2 """ # output a matrix # example function structure def parse_mat(s): mat = [] # build a list of lists ... return array(mat) # make into an array b) csv = """ # time temperature sea_level 0.0, 300.0, 44.5 1.5, 299.5, 44.0 3.0, 299.8, 44.2 4.5, 301.0, 43.9 """ # output a list of strings and a matrix c) name_val = """ seed = 1553 name = "test name" trials = 10 tolerance = 1e-8 """ # output a dictionary d) group_data = """ [Group 1] 1 2 3 4 5 6 [Group 2] 4 5 11 14 1 [Group 3] 7 8 9 10 11 """ # output a dictionary of [int] 2) Complete this function by adding a for loop to fill each element of a vector with a function (g(i)): from numpy import * def vec_from_func(n, g): # int -> (int -> float) -> array x = zeros(n, float) for ... return x # example call def square_x(x): # int -> float return 1.0*x*x g_arr = vec_from_func(10, square_x) 3) Complete this function by adding a nested for-loop to fill each element of a matrix with a function, u(i,j): from numpy import * def mat_from_func(n,m, g): # int -> int -> (int -> int -> float) -> array M = zeros((n,m), float) for ... for ... return M </pre> Hint: <source lang="python"> # parse key-value pairs def get_kv(x): # str -> (str, str) n = x.find('=') if n < 0: raise ValueError return x[:n].strip(), x[n+1:].strip() # basic parser structure: def parse_cif(name): f = open(name, 'r') out = {} state = 0 vals = [] for line in f.readlines(): k = line.strip() if not k: continue # test whether line contains useful info. return out </source> 56d3e047531c28fd016a6d67b11ca94e33c1bb15 File:Week9-10.pdf 6 107 481 2016-03-21T16:14:57Z David M. Rogers 2 wikitext text/x-wiki da39a3ee5e6b4b0d3255bfef95601890afd80709 File:Water rdf.txt 6 108 486 2016-03-23T16:03:22Z David M. Rogers 2 Water and ETH center of mass rdf computed following [[Code:gmxliquid]] wikitext text/x-wiki Water and ETH center of mass rdf computed following [[Code:gmxliquid]] 3df2b2fce24e16f0cdd5b95687edcecafd4ec162 File:Week11.pdf 6 109 489 2016-03-28T15:47:19Z David M. Rogers 2 wikitext text/x-wiki da39a3ee5e6b4b0d3255bfef95601890afd80709 CompSciHW7 0 110 490 2016-03-28T15:57:53Z David M. Rogers 2 Created page with "Introduction To Scientific Computing Homework 7 (Fall, 2016) Due Friday, April 1. <pre> 1) Write a function to add two polynomials that have been specified by vectors of the..." wikitext text/x-wiki Introduction To Scientific Computing Homework 7 (Fall, 2016) Due Friday, April 1. <pre> 1) Write a function to add two polynomials that have been specified by vectors of their coefficients, z(t) = x(t) + y(t) where x(t) = a_0 + a_1 t + a_2 t^2 + ... y(t) = b_0 + b_1 t + b_2 t^2 + ... z(t) = c_0 + c_1 t + c_2 t^2 + ... The function should return the vector, c. Be sure to handle the case where the lengths of a and b are different. 2) Write a function to multiply two input functions - each of which have been specified by their values at the same set of points, x_n, n=0, 1, ..., N-1. i.e. z(x_n) = f(x_n) g(x_n) Handle the case where the lengths of a and b are different by assuming that the functions are zero wherever a point is not provided. 3) Write a function to compute the volume and perimeter of 2D and 3D rectangular boxes. The boxes are specified by lengths along each dimension. The function should return a tuple, (Area : float, Volume : float) 4) Write a function to compute the set of inner products, <a_n, b> where a_n are row-vectors of an input matrix, A (n by m) and b is a vector of length m. 5) Re-write the last function, assuming a_n are column vectors of an input matrix, A (m by n). </pre> ee6d0569a5e8c6dee2848acbd75fd7c4b61c8f18 Code:Vectors 0 111 495 2016-03-31T18:32:06Z David M. Rogers 2 Created page with "This interactive code demp plots three vectors using [[matplotlib]]. The "zero" vector, x[0], is colored blue because it is recomputed from the other two vectors, x[1] and x[2..." wikitext text/x-wiki This interactive code demp plots three vectors using [[matplotlib]]. The "zero" vector, x[0], is colored blue because it is recomputed from the other two vectors, x[1] and x[2]. If you drag them around, you can see that x[0] always shows the sum, x[1] + x[2] By changing the "def update_vec" function, you can implement dot products, projections, and reflections. <source lang="python"> import numpy as np import matplotlib.path as mpath import matplotlib.patches as mpatches import matplotlib.pyplot as plt Path = mpath.Path #fig, ax = plt.subplots() ax = plt.gca() #arrows = np.array([[[0.0, 0.0], [0.0, 2.0]]]) arrows = np.array([[0.0, 2.0], [-1,-1], [3,-0.5]]) codes = [Path.MOVETO, Path.LINETO, Path.LINETO, Path.LINETO, Path.LINETO, Path.LINETO] def path_from_vec(x,y,dx,dy): r = (dx*dx+dy*dy)**0.5 a = 0.5 c = 0.2*dx/r s = 0.2*dy/r x1 = x + (r-0.2)*dx/r y1 = y + (r-0.2)*dy/r pathdata = [(x,y), (x1,y1), (x1+s-a*c, y1-c-a*s), (x1+c, y1+s), (x1-s-a*c, y1+c-a*s), (x1,y1)] return pathdata def to_path(v, color='green'): verts = path_from_vec(0., 0., *v) path = mpath.Path(verts, codes) patch = mpatches.PathPatch(path, facecolor=color, edgecolor='k', alpha=0.5) ax.add_patch(patch) return patch class PathInteractor(object): showverts = True epsilon = 10 # max pixel distance to count as a vertex hit def __init__(self, vecs): self.paths = [] color = 'blue' vecs[0] = update_vec(vecs) for i,v in enumerate(vecs): if i > 0: color = 'green' path = to_path(v, color) self.paths.append(path) path.set_animated(True) self.ax = self.paths[0].axes canvas = self.ax.figure.canvas self.vecs = vecs self._ind = None # the active vert canvas.mpl_connect('draw_event', self.draw_callback) canvas.mpl_connect('button_press_event', self.button_press_callback) canvas.mpl_connect('key_press_event', self.key_press_callback) canvas.mpl_connect('button_release_event', self.button_release_callback) canvas.mpl_connect('motion_notify_event', self.motion_notify_callback) self.canvas = canvas def draw_callback(self, event): self.background = self.canvas.copy_from_bbox(self.ax.bbox) for path in self.paths: self.ax.draw_artist(path) self.canvas.blit(self.ax.bbox) def get_ind_under_point(self, event): 'get the index of the vertex under point if within epsilon tolerance' # display coords r = np.sqrt(sum(self.vecs*self.vecs,1)) r += (0.1 - r)*(r < 0.1) xy = self.vecs*(r-0.1)/r # move location to arrow head xyt = self.paths[0].get_transform().transform(xy) xt, yt = xyt[:, 0], xyt[:, 1] d = np.sqrt((xt - event.x)**2 + (yt - event.y)**2) ind = d.argmin() if d[ind] >= self.epsilon: ind = None return ind def button_press_callback(self, event): 'whenever a mouse button is pressed' if not self.showverts: return if event.inaxes is None: return if event.button != 1: return self._ind = self.get_ind_under_point(event) def button_release_callback(self, event): 'whenever a mouse button is released' if not self.showverts: return if event.button != 1: return self._ind = None def key_press_callback(self, event): 'whenever a key is pressed' if not event.inaxes: return #if event.key == 't': # self.showverts = not self.showverts # self.line.set_visible(self.showverts) # if not self.showverts: # self._ind = None #self.canvas.draw() def motion_notify_callback(self, event): 'on mouse movement' if not self.showverts: return if self._ind is None: return if event.inaxes is None: return if event.button != 1: return x, y = event.xdata, event.ydata self.vecs[self._ind] = x, y self.paths[self._ind].get_path().vertices[:] = \ path_from_vec(0., 0., *self.vecs[self._ind]) # update vec 0 based on callback if self._ind != 0: self.vecs[0] = update_vec(self.vecs) self.paths[0].get_path().vertices[:] = \ path_from_vec(0., 0., *self.vecs[0]) self.canvas.restore_region(self.background) for path in self.paths: self.ax.draw_artist(path) self.canvas.blit(self.ax.bbox) def update_vec(x): return x[1]+x[2] interactor = PathInteractor(arrows) ax.set_title('drag vertices to update path') ax.set_xlim(-3, 4) ax.set_ylim(-3, 4) plt.show() </source> a5dad3e9c6cd91de5d26999709da8359df802963 CompSciHW8 0 112 497 2016-04-04T14:41:24Z David M. Rogers 2 Created page with "Introduction to Scientific Computing, Homework 8. Due Friday, April 8 2016. <pre> 1) Write code to generate the following empty arrays: a) a vector of 100 floats b) a 20 ..." wikitext text/x-wiki Introduction to Scientific Computing, Homework 8. Due Friday, April 8 2016. <pre> 1) Write code to generate the following empty arrays: a) a vector of 100 floats b) a 20 x 3 matrix of integers c) a 2 x 5 x 5 array of floats d) a 5 x 5 matrix taken from the first group of (c) 2) Write code to carry out matrix multiplication manually and test it against the result of numpy.dot. 3) Write code to multiply every column of matrix, A, with every other column. Use this to find the set of angles between the column vectors. 4) Generate 2 random 3D vectors, using numpy.random.random(3). Compute the cosine between the two vectors. Now run this 1000 times, and plot a histogram of the cosine. note: plt.histogram(list_of_cosine_values) will automatically create the histogram from your list (length 1000) list of cosines. 5) Generate 2 random 3D vectors using the method above, and compute the distance between them. Run this 1000 times, and plot a histogram of the distance values. What do you notice about the shape of the distribution? Does it have a maximum? Does this correspond to your geometrical intuition? </pre> 549c994b0f59de2722a35733a47f34bce7cbbf3f CompSciHW9 0 113 498 2016-04-04T15:03:48Z David M. Rogers 2 Created page with "Introduction to Scientific Computing, HW 9. Due Friday, Apr. 15, 2016. <pre> 1) Write a complete code to simulate the Lennard-Jones gas in a 2D periodic box with box leng..." wikitext text/x-wiki Introduction to Scientific Computing, HW 9. Due Friday, Apr. 15, 2016. <pre> 1) Write a complete code to simulate the Lennard-Jones gas in a 2D periodic box with box length L = 14 and n=100 particles. Start them off on a 10x10 grid with Gaussian distributed velocities. Ignore units and assume beta = m = 1. The Hamiltonian is given by H = sum_j m v_j^2/2 + 1/2 sum_{i != j} u_ij^2 - u_ij where u_ij = |x_i - x_j|**-6 The force on each particle, i, is therefore F_i = sum_{j != i} 6 (x_i - x_j) / |x_i - x_j| ( 2 u_ij^2 - u_ij ) 2) Run the simulation for 100 steps, and create a plot showing the locations of the atoms every 10 steps. 3) For every timestep, calculate the kinetic and potential energies. What do you observe about the behavior of the potential energy? 4) Make a plot of the total energy vs. time for your 100 step simulation. Overlay these plots for several different values of the numerical timestep, dt. </pre> Hints: <source lang="python"> # Wrap all coordinates in an array to the range [0,L) print x - L*floor(x/L) # Find the closest distance between two points, r_ij y = x[i] - x[j] print y - L*floor(y/L + 0.5) # Calculate the LJ force on an atom at point z r = closest_distance(z, x) # matrix of closest distances (n x 3) r2 = sum(r*r, 1) # vector of squared distances (n) u = r2**3 print 6 * sum(r * ((2*u*u - u)/sqrt(r2))[:,newaxis], 0) # sum over other atoms </source> e884ffc1f30748560f415be7ac13e88131cd7a3b 499 498 2016-04-04T15:06:26Z David M. Rogers 2 wikitext text/x-wiki Introduction to Scientific Computing, HW 9. Due Friday, Apr. 15, 2016. <pre> 1) Write a complete code to simulate the Lennard-Jones gas in a 2D periodic box with box length L = 14 and n=100 particles. Start them off on a 10x10 grid with Gaussian distributed velocities. Ignore units and assume beta = m = 1. The Hamiltonian is given by H = sum_j m v_j^2/2 + 1/2 sum_{i != j} u_ij^2 - u_ij where u_ij = |x_i - x_j|**-6 The force on each particle, i, is therefore F_i = sum_{j != i} 6 (x_i - x_j) / |x_i - x_j| ( 2 u_ij^2 - u_ij ) 2) Run the simulation for 100 steps, and create a plot showing the locations of the atoms every 10 steps. 3) For every timestep, calculate the kinetic and potential energies. What do you observe about the behavior of the potential energy? 4) Make a plot of the total energy vs. time for your 100 step simulation. Overlay these plots for several different values of the numerical timestep, dt. </pre> Hints: <source lang="python"> # Wrap all coordinates in an array to the range [0,L) print x - L*floor(x/L) # Find the closest distance between two points, r_ij y = x[i] - x[j] print y - L*floor(y/L + 0.5) # Calculate the LJ force on an atom at point z r = closest_distance(z, x) # matrix of closest distances (n x 3) r2 = sum(r*r, 1) # vector of squared distances (n) u = r2**-3 print 6 * sum(r * ((2*u*u - u)/sqrt(r2))[:,newaxis], 0) # sum over other atoms </source> e36e1c92dd1da1981b182d6e4971aa370dddec0c File:Basis.pdf 6 66 501 311 2016-04-06T15:29:40Z David M. Rogers 2 David M. Rogers uploaded a new version of &quot;[[File:Basis.pdf]]&quot; wikitext text/x-wiki da39a3ee5e6b4b0d3255bfef95601890afd80709 File:Integrate.pdf 6 67 502 313 2016-04-06T15:33:08Z David M. Rogers 2 David M. Rogers uploaded a new version of &quot;[[File:Integrate.pdf]]&quot; wikitext text/x-wiki da39a3ee5e6b4b0d3255bfef95601890afd80709 CompSciWeek13 0 63 503 312 2016-04-06T15:59:57Z David M. Rogers 2 /* Numerical Integration + Binary Output Format */ wikitext text/x-wiki = Numerical Integration + Binary Output Format = * Van der Pol Oscillator: <math>\ddot u - \mu (1-u^2) \dot u + u = 0</math> ** Implementations in OpenOffice Spreadsheet, GNU ODE, and Python ** Perturbed initial conditions, Lyapunov exponents, and large deviation principles * Working well with others: text * Working with machines: binary ** This is preferable when you have lots and lots of data ** The relevant numpy methods are x.tofile("file") and x = fromfile("file") -- but save("file", x) and x = load("file") are preferred ** inspecting binary formats with od * [[Media:Integrate.pdf|Lecture Slides]] === GNU ODE Integrator === '''vanderpol.ode''' <source lang="haskell"> mu = %MU u = 1.0 y = 0.0 u' = y y' = mu*(1-u*u)*y - u print t, u, y, y! every 10 from 50 step 0, 100 </source> You can do the substitution with sed and run all dynamics with: for((i=0;i<10;i++)); do sed -e "s|%MU|$i|" vanderpol.ode >vanderpol-$i.ode ode -f vanderpol-$i.ode >out-$i.dat </dev/null done === Plotting with Gnuplot === <source lang="gnuplot"> set term postscript enh color lw 3 "Times-Roman" 28 set out 'van.eps' set xlabel "u" set ylabel "y" plot 'out-0.dat' u 2:3 w l title "0", \ 'out-1.dat' u 2:3 w l title "1", \ 'out-4.dat' u 2:3 w l title "{/Symbol m} = 4" </source> Run with: gnuplot plot_van.gplot === Python Integrator === First, form the heart of the algorithm: <source lang="python"> def step(N=1): for i in xrange(N): v += (mu*(1.0-x**2)*v - x) * dt x += v * dt </source> Note that this will work if x and v are vectors as well as scalars. That means we can run a bunch of trajectories with different initial starting points in one fell swoop. Next, wrap it inside a class: <source lang="python"> class State: def __init__(self, x, v, mu, dt): assert x.shape == v.shape self.mu = mu self.dt = dt self.x = x self.v = v def state(self, N=1): # must change all variables (e.g. "name") to "self.name" </source> Next, instantiate and run the class: <source lang="python"> st = State(5.0, 1.0, 2.0, 0.01) st.step() print st.x st.step() print st.x </source> Next, add a nice printing function to "print the state," <source lang="python"> def __str__(self): s = "" for x,v in zip(self.x, self.v): s += " %f %f"%(x, v) return s </source> This prints (x1 v1 x2 v2 ...) in a single, long line. OK, so now we're ready to run lots of tests. Let's lift the python program to a command-line program. Add this to the header: <source lang="python"> #!/usr/bin/env python import sys from numpy import * from numpy.random import standard_normal norm = standard_normal </source> Add this to the end of the file: <source lang="python"> def main(argv): print argv if __name__=="__main__": main(sys.argv) </source> From the shell, run <source lang="bash"> chmod +x vanderpol.py ./vanderpol.py a test argument </source> Note that you get to provide parameters to your program at the command-line. Unfortunately, they all have type str. Let's formalize them, <source lang="python"> def main(argv): assert len(argv) == 5, "Usage: %s x0 p0 R mu"%(argv[0]) x0, p0, R, mu = map(float, argv[1:5]) st = State(x0,p0,mu,0.01) for i in range(500): st.step(10) print st </source> Finally, we have a new tool that can be run to generate reproducible simulations of the van der Pol oscillator. Next, we need to consider how to store the data it generates for later analysis and use. Here's an example using a 500x2x5 tensor: <source lang="python"> T = zeros((500,2,5)) # steps by (x or v) by points for i in range(500): st.step(10) T[i,0] = st.x T[i,1] = st.v </source> This can be "flattened" to a 500x10 tensor, <source> T = reshape(T, (500,10)) # or reshape(T, (-1,10)) "figures out" the 500 size </source> === Working with binary === Example: [http://man7.org/linux/man-pages/man5/elf.5.html ELF] header od -t x1 -t c -N 8 /bin/bash Binary comes in lots of units {| div class="wikitable" ! 8 bits ! = 1 byte |- ! 4 bits ! = 1 nibble |- ! 1 byte ! = 1 ascii character |- ! 2 bytes ! = 1 short = 1 word |- ! 4 bytes ! = 1 32-bit int = 1 float |- ! 8 bytes ! = 1 64-bit int = 1 double = 1 float complex |- ! 16 bytes ! = 1 long double = 1 double complex |} Byte ordering on most modern 64-bit processors is little-endian (Intel, AMD). For more info, see [http://betterexplained.com/articles/understanding-big-and-little-endian-byte-order/]. In an imaginary system where base 10 numbers are encoded by 4-bit nibbles, a 4-digit representation of the number 123 is 3 = 0011 2 = 0010 1 = 0001 0 = 0000 The binary together would read: 0011 0010 0001 0000 Since we have to use 4 digits, the most significant digit is set to all zeros, and goes last. The little end (least significant byte) goes first. Notice that within the 4-bit nibbles, the least-significant bit is still on the right. So the number is encoded using this left-to right (within a digit) and bottom to top (digits within a word) order. Real binary encoding is just like the above, except that each 'digit' is a byte, so every 8 bits are in order, but the bytes are reversed. = Basis Functions = * Constructing B-splines - tensor method * Representing the differentiation operator * Solving PDEs using the implicit method * [[Media:Basis.pdf|Lecture Slides]] 5c894223b7526dc00eb995abf5ceb4a086a1405d 504 503 2016-04-06T16:00:40Z David M. Rogers 2 /* Python Integrator */ wikitext text/x-wiki = Numerical Integration + Binary Output Format = * Van der Pol Oscillator: <math>\ddot u - \mu (1-u^2) \dot u + u = 0</math> ** Implementations in OpenOffice Spreadsheet, GNU ODE, and Python ** Perturbed initial conditions, Lyapunov exponents, and large deviation principles * Working well with others: text * Working with machines: binary ** This is preferable when you have lots and lots of data ** The relevant numpy methods are x.tofile("file") and x = fromfile("file") -- but save("file", x) and x = load("file") are preferred ** inspecting binary formats with od * [[Media:Integrate.pdf|Lecture Slides]] === GNU ODE Integrator === '''vanderpol.ode''' <source lang="haskell"> mu = %MU u = 1.0 y = 0.0 u' = y y' = mu*(1-u*u)*y - u print t, u, y, y! every 10 from 50 step 0, 100 </source> You can do the substitution with sed and run all dynamics with: for((i=0;i<10;i++)); do sed -e "s|%MU|$i|" vanderpol.ode >vanderpol-$i.ode ode -f vanderpol-$i.ode >out-$i.dat </dev/null done === Plotting with Gnuplot === <source lang="gnuplot"> set term postscript enh color lw 3 "Times-Roman" 28 set out 'van.eps' set xlabel "u" set ylabel "y" plot 'out-0.dat' u 2:3 w l title "0", \ 'out-1.dat' u 2:3 w l title "1", \ 'out-4.dat' u 2:3 w l title "{/Symbol m} = 4" </source> Run with: gnuplot plot_van.gplot === Python Integrator === First, form the heart of the algorithm: <source lang="python"> def step(N=1): for i in xrange(N): v += (mu*(1.0-x**2)*v - x) * dt x += v * dt </source> Note that this will work if x and v are vectors as well as scalars. That means we can run a bunch of trajectories with different initial starting points in one fell swoop. Next, wrap it inside a class: <source lang="python"> class State: def __init__(self, x, v, mu, dt): assert x.shape == v.shape self.mu = mu self.dt = dt self.x = x self.v = v def state(self, N=1): # must change all variables (e.g. "name") to "self.name" </source> Next, instantiate and run the class: <source lang="python"> st = State(5.0, 1.0, 2.0, 0.01) st.step() print st.x st.step() print st.x </source> Next, add a nice printing function to "print the state," <source lang="python"> def __str__(self): s = "" for x,v in zip(self.x, self.v): s += " %f %f"%(x, v) return s </source> This prints (x1 v1 x2 v2 ...) in a single, long line. OK, so now we're ready to run lots of tests. Let's lift the python program to a command-line program. Add this to the header: <source lang="python"> #!/usr/bin/env python import sys from numpy import * from numpy.random import standard_normal norm = standard_normal </source> Add this to the end of the file: <source lang="python"> def main(argv): print argv if __name__=="__main__": main(sys.argv) </source> From the shell, run <source lang="bash"> chmod +x vanderpol.py ./vanderpol.py a test argument </source> Note that you get to provide parameters to your program at the command-line. Unfortunately, they all have type str. Let's formalize them, <source lang="python"> def main(argv): assert len(argv) == 5, "Usage: %s x0 p0 R mu"%(argv[0]) x0, p0, R, mu = map(float, argv[1:5]) st = State(x0,p0,mu,0.01) for i in range(500): st.step(10) print st </source> Finally, we have a new tool that can be run to generate reproducible simulations of the van der Pol oscillator. Next, we need to consider how to store the data it generates for later analysis and use. Here's an example using a 500x2x5 tensor: <source lang="python"> T = zeros((500,2,5)) # steps by (x or v) by points for i in range(500): st.step(10) T[i,0] = st.x T[i,1] = st.v </source> This can be "flattened" to a 500x10 tensor, <source lang="python"> T = reshape(T, (500,10)) # or reshape(T, (-1,10)) "figures out" the 500 size </source> === Working with binary === Example: [http://man7.org/linux/man-pages/man5/elf.5.html ELF] header od -t x1 -t c -N 8 /bin/bash Binary comes in lots of units {| div class="wikitable" ! 8 bits ! = 1 byte |- ! 4 bits ! = 1 nibble |- ! 1 byte ! = 1 ascii character |- ! 2 bytes ! = 1 short = 1 word |- ! 4 bytes ! = 1 32-bit int = 1 float |- ! 8 bytes ! = 1 64-bit int = 1 double = 1 float complex |- ! 16 bytes ! = 1 long double = 1 double complex |} Byte ordering on most modern 64-bit processors is little-endian (Intel, AMD). For more info, see [http://betterexplained.com/articles/understanding-big-and-little-endian-byte-order/]. In an imaginary system where base 10 numbers are encoded by 4-bit nibbles, a 4-digit representation of the number 123 is 3 = 0011 2 = 0010 1 = 0001 0 = 0000 The binary together would read: 0011 0010 0001 0000 Since we have to use 4 digits, the most significant digit is set to all zeros, and goes last. The little end (least significant byte) goes first. Notice that within the 4-bit nibbles, the least-significant bit is still on the right. So the number is encoded using this left-to right (within a digit) and bottom to top (digits within a word) order. Real binary encoding is just like the above, except that each 'digit' is a byte, so every 8 bits are in order, but the bytes are reversed. = Basis Functions = * Constructing B-splines - tensor method * Representing the differentiation operator * Solving PDEs using the implicit method * [[Media:Basis.pdf|Lecture Slides]] afb9e69cd03db8182cfd013caf44ee8facdaa269 File:Week12.pdf 6 114 506 2016-04-06T16:02:33Z David M. Rogers 2 wikitext text/x-wiki da39a3ee5e6b4b0d3255bfef95601890afd80709 507 506 2016-04-06T16:03:49Z David M. Rogers 2 David M. Rogers uploaded a new version of &quot;[[File:Week12.pdf]]&quot; wikitext text/x-wiki da39a3ee5e6b4b0d3255bfef95601890afd80709 File:Final.pdf 6 115 509 2016-04-08T15:01:16Z David M. Rogers 2 wikitext text/x-wiki da39a3ee5e6b4b0d3255bfef95601890afd80709 File:Week13.pdf 6 116 511 2016-04-11T16:22:19Z David M. Rogers 2 wikitext text/x-wiki da39a3ee5e6b4b0d3255bfef95601890afd80709 CompSciHW10 0 117 512 2016-04-13T16:21:16Z David M. Rogers 2 Created page with "Intro. Scientific Computing, HW10 - Due Friday, April 22. <pre> 1) Write a complete code to simulate the Lennard-Jones gas in a 2D periodic box with box length L = 14 and ..." wikitext text/x-wiki Intro. Scientific Computing, HW10 - Due Friday, April 22. <pre> 1) Write a complete code to simulate the Lennard-Jones gas in a 2D periodic box with box length L = 14 and n=100 particles. Start them off on a 10x10 grid with Gaussian distributed velocities. Ignore units and assume beta = m = 1. The Hamiltonian is given by H = sum_j m v_j^2/2 + 1/2 sum_{i != j} u_ij^2 - u_ij where u_ij = |x_i - x_j|**-6 The force on each particle, i, is therefore F_i = sum_{j != i} 6 (x_i - x_j) / |x_i - x_j| ( 2 u_ij^2 - u_ij ) 2) Run the simulation for 100 steps, and create a plot showing the locations of the atoms every 10 steps. 3) For every timestep, calculate the kinetic and potential energies. What do you observe about the behavior of the potential energy? 4) Make a plot of the total energy vs. time for your 100 step simulation. Overlay these plots for several different values of the numerical timestep, dt. </pre> Hints: <source lang="python"> # Wrap all coordinates in an array to the range [0,L) print x - L*floor(x/L) # Find the closest distance between two points, r_ij y = x[i] - x[j] print y - L*floor(y/L + 0.5) # Calculate the LJ force on an atom at point z r = closest_distance(z, x) # matrix of closest distances (n x 3) r2 = sum(r*r, 1) # vector of squared distances (n) u = r2**-3 print 6 * sum(r * ((2*u*u - u)/sqrt(r2))[:,newaxis], 0) # sum over other atoms </source> f7eee169f59c38276fc54a1035f1f9b38b274b6b 516 512 2016-04-18T16:15:16Z David M. Rogers 2 wikitext text/x-wiki Intro. Scientific Computing, HW10 - Due Friday, April 22. <pre> 1) Write a complete code to simulate the Lennard-Jones gas in a 2D periodic box with box length L = 14 and n=100 particles. Start them off on a 10x10 grid with Gaussian distributed velocities. Ignore units and assume beta = m = 1. The Hamiltonian is given by H = sum_j m v_j^2/2 + 1/2 sum_{i != j} u_ij^2 - u_ij where u_ij = |x_i - x_j|**-6 The force on each particle, i, is therefore F_i = sum_{j != i} 6 (x_i - x_j) / |x_i - x_j|^2 ( 2 u_ij^2 - u_ij ) 2) Run the simulation for 100 steps, and create a plot showing the locations of the atoms every 10 steps. 3) For every timestep, calculate the kinetic and potential energies. What do you observe about the behavior of the potential energy? 4) Make a plot of the total energy vs. time for your 100 step simulation. Overlay these plots for several different values of the numerical timestep, dt. </pre> Hints: <source lang="python"> # Wrap all coordinates in an array to the range [0,L) print x - L*floor(x/L) # Find the closest distance between two points, r_ij y = x[i] - x[j] print y - L*floor(y/L + 0.5) # Calculate the LJ force on an atom at point z r = closest_distance(z, x) # matrix of closest distances (n x 3) r2 = sum(r*r, 1) # vector of squared distances (n) u = r2**-3 print 6 * sum(r * ((2*u*u - u)/sqrt(r2))[:,newaxis], 0) # sum over other atoms </source> 4a66c410086b41c4974b6e751a15a6a998a5b2c3 517 516 2016-04-18T16:15:47Z David M. Rogers 2 wikitext text/x-wiki Intro. Scientific Computing, HW10 - Due Friday, April 22. <pre> 1) Write a complete code to simulate the Lennard-Jones gas in a 2D periodic box with box length L = 14 and n=100 particles. Start them off on a 10x10 grid with Gaussian distributed velocities. Ignore units and assume beta = m = 1. The Hamiltonian is given by H = sum_j m v_j^2/2 + 1/2 sum_{i != j} u_ij^2 - u_ij where u_ij = |x_i - x_j|**-6 The force on each particle, i, is therefore F_i = sum_{j != i} 6 (x_i - x_j) / |x_i - x_j|^2 ( 2 u_ij^2 - u_ij ) 2) Run the simulation for 100 steps, and create a plot showing the locations of the atoms every 10 steps. 3) For every timestep, calculate the kinetic and potential energies. What do you observe about the behavior of the potential energy? 4) Make a plot of the total energy vs. time for your 100 step simulation. Overlay these plots for several different values of the numerical timestep, dt. </pre> Hints: <source lang="python"> # Wrap all coordinates in an array to the range [0,L) print x - L*floor(x/L) # Find the closest distance between two points, r_ij y = x[i] - x[j] print y - L*floor(y/L + 0.5) # Calculate the LJ force on an atom at point z r = closest_distance(z, x) # matrix of closest distances (n x 3) r2 = sum(r*r, 1) # vector of squared distances (n) u = r2**-3 print 6 * sum(r * ((2*u*u - u)/r2)[:,newaxis], 0) # sum over other atoms </source> 1664d4b1336f541fdcf6f76730482352df82bc8d 518 517 2016-04-18T16:23:01Z David M. Rogers 2 wikitext text/x-wiki Intro. Scientific Computing, HW10 - Due Friday, April 22. <pre> 1) Write a complete code to simulate the Lennard-Jones gas in a 2D periodic box with box length L = 14 and n=100 particles. Start them off on a 10x10 grid with Gaussian distributed velocities. Ignore units and assume beta = m = 1. The Hamiltonian is given by H = sum_j m v_j^2/2 + 1/2 sum_{i != j} u_ij^2 - u_ij where u_ij = |x_i - x_j|**-6 The force on each particle, i, is therefore F_i = sum_{j != i} 6 (x_i - x_j) / |x_i - x_j|^2 ( 2 u_ij^2 - u_ij ) 2) Run the simulation for 100 steps, and create a plot showing the locations of the atoms every 10 steps. 3) For every timestep, calculate the kinetic and potential energies. What do you observe about the behavior of the potential energy? 4) Make a plot of the total energy vs. time for your 100 step simulation. Overlay these plots for several different values of the numerical timestep, dt. </pre> Hints: <source lang="python"> # Wrap all coordinates in an array to the range [0,L) print x - L*floor(x/L) # Find the closest distance between two points, r_ij y = x[i] - x[j] print y - L*floor(y/L + 0.5) # Calculate the LJ force on an atom at point z r = closest_distance(z, x) # matrix of closest distances (n x 3) r2 = sum(r*r, 1) # vector of squared distances (n) u = r2**-3 print 6 * sum(r * ((2*u*u - u)/r2)[:,newaxis], 0) # sum over other atoms </source> A code that allows you to visualize your (steps x atoms x 2) trajectory is shown below: <source lang="python"> #!/usr/bin/env python from numpy import * import matplotlib.animation as anim import pylab as plt dt = 0.01 def show_trj(x, dt): fig = plt.figure() ax = fig.add_subplot(111, autoscale_on=False, xlim=(0.0, 10.0), ylim=(0.0, 10.0)) ax.set_aspect('equal') ax.grid() line, = ax.plot([], [], 'o') template = "time %.1f" time_text = ax.text(0.05, 0.9, '', transform=ax.transAxes) def animate(i): line.set_data(x[i,:,0], x[i,:,1]) time_text.set_text(template % (i*dt)) return line, time_text def init(): line.set_data([], []) time_text.set_text('') return line, time_text ani = anim.FuncAnimation(fig, animate, \ arange(len(x)), interval=25, blit=True, \ init_func=init) plt.show() # Replace this with your actual dynamics code! trj = random.random((100,10,2))*10.0 show_trj(trj, dt) </source> 0527c675c912b9bafb14dc76c11abe3a41771951 CompSciHW9 0 113 513 499 2016-04-13T16:29:53Z David M. Rogers 2 wikitext text/x-wiki Introduction to Scientific Computing, HW 9. Due Friday, Apr. 15, 2016. <pre> 1) Use the van der Pol oscillator class to simulate 60 second (6000 steps) trajectories with 3 initial conditions, x, v = [4, 3], [4, 4], and [4, 5] Here, v = dot x = dx/dt 2) Add a method to calculate the energy of a harmonic oscillator, E(x, v) = (x^2 + v^2)/2 3) Plot E(t) for all 3 simulations on the same axes. Remember to scale t = arange(6000)*dt. 4) Is there a pattern that would let you know when the oscillator is near the steady-state? </pre> Remember, we built the van der Pol integrator on [[CompSciWeek13]]. The complete code is below, <source lang="python"> #!/usr/bin/env python import sys from numpy import * from numpy.random import standard_normal norm = standard_normal class State: def __init__(self, x, v, mu, dt): assert x.shape == v.shape self.mu = mu self.dt = dt self.x = x self.v = v # def step(self, N=1): for i in xrange(N): self.v += (self.mu*(1.0-self.x**2)*self.v - self.x)*self.dt self.x += self.v*self.dt def __str__(self): s = "" for x,v in zip(self.x, self.v): s += " %f %f"%(x, v) return s def main(argv): assert len(argv) == 2, "Usage: %s <mu>"%argv[0] mu = float(argv[1]) print mu dt = 0.01 st = State(array([2.0]), array([0.0]), mu, dt) st.step(10) print st if __name__=="__main__": main(sys.argv) </source> 951d212d41781d60c1c4fe50e8a376da59c913fd CompSciSpring2016 0 85 514 510 2016-04-13T19:02:21Z David M. Rogers 2 /* Homework */ wikitext text/x-wiki '''<BIG>Introduction to Scientific Computing</BIG>''' Course Info * Course Numbers CHM 4932-004/6938-010, CRN: 22347/22348 * Credit Hours: 3 * Meeting Dates: January 22 - April 27, 2016 ** No Class Jan. 18 or Mar. 14-19 * Meeting Times: Mon. and Wed., 12:30-13:45 in SCA 222 ** Lab Session & Office Hours: Fri. 12:30-13:45 in SCA 222 (or SCA 433) == Overview == Mathematical models in the natural sciences take many shapes and forms. The moment they become more complicated than tracking a few variables over time, we have to put away our Excel spreadsheets and make use of a solid foundation in computational science. The course establishes this foundation by introducing data structures and algorithms used in everyday scientific computing using examples in the python scripting language. By the end of the Semester, students will be able to navigate the Linux command-line to go from a mathematical model to a numerical solution. Best practices for working with computer code and visualizing data will also be covered. == Topics == # Languages #* bash (shell) #* python (scripting) #* stack & register-based machine languages: overview of C and Fortran syntax & compiling with gcc, ‘thread safety’ #* Shared libraries & language inter-operability (FFI) # Algorithms #* Horner’s algorithm for polynomials #* Newton’s root finding algo. #* Overview of general optimization algo-s (example: linear & nonlin. least-squares) #* Numerical integration (scripted, plus gnu ODE) #* Communication (how HTTP get/put works) # Data Structures #* Linked Lists #* Trees (file system hierarchies) #* Graphs #* Arrays (dense & sparse) example: vectors & rotations / transpositions, densities and difference operators # Presentation & visualization #* Flat CSV files (and excel) #* Working with binary data #* Python matplotlib (2D images) #* Binning histograms & weighted averages # Best Practices #* High-level code design (modularity, interface specifications, unit testing, etc.) #* Code audit: open-source libraries, ex. Gnu Scientific Library, qsort in libc, Boost #* Source code versioning (example: git or mercurial) #* gdb & execution profiling #* documentation #* Makefiles == Grading == '''Grading Scale (out of 400 points possible)''' {| class="wikitable" |- ! Grade ! Undergraduate ! Graduate |- | A | 230 | 300 |- | B | 180 | 230 |- | C | 150 | 180 |- | D | 120 | 150 |} * Points Possible: ** 10 homework assignments (20 points per homework) ** 2 projects / competitions (100 points per project) * Homework Rules ** For work done in groups, credit is divided equally among participants - so the max homework grade for a group of 2 is 10 points each. ** For each homework, 1 re-do at full credit can be sent at any time after the due date, but must present a unique solution to previous work from yourself or others. ** All work must cite co-group members (if any) and the source of any code snippets used online. === Grading Rationale === Homework points will only be awarded for correct, working code and correct algorithmic analysis, while the homework problems will become progressively tougher. Undergraduates should be able to pass the course with an A if they have correctly answered most of the homework, and made a strong attempt at one of the projects. Graduate students should both perform well on the homework and successfully complete one or two projects. Essentially, this means you should do your own homework when possible and may do a project in a small group. The re-grading and group options for homework allow making up for missed assignments, and encourage returning to core concepts at a later point in the class. Students who have completed significant portions of the homework have thus demonstrated programming proficiency, and are qualified for at least B/C grades. == Projects == === Midterm === A description for the midterm project is now available [[Media:midterm.pdf|here]]. The MD section will be updated as we discuss it in class. The due date for the midterm will be Friday, March 11. === Final === A description for the final project is now available [[Media:final.pdf|here]]. The due date for the final will be Friday, Aoril 29. == Textbooks and Resources == * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-0072-7 Beginning Python, Hetland, 2005] (eBook avail. from USF Library) * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-3238-4 Python Algorithms, Hetland, 2010] (eBook avail. from USF Library) * [http://aosabook.org/en/index.html The Architecture of Open Source Applications] * [http://docs.python.org Python Documentation] * [https://developers.google.com/edu/python/ Google Introductory Python Notes] * [http://huffman.sourceforge.net/tao/tao-of-programming.html Tao of Programming] Other (possibly useful) materials: * [http://hackersdictionary.com/html/entry/larval-stage.html The Jargon File] * Chapters 7&8 of Modelling and Simulation, Birta and Arbez, Springer 2007 (eBook avail. from USF Library). * Chapters 4-6 of Models and Algorithms for Intelligent Data Analysis, Runkler, Springer 2012 (eBook avail. from USF Library). * Guide to Scientific Computing in C++, Francis and Whiteley, Springer, 2012. (eBook avail. from USF Library) * Extra info. On the basics: ** Chapters 3 and 7 of Mathematics in Computing, Regan, Springer 2013. (eBook avail. from USF Library) ** Instant feedback graphical programming with [https://www.khanacademy.org/cs/programming/ Khan Academy] * [http://www.meetup.com/python-178/ Local PyBulls Meetings] Code: * [http://carsonfarmer.com/2013/07/essential-python-geo-libraries Python Libraries Useful for Geospatial Problems] * [[Code#Python_Libraries|Python Libraries Useful for Computational Chemistry]] (very small list at present) Interactive Interpreters: * [http://www.codewars.com CodeWars] Recommended for building experience with practice problems. * [http://codecombat.com/ CodeCombat] A very visual way to interact with your python code. * [http://exercism.io Exercism] A command-line client with a similar learn-through-challenge philosophy. * [http://repl.it repl.it] A read-eval-print loop for several computer languages. * [http://en.cppreference.com/w/cpp/language CppReference] Documentation with an online evaluator for C++ code. === Notes === * [[Media:intro.pdf|Notes]] for Week 1 ** Over the first two weeks or so, we'll be practicing the basics - so read through Chapters 1-3 of Hetland's Beginning Python during this time. ** [[PythonTranslated|Important Definitions]] * [[Media:Week2.pdf|Notes]] for Week 2 ** [[Code:Oware|Oware code]] ** Solutions for some problems in Week 2's notes: <source lang="python"> # simple data types "a string" # : str x = [1, 2, 3] # : [int] # compound data type (1, "name", (x, x)) # : (int, str, ([int], [int])) # add_one : int -> int # str.__add__ : str -> str -> str # str.split : str -> [str] # str.__mod__ : str -> (Objects) -> str </source> * [[Media:Week3.pdf|Notes]] for Week 3-4 ** Reading assignment - read through Chapter 5 and 6 (and practice dictionaries from Ch. 4) ** [[Code:for_patterns|Abstracting patterns]] in for loops. * [[Media:Week5.pdf|Notes]] for Week 5-6 ** Reading assignment - Read Chapter 10-11 (and refer to Ch. 4) * By this point, we've covered all the basics: ** base types: str, int, float, [a] ** variables and substitution: j vs "4" vs 4 ** indexing and slicing into lists / strings: x[1:4] or x[i:j] ** control flow: if and for syntax ** functions implementing patterns: def next(r, x): return r*x*(1-x) * You should be able to use these for: ** finding and abstracting the pattern ** naming the type of a function ** determining which variable names are in scope * All that's left is learning common uses, patterns and even more syntax! * [[Media:Week7-8.pdf|Notes]] for Week 7-8 * [[Media:Week9-10.pdf|Notes]] for Week 9-10 * [[Media:Week11.pdf|Notes]] for Week 11 * [[Media:Week12.pdf|Notes]] for Week 12 * [[Media:Week13.pdf|Notes]] for Week 13 * In-Class Examples * [[Gorillaz Code]] * [[File:Wat3-ccsd.txt]] Output of Multiwfn for a Na+(H20)_3 molecular cluster. * [[File:water_rdf.txt]] Water center of mass radial distribution function. === Homework === * [[CompSciHW1|Homework 1]] is due Monday, January 25. * [[CompSciHW2|Homework 2]] is due Monday, February 8. * [[CompSciHW3|Homework 3]] is due Friday, February 19. * [[CompSciHW4|Homework 4]] is due Friday, February 26. * [[CompSciHW5|Homework 5]] is due Friday, March 4. * [[CompSciHW6|Homework 6]] is due Wednesday, March 30. * [[CompSciHW7|Homework 7]] is due Friday, April 1. * [[CompSciHW8|Homework 8]] is due Friday, April 8. * [[CompSciHW9|Homework 9]] is due Friday, April 15. * [[CompSciHW10|Homework 10]] is due Friday, April 22. == Group Work Pages == Group 1 [https://docs.google.com/document/d/1k6vruCx78aV0pL8Kw7WWtsw_-6zgdoeP0OvujSzbsh0/edit?usp=sharing]: Group 2 [https://docs.google.com/document/d/1MgpVly2D1h9Xt_lFh5ywa3b70Ul9ES6OQZtg5l_n0NM/edit?usp=sharing] Group 3 [https://docs.google.com/document/d/1LT_J-vObN9tPa1JoQ1B_h04ENsL5Ko2xeFeRMp-99f8/edit?usp=sharing] Group 4 [https://docs.google.com/document/d/1hGlNlg1w7_3qCo6LE-y9rSZx1Chwc0FBUoxK6cyzWW8/edit?usp=sharing] * [[Code:Vectors|Interactive Vector Example]] d48a2fea105ca44e577b6138be0435fe04bfe886 515 514 2016-04-18T16:06:21Z David M. Rogers 2 /* Final */ wikitext text/x-wiki '''<BIG>Introduction to Scientific Computing</BIG>''' Course Info * Course Numbers CHM 4932-004/6938-010, CRN: 22347/22348 * Credit Hours: 3 * Meeting Dates: January 22 - April 27, 2016 ** No Class Jan. 18 or Mar. 14-19 * Meeting Times: Mon. and Wed., 12:30-13:45 in SCA 222 ** Lab Session & Office Hours: Fri. 12:30-13:45 in SCA 222 (or SCA 433) == Overview == Mathematical models in the natural sciences take many shapes and forms. The moment they become more complicated than tracking a few variables over time, we have to put away our Excel spreadsheets and make use of a solid foundation in computational science. The course establishes this foundation by introducing data structures and algorithms used in everyday scientific computing using examples in the python scripting language. By the end of the Semester, students will be able to navigate the Linux command-line to go from a mathematical model to a numerical solution. Best practices for working with computer code and visualizing data will also be covered. == Topics == # Languages #* bash (shell) #* python (scripting) #* stack & register-based machine languages: overview of C and Fortran syntax & compiling with gcc, ‘thread safety’ #* Shared libraries & language inter-operability (FFI) # Algorithms #* Horner’s algorithm for polynomials #* Newton’s root finding algo. #* Overview of general optimization algo-s (example: linear & nonlin. least-squares) #* Numerical integration (scripted, plus gnu ODE) #* Communication (how HTTP get/put works) # Data Structures #* Linked Lists #* Trees (file system hierarchies) #* Graphs #* Arrays (dense & sparse) example: vectors & rotations / transpositions, densities and difference operators # Presentation & visualization #* Flat CSV files (and excel) #* Working with binary data #* Python matplotlib (2D images) #* Binning histograms & weighted averages # Best Practices #* High-level code design (modularity, interface specifications, unit testing, etc.) #* Code audit: open-source libraries, ex. Gnu Scientific Library, qsort in libc, Boost #* Source code versioning (example: git or mercurial) #* gdb & execution profiling #* documentation #* Makefiles == Grading == '''Grading Scale (out of 400 points possible)''' {| class="wikitable" |- ! Grade ! Undergraduate ! Graduate |- | A | 230 | 300 |- | B | 180 | 230 |- | C | 150 | 180 |- | D | 120 | 150 |} * Points Possible: ** 10 homework assignments (20 points per homework) ** 2 projects / competitions (100 points per project) * Homework Rules ** For work done in groups, credit is divided equally among participants - so the max homework grade for a group of 2 is 10 points each. ** For each homework, 1 re-do at full credit can be sent at any time after the due date, but must present a unique solution to previous work from yourself or others. ** All work must cite co-group members (if any) and the source of any code snippets used online. === Grading Rationale === Homework points will only be awarded for correct, working code and correct algorithmic analysis, while the homework problems will become progressively tougher. Undergraduates should be able to pass the course with an A if they have correctly answered most of the homework, and made a strong attempt at one of the projects. Graduate students should both perform well on the homework and successfully complete one or two projects. Essentially, this means you should do your own homework when possible and may do a project in a small group. The re-grading and group options for homework allow making up for missed assignments, and encourage returning to core concepts at a later point in the class. Students who have completed significant portions of the homework have thus demonstrated programming proficiency, and are qualified for at least B/C grades. == Projects == === Midterm === A description for the midterm project is now available [[Media:midterm.pdf|here]]. The MD section will be updated as we discuss it in class. The due date for the midterm will be Friday, March 11. === Final === A description for the final project is now available [[Media:final.pdf|here]]. The due date for the final will be Friday, April 29. == Textbooks and Resources == * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-0072-7 Beginning Python, Hetland, 2005] (eBook avail. from USF Library) * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-3238-4 Python Algorithms, Hetland, 2010] (eBook avail. from USF Library) * [http://aosabook.org/en/index.html The Architecture of Open Source Applications] * [http://docs.python.org Python Documentation] * [https://developers.google.com/edu/python/ Google Introductory Python Notes] * [http://huffman.sourceforge.net/tao/tao-of-programming.html Tao of Programming] Other (possibly useful) materials: * [http://hackersdictionary.com/html/entry/larval-stage.html The Jargon File] * Chapters 7&8 of Modelling and Simulation, Birta and Arbez, Springer 2007 (eBook avail. from USF Library). * Chapters 4-6 of Models and Algorithms for Intelligent Data Analysis, Runkler, Springer 2012 (eBook avail. from USF Library). * Guide to Scientific Computing in C++, Francis and Whiteley, Springer, 2012. (eBook avail. from USF Library) * Extra info. On the basics: ** Chapters 3 and 7 of Mathematics in Computing, Regan, Springer 2013. (eBook avail. from USF Library) ** Instant feedback graphical programming with [https://www.khanacademy.org/cs/programming/ Khan Academy] * [http://www.meetup.com/python-178/ Local PyBulls Meetings] Code: * [http://carsonfarmer.com/2013/07/essential-python-geo-libraries Python Libraries Useful for Geospatial Problems] * [[Code#Python_Libraries|Python Libraries Useful for Computational Chemistry]] (very small list at present) Interactive Interpreters: * [http://www.codewars.com CodeWars] Recommended for building experience with practice problems. * [http://codecombat.com/ CodeCombat] A very visual way to interact with your python code. * [http://exercism.io Exercism] A command-line client with a similar learn-through-challenge philosophy. * [http://repl.it repl.it] A read-eval-print loop for several computer languages. * [http://en.cppreference.com/w/cpp/language CppReference] Documentation with an online evaluator for C++ code. === Notes === * [[Media:intro.pdf|Notes]] for Week 1 ** Over the first two weeks or so, we'll be practicing the basics - so read through Chapters 1-3 of Hetland's Beginning Python during this time. ** [[PythonTranslated|Important Definitions]] * [[Media:Week2.pdf|Notes]] for Week 2 ** [[Code:Oware|Oware code]] ** Solutions for some problems in Week 2's notes: <source lang="python"> # simple data types "a string" # : str x = [1, 2, 3] # : [int] # compound data type (1, "name", (x, x)) # : (int, str, ([int], [int])) # add_one : int -> int # str.__add__ : str -> str -> str # str.split : str -> [str] # str.__mod__ : str -> (Objects) -> str </source> * [[Media:Week3.pdf|Notes]] for Week 3-4 ** Reading assignment - read through Chapter 5 and 6 (and practice dictionaries from Ch. 4) ** [[Code:for_patterns|Abstracting patterns]] in for loops. * [[Media:Week5.pdf|Notes]] for Week 5-6 ** Reading assignment - Read Chapter 10-11 (and refer to Ch. 4) * By this point, we've covered all the basics: ** base types: str, int, float, [a] ** variables and substitution: j vs "4" vs 4 ** indexing and slicing into lists / strings: x[1:4] or x[i:j] ** control flow: if and for syntax ** functions implementing patterns: def next(r, x): return r*x*(1-x) * You should be able to use these for: ** finding and abstracting the pattern ** naming the type of a function ** determining which variable names are in scope * All that's left is learning common uses, patterns and even more syntax! * [[Media:Week7-8.pdf|Notes]] for Week 7-8 * [[Media:Week9-10.pdf|Notes]] for Week 9-10 * [[Media:Week11.pdf|Notes]] for Week 11 * [[Media:Week12.pdf|Notes]] for Week 12 * [[Media:Week13.pdf|Notes]] for Week 13 * In-Class Examples * [[Gorillaz Code]] * [[File:Wat3-ccsd.txt]] Output of Multiwfn for a Na+(H20)_3 molecular cluster. * [[File:water_rdf.txt]] Water center of mass radial distribution function. === Homework === * [[CompSciHW1|Homework 1]] is due Monday, January 25. * [[CompSciHW2|Homework 2]] is due Monday, February 8. * [[CompSciHW3|Homework 3]] is due Friday, February 19. * [[CompSciHW4|Homework 4]] is due Friday, February 26. * [[CompSciHW5|Homework 5]] is due Friday, March 4. * [[CompSciHW6|Homework 6]] is due Wednesday, March 30. * [[CompSciHW7|Homework 7]] is due Friday, April 1. * [[CompSciHW8|Homework 8]] is due Friday, April 8. * [[CompSciHW9|Homework 9]] is due Friday, April 15. * [[CompSciHW10|Homework 10]] is due Friday, April 22. == Group Work Pages == Group 1 [https://docs.google.com/document/d/1k6vruCx78aV0pL8Kw7WWtsw_-6zgdoeP0OvujSzbsh0/edit?usp=sharing]: Group 2 [https://docs.google.com/document/d/1MgpVly2D1h9Xt_lFh5ywa3b70Ul9ES6OQZtg5l_n0NM/edit?usp=sharing] Group 3 [https://docs.google.com/document/d/1LT_J-vObN9tPa1JoQ1B_h04ENsL5Ko2xeFeRMp-99f8/edit?usp=sharing] Group 4 [https://docs.google.com/document/d/1hGlNlg1w7_3qCo6LE-y9rSZx1Chwc0FBUoxK6cyzWW8/edit?usp=sharing] * [[Code:Vectors|Interactive Vector Example]] 5ec7233ef25f3dbb0dd67f9f33ff030b43b8e9d9 519 515 2016-04-20T15:15:05Z David M. Rogers 2 /* Notes */ wikitext text/x-wiki '''<BIG>Introduction to Scientific Computing</BIG>''' Course Info * Course Numbers CHM 4932-004/6938-010, CRN: 22347/22348 * Credit Hours: 3 * Meeting Dates: January 22 - April 27, 2016 ** No Class Jan. 18 or Mar. 14-19 * Meeting Times: Mon. and Wed., 12:30-13:45 in SCA 222 ** Lab Session & Office Hours: Fri. 12:30-13:45 in SCA 222 (or SCA 433) == Overview == Mathematical models in the natural sciences take many shapes and forms. The moment they become more complicated than tracking a few variables over time, we have to put away our Excel spreadsheets and make use of a solid foundation in computational science. The course establishes this foundation by introducing data structures and algorithms used in everyday scientific computing using examples in the python scripting language. By the end of the Semester, students will be able to navigate the Linux command-line to go from a mathematical model to a numerical solution. Best practices for working with computer code and visualizing data will also be covered. == Topics == # Languages #* bash (shell) #* python (scripting) #* stack & register-based machine languages: overview of C and Fortran syntax & compiling with gcc, ‘thread safety’ #* Shared libraries & language inter-operability (FFI) # Algorithms #* Horner’s algorithm for polynomials #* Newton’s root finding algo. #* Overview of general optimization algo-s (example: linear & nonlin. least-squares) #* Numerical integration (scripted, plus gnu ODE) #* Communication (how HTTP get/put works) # Data Structures #* Linked Lists #* Trees (file system hierarchies) #* Graphs #* Arrays (dense & sparse) example: vectors & rotations / transpositions, densities and difference operators # Presentation & visualization #* Flat CSV files (and excel) #* Working with binary data #* Python matplotlib (2D images) #* Binning histograms & weighted averages # Best Practices #* High-level code design (modularity, interface specifications, unit testing, etc.) #* Code audit: open-source libraries, ex. Gnu Scientific Library, qsort in libc, Boost #* Source code versioning (example: git or mercurial) #* gdb & execution profiling #* documentation #* Makefiles == Grading == '''Grading Scale (out of 400 points possible)''' {| class="wikitable" |- ! Grade ! Undergraduate ! Graduate |- | A | 230 | 300 |- | B | 180 | 230 |- | C | 150 | 180 |- | D | 120 | 150 |} * Points Possible: ** 10 homework assignments (20 points per homework) ** 2 projects / competitions (100 points per project) * Homework Rules ** For work done in groups, credit is divided equally among participants - so the max homework grade for a group of 2 is 10 points each. ** For each homework, 1 re-do at full credit can be sent at any time after the due date, but must present a unique solution to previous work from yourself or others. ** All work must cite co-group members (if any) and the source of any code snippets used online. === Grading Rationale === Homework points will only be awarded for correct, working code and correct algorithmic analysis, while the homework problems will become progressively tougher. Undergraduates should be able to pass the course with an A if they have correctly answered most of the homework, and made a strong attempt at one of the projects. Graduate students should both perform well on the homework and successfully complete one or two projects. Essentially, this means you should do your own homework when possible and may do a project in a small group. The re-grading and group options for homework allow making up for missed assignments, and encourage returning to core concepts at a later point in the class. Students who have completed significant portions of the homework have thus demonstrated programming proficiency, and are qualified for at least B/C grades. == Projects == === Midterm === A description for the midterm project is now available [[Media:midterm.pdf|here]]. The MD section will be updated as we discuss it in class. The due date for the midterm will be Friday, March 11. === Final === A description for the final project is now available [[Media:final.pdf|here]]. The due date for the final will be Friday, April 29. == Textbooks and Resources == * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-0072-7 Beginning Python, Hetland, 2005] (eBook avail. from USF Library) * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-3238-4 Python Algorithms, Hetland, 2010] (eBook avail. from USF Library) * [http://aosabook.org/en/index.html The Architecture of Open Source Applications] * [http://docs.python.org Python Documentation] * [https://developers.google.com/edu/python/ Google Introductory Python Notes] * [http://huffman.sourceforge.net/tao/tao-of-programming.html Tao of Programming] Other (possibly useful) materials: * [http://hackersdictionary.com/html/entry/larval-stage.html The Jargon File] * Chapters 7&8 of Modelling and Simulation, Birta and Arbez, Springer 2007 (eBook avail. from USF Library). * Chapters 4-6 of Models and Algorithms for Intelligent Data Analysis, Runkler, Springer 2012 (eBook avail. from USF Library). * Guide to Scientific Computing in C++, Francis and Whiteley, Springer, 2012. (eBook avail. from USF Library) * Extra info. On the basics: ** Chapters 3 and 7 of Mathematics in Computing, Regan, Springer 2013. (eBook avail. from USF Library) ** Instant feedback graphical programming with [https://www.khanacademy.org/cs/programming/ Khan Academy] * [http://www.meetup.com/python-178/ Local PyBulls Meetings] Code: * [http://carsonfarmer.com/2013/07/essential-python-geo-libraries Python Libraries Useful for Geospatial Problems] * [[Code#Python_Libraries|Python Libraries Useful for Computational Chemistry]] (very small list at present) Interactive Interpreters: * [http://www.codewars.com CodeWars] Recommended for building experience with practice problems. * [http://codecombat.com/ CodeCombat] A very visual way to interact with your python code. * [http://exercism.io Exercism] A command-line client with a similar learn-through-challenge philosophy. * [http://repl.it repl.it] A read-eval-print loop for several computer languages. * [http://en.cppreference.com/w/cpp/language CppReference] Documentation with an online evaluator for C++ code. === Notes === * [[Media:intro.pdf|Notes]] for Week 1 ** Over the first two weeks or so, we'll be practicing the basics - so read through Chapters 1-3 of Hetland's Beginning Python during this time. ** [[PythonTranslated|Important Definitions]] * [[Media:Week2.pdf|Notes]] for Week 2 ** [[Code:Oware|Oware code]] ** Solutions for some problems in Week 2's notes: <source lang="python"> # simple data types "a string" # : str x = [1, 2, 3] # : [int] # compound data type (1, "name", (x, x)) # : (int, str, ([int], [int])) # add_one : int -> int # str.__add__ : str -> str -> str # str.split : str -> [str] # str.__mod__ : str -> (Objects) -> str </source> * [[Media:Week3.pdf|Notes]] for Week 3-4 ** Reading assignment - read through Chapter 5 and 6 (and practice dictionaries from Ch. 4) ** [[Code:for_patterns|Abstracting patterns]] in for loops. * [[Media:Week5.pdf|Notes]] for Week 5-6 ** Reading assignment - Read Chapter 10-11 (and refer to Ch. 4) * By this point, we've covered all the basics: ** base types: str, int, float, [a] ** variables and substitution: j vs "4" vs 4 ** indexing and slicing into lists / strings: x[1:4] or x[i:j] ** control flow: if and for syntax ** functions implementing patterns: def next(r, x): return r*x*(1-x) * You should be able to use these for: ** finding and abstracting the pattern ** naming the type of a function ** determining which variable names are in scope * All that's left is learning common uses, patterns and even more syntax! * [[Media:Week7-8.pdf|Notes]] for Week 7-8 * [[Media:Week9-10.pdf|Notes]] for Week 9-10 * [[Media:Week11.pdf|Notes]] for Week 11 * [[Media:Week12.pdf|Notes]] for Week 12 * [[Media:Week13.pdf|Notes]] for Week 13 * [[Media:Week14.pdf|Notes]] for Week 14 * In-Class Examples * [[Gorillaz Code]] * [[File:Wat3-ccsd.txt]] Output of Multiwfn for a Na+(H20)_3 molecular cluster. * [[File:water_rdf.txt]] Water center of mass radial distribution function. === Homework === * [[CompSciHW1|Homework 1]] is due Monday, January 25. * [[CompSciHW2|Homework 2]] is due Monday, February 8. * [[CompSciHW3|Homework 3]] is due Friday, February 19. * [[CompSciHW4|Homework 4]] is due Friday, February 26. * [[CompSciHW5|Homework 5]] is due Friday, March 4. * [[CompSciHW6|Homework 6]] is due Wednesday, March 30. * [[CompSciHW7|Homework 7]] is due Friday, April 1. * [[CompSciHW8|Homework 8]] is due Friday, April 8. * [[CompSciHW9|Homework 9]] is due Friday, April 15. * [[CompSciHW10|Homework 10]] is due Friday, April 22. == Group Work Pages == Group 1 [https://docs.google.com/document/d/1k6vruCx78aV0pL8Kw7WWtsw_-6zgdoeP0OvujSzbsh0/edit?usp=sharing]: Group 2 [https://docs.google.com/document/d/1MgpVly2D1h9Xt_lFh5ywa3b70Ul9ES6OQZtg5l_n0NM/edit?usp=sharing] Group 3 [https://docs.google.com/document/d/1LT_J-vObN9tPa1JoQ1B_h04ENsL5Ko2xeFeRMp-99f8/edit?usp=sharing] Group 4 [https://docs.google.com/document/d/1hGlNlg1w7_3qCo6LE-y9rSZx1Chwc0FBUoxK6cyzWW8/edit?usp=sharing] * [[Code:Vectors|Interactive Vector Example]] eab747198265a9dc6b6af24be85ac18990955b1a 522 519 2016-04-27T15:56:54Z David M. Rogers 2 /* Notes */ wikitext text/x-wiki '''<BIG>Introduction to Scientific Computing</BIG>''' Course Info * Course Numbers CHM 4932-004/6938-010, CRN: 22347/22348 * Credit Hours: 3 * Meeting Dates: January 22 - April 27, 2016 ** No Class Jan. 18 or Mar. 14-19 * Meeting Times: Mon. and Wed., 12:30-13:45 in SCA 222 ** Lab Session & Office Hours: Fri. 12:30-13:45 in SCA 222 (or SCA 433) == Overview == Mathematical models in the natural sciences take many shapes and forms. The moment they become more complicated than tracking a few variables over time, we have to put away our Excel spreadsheets and make use of a solid foundation in computational science. The course establishes this foundation by introducing data structures and algorithms used in everyday scientific computing using examples in the python scripting language. By the end of the Semester, students will be able to navigate the Linux command-line to go from a mathematical model to a numerical solution. Best practices for working with computer code and visualizing data will also be covered. == Topics == # Languages #* bash (shell) #* python (scripting) #* stack & register-based machine languages: overview of C and Fortran syntax & compiling with gcc, ‘thread safety’ #* Shared libraries & language inter-operability (FFI) # Algorithms #* Horner’s algorithm for polynomials #* Newton’s root finding algo. #* Overview of general optimization algo-s (example: linear & nonlin. least-squares) #* Numerical integration (scripted, plus gnu ODE) #* Communication (how HTTP get/put works) # Data Structures #* Linked Lists #* Trees (file system hierarchies) #* Graphs #* Arrays (dense & sparse) example: vectors & rotations / transpositions, densities and difference operators # Presentation & visualization #* Flat CSV files (and excel) #* Working with binary data #* Python matplotlib (2D images) #* Binning histograms & weighted averages # Best Practices #* High-level code design (modularity, interface specifications, unit testing, etc.) #* Code audit: open-source libraries, ex. Gnu Scientific Library, qsort in libc, Boost #* Source code versioning (example: git or mercurial) #* gdb & execution profiling #* documentation #* Makefiles == Grading == '''Grading Scale (out of 400 points possible)''' {| class="wikitable" |- ! Grade ! Undergraduate ! Graduate |- | A | 230 | 300 |- | B | 180 | 230 |- | C | 150 | 180 |- | D | 120 | 150 |} * Points Possible: ** 10 homework assignments (20 points per homework) ** 2 projects / competitions (100 points per project) * Homework Rules ** For work done in groups, credit is divided equally among participants - so the max homework grade for a group of 2 is 10 points each. ** For each homework, 1 re-do at full credit can be sent at any time after the due date, but must present a unique solution to previous work from yourself or others. ** All work must cite co-group members (if any) and the source of any code snippets used online. === Grading Rationale === Homework points will only be awarded for correct, working code and correct algorithmic analysis, while the homework problems will become progressively tougher. Undergraduates should be able to pass the course with an A if they have correctly answered most of the homework, and made a strong attempt at one of the projects. Graduate students should both perform well on the homework and successfully complete one or two projects. Essentially, this means you should do your own homework when possible and may do a project in a small group. The re-grading and group options for homework allow making up for missed assignments, and encourage returning to core concepts at a later point in the class. Students who have completed significant portions of the homework have thus demonstrated programming proficiency, and are qualified for at least B/C grades. == Projects == === Midterm === A description for the midterm project is now available [[Media:midterm.pdf|here]]. The MD section will be updated as we discuss it in class. The due date for the midterm will be Friday, March 11. === Final === A description for the final project is now available [[Media:final.pdf|here]]. The due date for the final will be Friday, April 29. == Textbooks and Resources == * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-0072-7 Beginning Python, Hetland, 2005] (eBook avail. from USF Library) * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-3238-4 Python Algorithms, Hetland, 2010] (eBook avail. from USF Library) * [http://aosabook.org/en/index.html The Architecture of Open Source Applications] * [http://docs.python.org Python Documentation] * [https://developers.google.com/edu/python/ Google Introductory Python Notes] * [http://huffman.sourceforge.net/tao/tao-of-programming.html Tao of Programming] Other (possibly useful) materials: * [http://hackersdictionary.com/html/entry/larval-stage.html The Jargon File] * Chapters 7&8 of Modelling and Simulation, Birta and Arbez, Springer 2007 (eBook avail. from USF Library). * Chapters 4-6 of Models and Algorithms for Intelligent Data Analysis, Runkler, Springer 2012 (eBook avail. from USF Library). * Guide to Scientific Computing in C++, Francis and Whiteley, Springer, 2012. (eBook avail. from USF Library) * Extra info. On the basics: ** Chapters 3 and 7 of Mathematics in Computing, Regan, Springer 2013. (eBook avail. from USF Library) ** Instant feedback graphical programming with [https://www.khanacademy.org/cs/programming/ Khan Academy] * [http://www.meetup.com/python-178/ Local PyBulls Meetings] Code: * [http://carsonfarmer.com/2013/07/essential-python-geo-libraries Python Libraries Useful for Geospatial Problems] * [[Code#Python_Libraries|Python Libraries Useful for Computational Chemistry]] (very small list at present) Interactive Interpreters: * [http://www.codewars.com CodeWars] Recommended for building experience with practice problems. * [http://codecombat.com/ CodeCombat] A very visual way to interact with your python code. * [http://exercism.io Exercism] A command-line client with a similar learn-through-challenge philosophy. * [http://repl.it repl.it] A read-eval-print loop for several computer languages. * [http://en.cppreference.com/w/cpp/language CppReference] Documentation with an online evaluator for C++ code. === Notes === * [[Media:intro.pdf|Notes]] for Week 1 ** Over the first two weeks or so, we'll be practicing the basics - so read through Chapters 1-3 of Hetland's Beginning Python during this time. ** [[PythonTranslated|Important Definitions]] * [[Media:Week2.pdf|Notes]] for Week 2 ** [[Code:Oware|Oware code]] ** Solutions for some problems in Week 2's notes: <source lang="python"> # simple data types "a string" # : str x = [1, 2, 3] # : [int] # compound data type (1, "name", (x, x)) # : (int, str, ([int], [int])) # add_one : int -> int # str.__add__ : str -> str -> str # str.split : str -> [str] # str.__mod__ : str -> (Objects) -> str </source> * [[Media:Week3.pdf|Notes]] for Week 3-4 ** Reading assignment - read through Chapter 5 and 6 (and practice dictionaries from Ch. 4) ** [[Code:for_patterns|Abstracting patterns]] in for loops. * [[Media:Week5.pdf|Notes]] for Week 5-6 ** Reading assignment - Read Chapter 10-11 (and refer to Ch. 4) * By this point, we've covered all the basics: ** base types: str, int, float, [a] ** variables and substitution: j vs "4" vs 4 ** indexing and slicing into lists / strings: x[1:4] or x[i:j] ** control flow: if and for syntax ** functions implementing patterns: def next(r, x): return r*x*(1-x) * You should be able to use these for: ** finding and abstracting the pattern ** naming the type of a function ** determining which variable names are in scope * All that's left is learning common uses, patterns and even more syntax! * [[Media:Week7-8.pdf|Notes]] for Week 7-8 * [[Media:Week9-10.pdf|Notes]] for Week 9-10 * [[Media:Week11.pdf|Notes]] for Week 11 * [[Media:Week12.pdf|Notes]] for Week 12 * [[Media:Week13.pdf|Notes]] for Week 13 * [[Media:Week14.pdf|Notes]] for Week 14 * [[Media:Week15.pdf|Notes]] for Week 15 * In-Class Examples * [[Gorillaz Code]] * [[File:Wat3-ccsd.txt]] Output of Multiwfn for a Na+(H20)_3 molecular cluster. * [[File:water_rdf.txt]] Water center of mass radial distribution function. === Homework === * [[CompSciHW1|Homework 1]] is due Monday, January 25. * [[CompSciHW2|Homework 2]] is due Monday, February 8. * [[CompSciHW3|Homework 3]] is due Friday, February 19. * [[CompSciHW4|Homework 4]] is due Friday, February 26. * [[CompSciHW5|Homework 5]] is due Friday, March 4. * [[CompSciHW6|Homework 6]] is due Wednesday, March 30. * [[CompSciHW7|Homework 7]] is due Friday, April 1. * [[CompSciHW8|Homework 8]] is due Friday, April 8. * [[CompSciHW9|Homework 9]] is due Friday, April 15. * [[CompSciHW10|Homework 10]] is due Friday, April 22. == Group Work Pages == Group 1 [https://docs.google.com/document/d/1k6vruCx78aV0pL8Kw7WWtsw_-6zgdoeP0OvujSzbsh0/edit?usp=sharing]: Group 2 [https://docs.google.com/document/d/1MgpVly2D1h9Xt_lFh5ywa3b70Ul9ES6OQZtg5l_n0NM/edit?usp=sharing] Group 3 [https://docs.google.com/document/d/1LT_J-vObN9tPa1JoQ1B_h04ENsL5Ko2xeFeRMp-99f8/edit?usp=sharing] Group 4 [https://docs.google.com/document/d/1hGlNlg1w7_3qCo6LE-y9rSZx1Chwc0FBUoxK6cyzWW8/edit?usp=sharing] * [[Code:Vectors|Interactive Vector Example]] b8dd7b6adb1d6f0d758de77b198ed3d80125c17c File:Week14.pdf 6 118 520 2016-04-20T15:15:22Z David M. Rogers 2 wikitext text/x-wiki da39a3ee5e6b4b0d3255bfef95601890afd80709 Main Page 0 9 521 74 2016-04-21T16:53:15Z David M. Rogers 2 wikitext text/x-wiki Welcome to the David M. Rogers' research group in Multiscale Chemical Physics at the University of South Florida! We are actively defining and understanding new physics at the nanoscale - where surface interactions are omnipresent, gravity is negligible, and it's really hard to carry any forward momentum. For more details, see the [[Research]] and [[Publications]] links. We have '''guaranteed, paid''' [[positions available|Graduate Research Assistantships]] for talented and inquisitive Undergraduate and Graduate Research assistants who want to learn about and make fundamental, lasting contributions to the central science! d7fe961ba7554e6abb483edaed240143b2413dda File:Week15.pdf 6 119 523 2016-04-27T15:57:36Z David M. Rogers 2 wikitext text/x-wiki da39a3ee5e6b4b0d3255bfef95601890afd80709 Publications 0 8 524 401 2016-07-28T20:40:47Z David M. Rogers 2 wikitext text/x-wiki {| cellpadding="4" style="border: 1px solid darkgray;" |- style="border: 1px solid darkgray;" || David M. Rogers, "Overcoming the Minimum Image Constraint Using the Closest Point Search." [http://dx.doi.org/10.1016/j.jmgm.2016.07.004 J. Mol. Graph. Model (in press), pp. 197-205, 2016.] An elegant solution to the problem of finding periodic images in non-rectangular lattices is provided based on the closest vector problem. Related code is here: [https://github.com/frobnitzem/pbctools] |- style="border: 1px solid darkgray;" || Elisa La Bauve, Briana C. Vernon, Dongmei Ye, David M. Rogers, Cathryn M. Siegrist, Bryan Carson. Susan L. Rempe, Aihua Zheng, Margaret C. Kielian, Andrew P. Shreve, and Michael S. Kent. "Method for measuring the unbinding energy of strongly-bound membrane-associated proteins." [http://dx.doi.org/10.1016/j.bbamem.2016.07.004 BBA Biomembranes in press, 2016.] This paper gives multiple experimental measurements of binding energy between the Dengue virus envelope protein and host membranes that largely confirm our computational predictions from 2015. I contributed all the theory for terminal velocity during sedimentation, along with a novel kinetic analysis providing the free energy and enthalpy of the dissociation barrier (all the details are at the end of the appendix). |- style="border: 1px solid darkgray;" || David M. Rogers. "The EPR Paradox Implies A Minimum Achievable Temperature." [http://arxiv.org/abs/1602.08291 arXiv:1602.08291 submitted, 2016]. This work provides measurement-based definitions for work and heat -- delivering a new foundation for studying open quantum systems. The first and second laws are proved despite the fact that temperature is treated completely as as a property of the interacting reservoir. Going back to the EPR paradox, the work exchanged between two quantum systems is not defined until a measurement is performed. We show that, because of the measurement, even an environment at absolute zero cannot lower a system's temperature below a minimum characteristic of the actual interaction. |- style="border: 1px solid darkgray;" || David M. Rogers. "Thermodynamics of Maximum Transition Entropy for Quantum Assemblies." [http://arxiv.org/abs/1503.01232 arXiv:1503.01232 submitted, 2016]. The work presents a new, general, theoretical foundation for the dynamics of open quantum systems modeled on the maximum entropy derivation of equilibrium statistical mechanics. Computational results are presented for three detailed systems to validate and reinforce the theory. It represents a significant advancement for the field, as it lucidly connects the dynamics of a single wavefunction plus environmental noise to the Caldeira-Leggett model for density matrices. |- style="border: 1px solid darkgray;" || Andriy Anishkin, Juan M. Vanegas, David M. Rogers, Philip L. Lorenzi, Wai Kin Chan, Preeti Purwaha, John N. Weinstein, Sergei Sukharev, and Susan B. Rempe. "Catalytic Role of the Substrate Defines Specificity of Therapeutic L-Asparaginase." [http://dx.doi.org/10.1016/j.jmb.2015.06.017 J. Mol. Biol. 427:2867-2885, 2015]. We present an explanation for the (until now controversial) catalytic mechanism of type 2 bacterial L-asparaginase enzymes. By using the carboxylic acid of the substrate (asparagine) as the proton acceptor, this enzyme is able to preferentially carry out deamidation on asparagine more quickly than for the competing substrate, glutamine. The hypothesis, re-discovered from our MD simulations, was first put forward years ago in contested experimental studies, and now finds additional support from our MD and QM calculations. |- style="border: 1px solid darkgray;" || David M. Rogers. "Towards a Direct, By-Need Evaluator for Dependently Typed Languages." [http://arxiv.org/abs/1509.07036 arXiv:1509.07036 submitted, 2015]. This paper describes the implementation of a new interpreted language for distributed parallel computing. It achieves its goal by maintaining pure functional semantics, allowing all terms in the language to be partially evaluated and serialized to network storage at any point during computation. |- style="border: 1px solid darkgray;" || Marielle Soniat, David M. Rogers, and Susan Rempe. "Dispersion- and Exchange-Corrected Density Functional Theory for Sodium Ion Hydration." [http://pubs.acs.org/doi/abs/10.1021/acs.jctc.5b00357 J. Chem. Theory. Comput. 142:074101, 2015]. We studied the influence of dispersion energy corrections on the free energy of formation for sodium-water clusters computed with DFT and wound up discovering that dispersion and split-range exchange functionals can somewhat counter-balance each other. The charged sodium ion pulls on the water's electrons, clearly showing which density functionals over-polarize compared to CCSD. Split-range exchange can reduce this over-polarization, but results in reduced electrostatic interaction. Dispersion can lower the binding energy again to counter-balance. So, functionals fit to experimental formation energies need both effects to avoid lowering energies by over-polarizing. |- style="border: 1px solid darkgray;" || David M. Rogers. "Real-space quadrature: a convenient, efficient representation for multipole expansions." [http://dx.doi.org/10.1063/1.4907404 J. Chem. Phys. 142:074101, 2015]. ([http://predictivestatmech.org/papers/real-poles.pdf Presentation]) I introduce sets of point charges that are able to simultaneously reproduce all multipole (spherical harmonic) expansions up to arbitrary order. The number of points is space-optimal. Translations are described from the usual harmonics and from Cartesian moments (dipole, quadrupole, etc.) on supersymmetric tensors to directional moments using the point weight distribution. Many applications are possible, including trivial implementation of multipoles in molecular mechanics and representing probability distributions over rotation space. |- style="border: 1px solid darkgray;" || David M. Rogers, Michael S. Kent, and Susan B. Rempe, "Molecular basis of endosomal-membrane association for the dengue virus envelope protein." [http://dx.doi.org/10.1016/j.bbamem.2014.12.018 BBA Biomembranes 1848(4):1041-52, 2015.] A fully atomistic potential of mean force for association of the viral envelope protein from Dengue virus was compared to a Poisson-Boltzmann electrostatic plus dispersion model. The results are consistent, showing hope for this type of combined scale simulation. |- style="border: 1px solid darkgray;" || Yaqin Fu, Binsong Li, Ying-Bing Jiang, Darren R. Dunphy, Andy Tsai, Siu-Yue Tam, Hongyou Fan, Hongxia Zhan, David Rogers, Susan Rempe, Plamen Atanassov, Joseph L. Cecchi, and C. Jeffrey Brinker "Atomic Layer Deposition of L-Alanine Polypeptide." [http://pubs.acs.org/doi/abs/10.1021/ja5043403 JACS 136(45):15821–4, 2014.] This paper with our experimental collaborators carried out blocked peptide synthesis by vapor-depositing Boc-L-alanine to create a uniform thin film of polypeptides grown on a silica substrate activated by aminopropyltrimethoxysilane. |- style="border: 1px solid darkgray;" || David M. Rogers. "Silmaril, A Functional Language for Distributed Parallel Evaluation." [http://predictivestatmech.org/sil/papers/sil.pdf Submitted version] |- style="border: 1px solid darkgray;" || Mathias B. Andersen, David M. Rogers, Junyu Mai, Benjamin Schudel, Anson V. Hatch, Susan B. Rempe and Ali Mani. "Spatiotemporal pH dynamics in concentration polarization near ion-selective membranes." [http://dx.doi.org/10.1021/la5014297 Langmuir, 30(26):7902–7912, 2014] |- style="border: 1px solid darkgray;" || W. K. Chan, P. L. Lorenzi, A. Anishkin, P. Purwaha, D. M. Rogers, S. Sukharev, S.B. Rempe, and J. N. Weinstein. "The glutaminase activity of l-asparaginase is not required for anticancer activity against ASNS-negative cells." [http://dx.doi.org/10.1182/blood-2013-10-535112 Blood. 123(23):3596-606, 2014]. |- style="border: 1px solid darkgray;" || David M. Rogers, Dian Jiao, Lawrence Pratt, and Susan B. Rempe. "Structural Models and Molecular Thermodynamics of Hydration of Ions and Small Molecules" [http://dx.doi.org/10.1016/B978-0-444-59440-2.00004-1 Annu. Rep. Comp. Chem. 8:71–127, 2012.] |- style="border: 1px solid darkgray;" || David M. Rogers and Susan B. Rempe. "Irreversible Thermodynamics." [http://dx.doi.org/10.1088/1742-6596/402/1/012014 J. Phys.: Conf. Ser. 402:012014, 2012]. |- style="border: 1px solid darkgray;" || David M. Rogers, Thomas L. Beck, and Susan B. Rempe. [[Media:Dmroge_InfoNonequ2011.pdf|"An Information Theory Approach to Nonlinear, Nonequilibrium Thermodynamics."]] [http://dx.doi.org/10.1007/s10955-011-0358-9 J. Stat. Phys. 145(2):385-409, 2011] We show how the interpretation of thermodynamic states as representing system information leads naturally to thermodynamic cycles and the first and second laws of thermodynamics as well as similar formulations for nontrivial nonequilibrium problems. The logical development of the theory also leads naturally to correct indistinguishability factors in the partition function. |- style="border: 1px solid darkgray;" || Sameer Varma, David M. Rogers, Lawrence R. Pratt, and Susan B. Rempe. "Perspectives on Ion Selectivity: Design Principles for K+ Selectivity in Membrane Transport." [http://jgp.rupress.org/content/137/6/479.full J. Gen. Physiol., 137(6):479-488, 2011.] We review the development of models for understanding the physical basis of selectivity for K+ ions over Na+, its sibling only one row behind, in membrane channels and transporters. Although the problem is subtle because of the morass of competing effects, we emphasize work analyzing the systematic influence of the environment on tipping local binding site structure toward selective configurations. |- style="border: 1px solid darkgray;" || David M. Rogers and Susan B. Rempe. [http://www.ncbi.nlm.nih.gov/pmc/articles/PMC3443978/ “Probing the Thermodynamics of Competitive Ion Binding Using Minimum Energy Structures.”] [http://dx.doi.org/10.1021/jp2012864 J. Phys. Chem. B, 115(29):9116-29, 2011]. We presented an extension of the Quasi-Chemical theory for quantifying the impact of local structure on ion complexation thermodynamics. The theory can be simply represented using a set of thermodynamic cycles involving binding site structural and compositional states as reaction intermediates. |- style="border: 1px solid darkgray;" || Susan B. Rempe and David M. Rogers; et. al. “Computational and experimental platform for understanding and optimizing water flux and salt rejection in nanoporous membranes.” [http://prod.sandia.gov/techlib/access-control.cgi/2010/106735.pdf Sandia Technical Report, SAND2010-6735, 2010.] We summarize work on designing polymer coatings for salt exclusion in water transporting nanopores. In this work, I collected available molecular dynamics results for these systems and performed a novel energy efficiency analysis able to relate atomistic and experimental scales as well as identify important design goals and chemical principles for material performance. |- style="border: 1px solid darkgray;" || David M. Rogers, [http://rave.ohiolink.edu/etdc/view?acc_num=ucin1251832030 ''''Using Bayes' Theorem for Free Energy Calculations''''], 2009. We investigated the central quantity of free energies in a Bayesian context and provide estimators for solvation free energies as well as optimal potential of mean force approximations to model polymer coarse-grained dynamics from atomistic simulations. |- style="border: 1px solid darkgray;" || Zhen Zhao, David M. Rogers and Thomas L. Beck. "Polarization and Charge Transfer in the Hydration of Chloride Ions." [http://link.aip.org/link/?JCP/132/014502/1 J. Chem. Phys., 132:014502, 2010.] Dr. Zhao's ab-initio analysis of the charge distribution in water-ion clusters highlighted the importance of many-body water-water interactions and charge transfer effects in determining cluster structural and energetic properties. These are still challenging to represent in modern polarizable forcefields and have implications for anion properties at interfaces. |- style="border: 1px solid darkgray;" || David M. Rogers and Thomas L. Beck. "Quasi-Chemical and Structural Analysis of Polarizable Anion Hydration." [http://link.aip.org/link/?JCP/132/014505/1 J. Chem. Phys., 132:014505, 2010.] The role of polarizability in forcefield-based models of ions and water was examined. Utilizing some of our recent developments on quasi-chemical theory, we have been able to quantify the tightened, asymmetric nature of the ion's local solvation waters induced by increased polarizability as well as the exact effects of polarization on the solvation free energy. The results suggest some potential problems and diagnostics for such models. |- style="border: 1px solid darkgray;" || David M. Rogers and Thomas L. Beck. [http://forcesolve.sourceforge.net/ Force Solve] (Sourceforge, Chicago IL, 2008). This force matching software implements and tests coarse-graining for general molecular systems in a mere 4000 lines of code. It is able to parametrize coarse Hamiltonians from atomic trajectory data given arbitrary definitions of coarse united-atom type models as well as carry out short Langevin Dynamics simulations on the coarse scale. The program's main drawbacks are its slow speed and high memory usage due to its simplistic design, attributable to the interpreted nature of python. |- style="border: 1px solid darkgray;" || David M. Rogers and Thomas L. Beck. "Resolution and Scale Independent Nonparametric Function Matching Using a String Energy Penalized Spline Prior." 2008. [http://arxiv.org/abs/1003.4741 arXiv:1003.4741v1] (stat.ML). Fresh insight is provided into long-standing mathematical issues surrounding computational modeling of continuous functions from a few sampled data points. The present research lays the groundwork for predicting the behavior of complicated many-body systems using advanced regression techniques. |} d4aa728eda9413f2265503babb830c4ff87dcec0 PChemFall2016 0 120 525 2016-08-22T16:21:48Z David M. Rogers 2 Created page with "'''<BIG>Physical Chemistry I</BIG>''' Course Info * Course Numbers CHM 4410-001 * Credit Hours: 4 * Meeting Dates: Aug. 23 - Nov. 29, 2016 ** No Class Nov. 11, 24 or 25 * Mee..." wikitext text/x-wiki '''<BIG>Physical Chemistry I</BIG>''' Course Info * Course Numbers CHM 4410-001 * Credit Hours: 4 * Meeting Dates: Aug. 23 - Nov. 29, 2016 ** No Class Nov. 11, 24 or 25 * Meeting Times: Tues. and Thurs., 3:30-4:45 pm in Cooper Hall, 461 ** Problem Session: Fri., 9:30-10:20 am in Muma College of Business, 1402 ** Office Hours: Tues. and Thurs., 2:30-3:20 pm in SCA 433 * Grading: ** Quiz (40%) *** To succeed in the quiz, study the topics covered in the previous week! ** Midterm (30%) Thurs., Oct. 6, 3:30-4:45 pm (CPR 461) ** Final (30%) Thurs., Dec. 8, 12:30-2:30 pm (CPR 461) == Overview == This is the first part of a 2-semester course in thermodynamics. This course will cover the mathematical theory of chemical equilibrium, heat, and work. These are the driving forces behind the operation of Le Châtelier's principle, and are routinely used to understand and control chemical reactions, states of matter, and amount and efficiency of energy production. == Textbooks == * McQuarrie and Simon, Physical Chemistry: A Molecular Approach, University Science Books, 1997. ISBN: 0935702997. == Resources == * [http://hyperphysics.phy-astr.gsu.edu/hbase/kinetic/ktcon.html Kinetic Theory] at HyperPhysics * [http://hyperphysics.phy-astr.gsu.edu/hbase/heacon.html Heat Concepts] at HyperPhysics ** Note: McQuarrie says dU = dQ + dW, while Nave says dU = dQ - dW. There is no contradiction, since McQuarrie's dW = -P dV (work done on the system), while Nave's dW = P dV (work done by the system). I prefer the first definition. * News from the frontlines of exploring entropy: [http://scitation.aip.org/content/aip/magazine/physicstoday/article/68/9/10.1063/PT.3.2912 Information: From Maxwell’s demon to Landauer’s eraser] == Topics == # Moving Freely in P-V-T space (Chapter H, with examples from Ch. 16-[2,3,5,6,7], 17-[4,5], and 19-1) #* Isobaric, isothermal, and isochoric processes #* State functions #* Implicit, partial, and total derivatives #* Integration along a path #* Relations between partial derivatives #** Transformations using substitution #** Transformations using the chain rule #* Visualizing isosurfaces #* Using P(V,T) / V(P,T) / T(P,V) # First Law of Thermodynamics – conserved quantities (Ch. 19-[2 to 9]) #* Mechanisms of energy flow: work, heat, mass/chemical #* Integrating work and heat for common processes #* Energy of a molecule vs. a collection – translation, rotation, intermolecular, etc. #* Extensive and intensive quantities #* Using energy balance for fun and profit. # Standard States and Energies (Ch. 19-[10,11,12], Ch 26-[3,6,7,8,9]) #* Connecting to analytical chemistry. #* Spontaneous, irreversible, processes vs. quasistatic processes. #* Experimentally measuring reaction constants and heats. (Ch. 21-5) # The Second Law of Thermodynamics: Energy, Enthalpy, Entropy, and Free Energy (Ch. 20) #* The absolute temperature scale. (Ch. 16-1) #* Inequalities followed by each path type. (Ch. 22-[1,2]) #* Heat, measurement, information, Maxwell’s demon and Landauer’s principle. # Basic Probability #* Simple counting (Ch. J) #* Velocity distribution function (Ch 27-[1,2,3,4]) #* Boltzmann distributions (Ch. 17-[1,2,3,6 to 8]) # Applications: #* Quantitative Prediction of Reaction Equilibria (Ch. 26) #* Liquid solutions: osmotic pressure, vapor pressure, Henry’s and Raoult’s Laws (Ch. 24) #* Phase Equilibria and Basic Phase Diagrams (Ch. 23) #* Thermodynamic Cycles, Examples with Refrigeration and Galvanic Cell (Ch. 20-7) 5f31454a35f8aa469a2d61c26bcffd17e3b1df2d 526 525 2016-08-25T00:54:44Z David M. Rogers 2 wikitext text/x-wiki '''<BIG>Physical Chemistry I</BIG>''' Course Info * Course Numbers CHM 4410-001 * Credit Hours: 4 * Meeting Dates: Aug. 23 - Nov. 29, 2016 ** No Class Nov. 11, 24 or 25 * Meeting Times: Tues. and Thurs., 3:30-4:45 pm in CIS 3064 ** Problem Session: Fri., 9:30-10:20 am in CIS 3064 ** Office Hours: Tues. and Thurs., 2:30-3:20 pm in SCA 433 * Grading: ** Quiz (40%) *** To succeed in the quiz, study the topics covered in the previous week! ** Midterm (30%) Thurs., Oct. 6, 3:30-4:45 pm (CIS 3064) ** Final (30%) Thurs., Dec. 8, 12:30-2:30 pm (CIS 3064) == Overview == This is the first part of a 2-semester course in thermodynamics. This course will cover the mathematical theory of chemical equilibrium, heat, and work. These are the driving forces behind the operation of Le Châtelier's principle, and are routinely used to understand and control chemical reactions, states of matter, and amount and efficiency of energy production. == Textbooks == * McQuarrie and Simon, Physical Chemistry: A Molecular Approach, University Science Books, 1997. ISBN: 0935702997. == Resources == * [http://hyperphysics.phy-astr.gsu.edu/hbase/kinetic/ktcon.html Kinetic Theory] at HyperPhysics * [http://hyperphysics.phy-astr.gsu.edu/hbase/heacon.html Heat Concepts] at HyperPhysics ** Note: McQuarrie says dU = dQ + dW, while Nave says dU = dQ - dW. There is no contradiction, since McQuarrie's dW = -P dV (work done on the system), while Nave's dW = P dV (work done by the system). I prefer the first definition. * News from the frontlines of exploring entropy: [http://scitation.aip.org/content/aip/magazine/physicstoday/article/68/9/10.1063/PT.3.2912 Information: From Maxwell’s demon to Landauer’s eraser] == Topics == # Moving Freely in P-V-T space (Chapter H, with examples from Ch. 16-[2,3,5,6,7], 17-[4,5], and 19-1) #* Isobaric, isothermal, and isochoric processes #* State functions #* Implicit, partial, and total derivatives #* Integration along a path #* Relations between partial derivatives #** Transformations using substitution #** Transformations using the chain rule #* Visualizing isosurfaces #* Using P(V,T) / V(P,T) / T(P,V) # First Law of Thermodynamics – conserved quantities (Ch. 19-[2 to 9]) #* Mechanisms of energy flow: work, heat, mass/chemical #* Integrating work and heat for common processes #* Energy of a molecule vs. a collection – translation, rotation, intermolecular, etc. #* Extensive and intensive quantities #* Using energy balance for fun and profit. # Standard States and Energies (Ch. 19-[10,11,12], Ch 26-[3,6,7,8,9]) #* Connecting to analytical chemistry. #* Spontaneous, irreversible, processes vs. quasistatic processes. #* Experimentally measuring reaction constants and heats. (Ch. 21-5) # The Second Law of Thermodynamics: Energy, Enthalpy, Entropy, and Free Energy (Ch. 20) #* The absolute temperature scale. (Ch. 16-1) #* Inequalities followed by each path type. (Ch. 22-[1,2]) #* Heat, measurement, information, Maxwell’s demon and Landauer’s principle. # Basic Probability #* Simple counting (Ch. J) #* Velocity distribution function (Ch 27-[1,2,3,4]) #* Boltzmann distributions (Ch. 17-[1,2,3,6 to 8]) # Applications: #* Quantitative Prediction of Reaction Equilibria (Ch. 26) #* Liquid solutions: osmotic pressure, vapor pressure, Henry’s and Raoult’s Laws (Ch. 24) #* Phase Equilibria and Basic Phase Diagrams (Ch. 23) #* Thermodynamic Cycles, Examples with Refrigeration and Galvanic Cell (Ch. 20-7) 15da13f665c6b61821fa3803918270977c035eec 528 526 2016-09-21T02:20:32Z David M. Rogers 2 /* Resources */ wikitext text/x-wiki '''<BIG>Physical Chemistry I</BIG>''' Course Info * Course Numbers CHM 4410-001 * Credit Hours: 4 * Meeting Dates: Aug. 23 - Nov. 29, 2016 ** No Class Nov. 11, 24 or 25 * Meeting Times: Tues. and Thurs., 3:30-4:45 pm in CIS 3064 ** Problem Session: Fri., 9:30-10:20 am in CIS 3064 ** Office Hours: Tues. and Thurs., 2:30-3:20 pm in SCA 433 * Grading: ** Quiz (40%) *** To succeed in the quiz, study the topics covered in the previous week! ** Midterm (30%) Thurs., Oct. 6, 3:30-4:45 pm (CIS 3064) ** Final (30%) Thurs., Dec. 8, 12:30-2:30 pm (CIS 3064) == Overview == This is the first part of a 2-semester course in thermodynamics. This course will cover the mathematical theory of chemical equilibrium, heat, and work. These are the driving forces behind the operation of Le Châtelier's principle, and are routinely used to understand and control chemical reactions, states of matter, and amount and efficiency of energy production. == Textbooks == * McQuarrie and Simon, Physical Chemistry: A Molecular Approach, University Science Books, 1997. ISBN: 0935702997. == Resources == * [http://hyperphysics.phy-astr.gsu.edu/hbase/kinetic/ktcon.html Kinetic Theory] at HyperPhysics * [http://hyperphysics.phy-astr.gsu.edu/hbase/heacon.html Heat Concepts] at HyperPhysics ** Note: McQuarrie says dU = dQ + dW, while Nave says dU = dQ - dW. There is no contradiction, since McQuarrie's dW = -P dV (work done on the system), while Nave's dW = P dV (work done by the system). I prefer the first definition. * News from the frontlines of exploring entropy: [http://scitation.aip.org/content/aip/magazine/physicstoday/article/68/9/10.1063/PT.3.2912 Information: From Maxwell’s demon to Landauer’s eraser] * [[Media:Transforms.pdf|Notes]] on transformations of variables. == Topics == # Moving Freely in P-V-T space (Chapter H, with examples from Ch. 16-[2,3,5,6,7], 17-[4,5], and 19-1) #* Isobaric, isothermal, and isochoric processes #* State functions #* Implicit, partial, and total derivatives #* Integration along a path #* Relations between partial derivatives #** Transformations using substitution #** Transformations using the chain rule #* Visualizing isosurfaces #* Using P(V,T) / V(P,T) / T(P,V) # First Law of Thermodynamics – conserved quantities (Ch. 19-[2 to 9]) #* Mechanisms of energy flow: work, heat, mass/chemical #* Integrating work and heat for common processes #* Energy of a molecule vs. a collection – translation, rotation, intermolecular, etc. #* Extensive and intensive quantities #* Using energy balance for fun and profit. # Standard States and Energies (Ch. 19-[10,11,12], Ch 26-[3,6,7,8,9]) #* Connecting to analytical chemistry. #* Spontaneous, irreversible, processes vs. quasistatic processes. #* Experimentally measuring reaction constants and heats. (Ch. 21-5) # The Second Law of Thermodynamics: Energy, Enthalpy, Entropy, and Free Energy (Ch. 20) #* The absolute temperature scale. (Ch. 16-1) #* Inequalities followed by each path type. (Ch. 22-[1,2]) #* Heat, measurement, information, Maxwell’s demon and Landauer’s principle. # Basic Probability #* Simple counting (Ch. J) #* Velocity distribution function (Ch 27-[1,2,3,4]) #* Boltzmann distributions (Ch. 17-[1,2,3,6 to 8]) # Applications: #* Quantitative Prediction of Reaction Equilibria (Ch. 26) #* Liquid solutions: osmotic pressure, vapor pressure, Henry’s and Raoult’s Laws (Ch. 24) #* Phase Equilibria and Basic Phase Diagrams (Ch. 23) #* Thermodynamic Cycles, Examples with Refrigeration and Galvanic Cell (Ch. 20-7) e29e44407964dc704b69730e779ac09e3b4af761 530 528 2016-09-27T21:26:25Z David M. Rogers 2 wikitext text/x-wiki '''<BIG>Physical Chemistry I</BIG>''' Course Info * Course Numbers CHM 4410-001 * Credit Hours: 4 * Meeting Dates: Aug. 23 - Nov. 29, 2016 ** No Class Nov. 11, 24 or 25 * Meeting Times: Tues. and Thurs., 3:30-4:45 pm in CIS 3064 ** Problem Session: Fri., 9:30-10:20 am in CIS 3064 ** Office Hours: Tues. and Thurs., 2:30-3:20 pm in SCA 433 * Grading: ** Quiz (40%) *** To succeed in the quiz, study the topics covered in the previous week! ** Midterm (30%) Thurs., Oct. 13, 3:30-4:45 pm (CIS 3064) ** Final (30%) Thurs., Dec. 8, 12:30-2:30 pm (CIS 3064) == Overview == This is the first part of a 2-semester course in thermodynamics. This course will cover the mathematical theory of chemical equilibrium, heat, and work. These are the driving forces behind the operation of Le Châtelier's principle, and are routinely used to understand and control chemical reactions, states of matter, and amount and efficiency of energy production. == Textbooks == * McQuarrie and Simon, Physical Chemistry: A Molecular Approach, University Science Books, 1997. ISBN: 0935702997. == Resources == * [http://hyperphysics.phy-astr.gsu.edu/hbase/kinetic/ktcon.html Kinetic Theory] at HyperPhysics * [http://hyperphysics.phy-astr.gsu.edu/hbase/heacon.html Heat Concepts] at HyperPhysics ** Note: McQuarrie says dU = dQ + dW, while Nave says dU = dQ - dW. There is no contradiction, since McQuarrie's dW = -P dV (work done on the system), while Nave's dW = P dV (work done by the system). I prefer the first definition. * News from the frontlines of exploring entropy: [http://scitation.aip.org/content/aip/magazine/physicstoday/article/68/9/10.1063/PT.3.2912 Information: From Maxwell’s demon to Landauer’s eraser] * [[Media:Transforms.pdf|Notes]] on transformations of variables. == Topics == # Moving Freely in P-V-T space (Chapter H, with examples from Ch. 16-[2,3,5,6,7], 17-[4,5], and 19-1) #* Isobaric, isothermal, and isochoric processes #* State functions #* Implicit, partial, and total derivatives #* Integration along a path #* Relations between partial derivatives #** Transformations using substitution #** Transformations using the chain rule #* Visualizing isosurfaces #* Using P(V,T) / V(P,T) / T(P,V) # First Law of Thermodynamics – conserved quantities (Ch. 19-[2 to 9]) #* Mechanisms of energy flow: work, heat, mass/chemical #* Integrating work and heat for common processes #* Energy of a molecule vs. a collection – translation, rotation, intermolecular, etc. #* Extensive and intensive quantities #* Using energy balance for fun and profit. # Standard States and Energies (Ch. 19-[10,11,12], Ch 26-[3,6,7,8,9]) #* Connecting to analytical chemistry. #* Spontaneous, irreversible, processes vs. quasistatic processes. #* Experimentally measuring reaction constants and heats. (Ch. 21-5) # The Second Law of Thermodynamics: Energy, Enthalpy, Entropy, and Free Energy (Ch. 20) #* The absolute temperature scale. (Ch. 16-1) #* Inequalities followed by each path type. (Ch. 22-[1,2]) #* Heat, measurement, information, Maxwell’s demon and Landauer’s principle. # Basic Probability #* Simple counting (Ch. J) #* Velocity distribution function (Ch 27-[1,2,3,4]) #* Boltzmann distributions (Ch. 17-[1,2,3,6 to 8]) # Applications: #* Quantitative Prediction of Reaction Equilibria (Ch. 26) #* Liquid solutions: osmotic pressure, vapor pressure, Henry’s and Raoult’s Laws (Ch. 24) #* Phase Equilibria and Basic Phase Diagrams (Ch. 23) #* Thermodynamic Cycles, Examples with Refrigeration and Galvanic Cell (Ch. 20-7) 103ba4fe5468d3e87ef094eb4c08970b9e5832c6 Courses 0 16 527 405 2016-09-21T02:19:10Z David M. Rogers 2 wikitext text/x-wiki Here's a list of courses with useful online materials: == Courses == * [[PChemFall2016| USF Physical Chemistry I]] * [[GradQuantumFall2013| USF Graduate Quantum Mechanics I]] * [[GradQuantumSpring2014| USF Graduate Quantum Mechanics II]] * [[CompSciSpring2016|Introduction to Scientific Computing (2016)]] * [[CompSciFall2014|Introduction to Scientific Computing (2014)]] * [http://lambda-the-ultimate.org/classic/Courses.html Functional Programming] == Lecture Series == * [http://www.esqc.org/lectures European Summer School in Quantum Chemistry] == Tutorials == * [[HowTo:Fourier|Fourier transforms]] * [http://www.mathematica-journal.com/2012/02/evaluation-of-gaussian-molecular-integrals Evaluating Matrix Elements] * [http://www.haskell.org/tutorial/ Haskell] * [http://monads.haskell.cz/html/index.html Monads] * [http://www.yosefk.com/blog/my-history-with-forth-stack-machines.html The Forth Language] == Reference Material == * [http://dft.sandia.gov/Quest/DFT_codes.html List of DFT Codes] * [http://docs.python.org/3/tutorial/ Python Tutorial] * [http://www.nwchem-sw.org/index.php/Release62:NWChem_Documentation NWChem Documentation] * [http://www.ebi.ac.uk/pdbe-srv/pdbechem/ PDB Ligand Structures] 77936a81cd46531f8c1fc92f7e4eea489777246b 537 527 2017-01-11T15:41:13Z David M. Rogers 2 wikitext text/x-wiki Here's a list of courses with useful online materials: == Courses == * [[PChemFall2016| USF Physical Chemistry I]] * [[GradQuantumFall2013| USF Graduate Quantum Mechanics I]] * [[GradQuantumSpring2014| USF Graduate Quantum Mechanics II]] * [[CompSciSpring2016|Introduction to Scientific Computing (2017)]] * [[CompSciSpring2016|Introduction to Scientific Computing (2016)]] * [[CompSciFall2014|Introduction to Scientific Computing (2014)]] * [http://lambda-the-ultimate.org/classic/Courses.html Functional Programming] == Lecture Series == * [http://www.esqc.org/lectures European Summer School in Quantum Chemistry] == Tutorials == * [[HowTo:Fourier|Fourier transforms]] * [http://www.mathematica-journal.com/2012/02/evaluation-of-gaussian-molecular-integrals Evaluating Matrix Elements] * [http://www.haskell.org/tutorial/ Haskell] * [http://monads.haskell.cz/html/index.html Monads] * [http://www.yosefk.com/blog/my-history-with-forth-stack-machines.html The Forth Language] == Reference Material == * [http://dft.sandia.gov/Quest/DFT_codes.html List of DFT Codes] * [http://docs.python.org/3/tutorial/ Python Tutorial] * [http://www.nwchem-sw.org/index.php/Release62:NWChem_Documentation NWChem Documentation] * [http://www.ebi.ac.uk/pdbe-srv/pdbechem/ PDB Ligand Structures] cdc792997e4fb258d524037395a890d5783bfa05 538 537 2017-01-11T15:41:49Z David M. Rogers 2 wikitext text/x-wiki Here's a list of courses with useful online materials: == Courses == * [[PChemFall2016| USF Physical Chemistry I]] * [[GradQuantumFall2013| USF Graduate Quantum Mechanics I]] * [[GradQuantumSpring2014| USF Graduate Quantum Mechanics II]] * [[CompSciSpring2017|Introduction to Scientific Computing (2017)]] * [[CompSciSpring2016|Introduction to Scientific Computing (2016)]] * [[CompSciFall2014|Introduction to Scientific Computing (2014)]] * [http://lambda-the-ultimate.org/classic/Courses.html Functional Programming] == Lecture Series == * [http://www.esqc.org/lectures European Summer School in Quantum Chemistry] == Tutorials == * [[HowTo:Fourier|Fourier transforms]] * [http://www.mathematica-journal.com/2012/02/evaluation-of-gaussian-molecular-integrals Evaluating Matrix Elements] * [http://www.haskell.org/tutorial/ Haskell] * [http://monads.haskell.cz/html/index.html Monads] * [http://www.yosefk.com/blog/my-history-with-forth-stack-machines.html The Forth Language] == Reference Material == * [http://dft.sandia.gov/Quest/DFT_codes.html List of DFT Codes] * [http://docs.python.org/3/tutorial/ Python Tutorial] * [http://www.nwchem-sw.org/index.php/Release62:NWChem_Documentation NWChem Documentation] * [http://www.ebi.ac.uk/pdbe-srv/pdbechem/ PDB Ligand Structures] 3c4800acea9c5398ab37c74648524031a016788e File:Transforms.pdf 6 121 529 2016-09-21T02:20:54Z David M. Rogers 2 wikitext text/x-wiki da39a3ee5e6b4b0d3255bfef95601890afd80709 Code:gmxliquid 0 65 531 472 2016-11-21T20:55:41Z David M. Rogers 2 wikitext text/x-wiki In this tutorial, I'm assuming you already have the gromacs commands (grompp, mdrun, etc.) loaded. I'm also assuming you have gromacs 5, which made significant changes to the way command-line tools are used. You'll also need the starting files [[Media:liq_files.tgz|here]]. Or, on circe, just run cp -R /shares/mri_workshop/Liquids . cd Liquids = Create an input system = First, we do some size calculations in the python prompt. >>> # Compute number of EtOH molecules >>> # 8 nm^3 = 8e-21 cc >>> # 0.4 % By vol. >>> # rho_EtOH = 0.78924 g / cc >>> # FW = 46 g/mol >>> >>> 8e-21*0.4*0.78924/46.0*6.022e23 33 Next, we need to generate an 8 nm<math>^3</math> box with 33 EtOH molecules gmx insert-molecules -box 2 2 2 -ci etoh.pdb -o box.pdb -nmol 33 nano topol.top # check for line "ETH 33" (no changes required) If the topology file and forcefields are 'there', we can create a test simulation using just these molecules. We'll do this just to check that grompp works gmx grompp -c box.pdb -f equ.mdp -o equ.tpr If this completes without errors, we know that we ''could'' simulate the ETH molecules we have now. That would give a high-density gas, rather than the liquid we want. Next, the complete water+EtOH mixture can be made by filling the voids with water. We'll use TIP4P here. gmx solvate -cs tip4p -cp box.pdb -o sys.pdb Since this last command added waters, you have to update the topology file, adding "SOL 130" (or your number of waters) nano topol.top = run minimization = Molecular structures can be touchy, since contacting atoms causes large forces and 'blows up' a system. The risk of this can be reduced by minimizing the energy of initial starting systems. First, we have to create a file describing how gromacs should do the minimization. gmx grompp -p topol.top -f min.mdp -c sys.pdb -o min A lot of backup files (starting with '#') accumulate, and we remove them like so: rm -f \#* mdout.mdp Now we're ready to run minimization. Since the system is small, minimization is cheap and fast - so we do it on the head node. For larger systems, this command would be put in a job-script. gmx mdrun -deffnm min The latest gromacs has a bug of some sort or can't work with OPLS-AA for EtOH, since I get a segfault here. Hopefully this will be fixed soon. Otherwise, you can manually delete the EtOH from sys.pdb and topol.top and then re-run the grompp and mdrun steps. Now we're ready to take the minimized structure and run dynamics. This first round is called equilibration, since we intend to let the system settle into a thermal equilibrium state. gmx grompp -c min.gro -f equ.mdp -o equ.tpr To run this one, we'll use the cluster by writing down the command in a script file. That script gets sent to the cluster. No changes to equ.sh should be required. nano equ.sh sbatch equ.sh squeue -u `whoami` As the job is running you can read through the log file. less equ.log tail -f equ.log # enter Ctl-C to stop tailing Note that the energy is output at every time-step. Why is the total energy changing with time? What about the total volume? = run dynamics = Running dynamics uses the same procedure as before, but now we need to worry about how much and which output to produce. nano run.mdp # no changes required gmx grompp -c equ.gro -f run.mdp -o run.tpr Check and start the job (no changes required). nano run.sh sbatch run.sh squeue -u `whoami` Read through run.log less run.log tail -f run.log # enter Ctl-C to stop tailing Notice that the total energy remains relatively constant now, but the individual energies are still very noisy. What does this say about the shape of the molecules? = analyze dynamic data = Let's first check what happened during equilibration. Since the volume was allowed to change, we should be able to plot it vs. time: gmx energy -f equ.edr -o equ.en.xvg # Select: Potential Kinetic-En. Total-Energy Volume * At what time does the potential energy stabilize? * What is the density? ** answer: (33*46 + 18*133)/Avogadro / 7.0333834916722191e-21 = 0.9236 g/mL ** These two quantities inform on the heat and volume change of mixing. ** Pure H2O (TIP4P): rho = 1.001, H ~ 11.6 kcal/mol, D = 3.9e-5 cm^2/s, eps = 52 ** Pure H2O (expt): rho = 0.9971, H = 10.5 kcal/mol, D = 2.3e-5 cm^2/s, eps = 78.4 ** Gas-phase TIP4P energy = 0 (no self interactions in the model) ** Gas-phase OPLSAA-EtOH energy = 25 kJ/mol (<math>\pm</math>1) ** (J. Chem. Phys. 123, 234505, 2005) ** Pure EtOH: rho = 0.7873, H = 10.0 kcal/mol, D = 1.0e-5 cm^2/s, eps(expt) = 23 ** (J. Phys. Chem. B 1997, 101, 78-86, J. Phys. Chem. B, 2014, 118 (34), 10156-66) Gnuplot can make this plot with plot 'equ.en.xvg' u 1:2 w l, 'equ.en.xvg' u 1:5 axis x1y2 w l The radial distribution function is a classical measure of the structuring of liquid water. The one we calculate here shows the density of molecules within spherical shells around the central molecule. gmx rdf -rdf mol_com -ng 2 -s run -f run.trr -o run.w-rdf.xvg # select Water as "reference group", select "Water", then "ETH" # re-run for ETH-ETH rdf gmx rdf -rdf mol_com -ng 1 -s run -f run.trr -o run.e-rdf.xvg gnuplot can plot these together with: plot 'run.w-rdf.xvg' u 1:2 w l, 'run.w-rdf.xvg' u 1:3 w l, 'run.e-rdf.xvg' u 1:2 w l Notice how waters stack much more closely together than EtOH? How is this related to their liquid densities? The dielectric of a liquid measures its ability to be polarized by an applied field. High dielectric materials make good capacitors. gmx dipoles -f run.trr -s run.tpr -c dipcorr.xvg -corr total -P 1 <pre><nowiki> Dipole moment (Debye) --------------------- Average = 2.2234 Std. Dev. = 0.1095 Error = 0.0001 The following averages for the complete trajectory have been calculated: Total < M_x > = 7.79882 Debye Total < M_y > = -1.11977 Debye Total < M_z > = 9.49511 Debye Total < M_x^2 > = 882.516 Debye^2 Total < M_y^2 > = 1239.78 Debye^2 Total < M_z^2 > = 925.457 Debye^2 Total < |M|^2 > = 3047.75 Debye^2 Total |< M >|^2 = 152.233 Debye^2 < |M|^2 > - |< M >|^2 = 2895.52 Debye^2 Finite system Kirkwood g factor G_k = 3.52836 Infinite system Kirkwood g factor g_k = 2.37948 Epsilon = 43.1739 </nowiki></pre> Water and EtOH are constantly undergoing random collisions in solution. The net effect of this is diffusion of the two molecules. Einstein showed that this can be tracked by watching the mean squared displacement of the molecules over time. Since the distance traveled over a random walk with diffusion constant <math>D</math> has a Gaussian distribution with variance <math>2D\Delta t</math>, where <math>\Delta t</math> is the elapsed time, the mean squared displacement vs time should be a straight line with slope <math>2D</math>. Of course, over short times, this picture is only approximate, but it usually holds over longer times. gmx msd -f run.trr -ngroup 2 -o run.msd.xvg <pre><nowiki> Fitting from 100 to 900 ps D[ Water] 1.4336 (+/- 0.0850) 1e-5 cm^2/s D[ ETH] 0.7312 (+/- 0.1279) 1e-5 cm^2/s </nowiki></pre> How do these compare with the literature values (above) for the pure liquids? More detail on velocity correlation: gmx velacc -mol -s run -f run.trr -o run.w-acf.xvg # Choose group 3 (Water) gmx velacc -mol -s run -f run.trr -o run.e-acf.xvg # Choose group 2 (ETH) you can compare these to some of the above references. befe0f7a2af46992306bab710aea70016985631b Code 0 18 532 432 2016-12-15T17:30:16Z David M. Rogers 2 /* Tutorials */ wikitext text/x-wiki This page contains a list of codes we've found useful for scientific HPC from a developer's perspective. To use existing codes, check out [[Best Practices]]. == Tutorials == When learning a new language, once you've memorized the words, you need to start conversing. Unfortunately, source code is not spoken. It's a stillborn language. One of the best ways to code well is to study and modify other, good code. For code, this means reading and tweaking tutorials first, then design patterns, then large-scale projects next. * [http://exercism.io/ Exercism Instructions for New Developers] * [http://matt.might.net/articles/bash-by-example Bash By Example] * [http://docs.python.org/3/tutorial/datastructures.html Data Structures in Python] * [http://www.u.arizona.edu/~erdmann/mse350/topics/basic_linear_algebra.html Linear Algebra in Numpy] * [[Code:gmxliquid|Liquid Structure With Gromacs]] Remember that it's not enough to just read them. It's actually a positive waste of time. Rather, you have to do some run-tweak-run-debug development cycles with them. == Publication-related Code == * [[Code:realpole]] Real-space quadrature implementation of multipole electrostatics. == C Libraries == With the exception of the standard libraries and the [http://www.gnu.org/software/gsl/ GNU Scientific Library], there are surprisingly few of these about. Here are some generics that we've implemented and are sharing under the GPL. Robust map and red/black tree code has recently been published to [https://github.com/frobnitzem?tab=repositories github]. The amazing, smallish, extensible, final-form, lambda interpreter in C [http://predictivestatmech.org/code/lambda_final.c]. == Python Libraries == * [[Code:libnwchem|libnwchem]] A patch against Nwchem 6.5 to build its functionality as a shared library, along with glue code for access using python ctypes. * [[Code:networkx|Networkx]] a quick guide. === Geometric Algebra === The [http://www.predictivestatmech.org/code/galg.py Multivector] class implements geometric algebra using Python's operator overloading. It works with minimal space for any number of spatial dimensions, since it's not based on the matrix / spinor representation of Clifford algebra. Instead, it takes the basis blade approach recommended by Dorst, Fondijne, and Mann [http://www.geometricalgebra.net]. It's really just as easy as ordering all the basis vectors, and keeping track of the commutator (+/- <math>\hat 1</math>). == Templates == The real world has forms, computation has templates. Pick one up, fill in the blanks, and send it down the chute. * [[NWChem|NWChem Jobs]] * [[Code:SLURM|Slurm (USF Circe)]] * [[Code:SGE|SGE (USF Circe)]] * [[Code:text2pdf|Text conversion using text2pdf]] == Efficiencies == To chop a tree quickly, spend twice the time sharpening your axe. * [[Vimrc|vimrc files]] == Code Humor == Put this into your makefile: <source lang=bash> Clint\ Eastwood: myday echo "I feel great!" </source> aeabe2d488991c255aa7e8da60aacc7b7ddd1491 533 532 2016-12-15T17:46:49Z David M. Rogers 2 wikitext text/x-wiki This page contains a list of codes we've found useful for scientific HPC from a developer's perspective. To use existing codes, check out [[Best Practices]]. == Resources == These sites allow you to run code interactively in your web browser. They are useful for trying out new ideas and following along with tutorials. * [https://repl.it/languages/python3 Repl.it] (this is the only one that currently supports numpy) * [http://www.tutorialspoint.com/codingground.htm CodingGround] * [http://codepad.org/ CodePad] * [http://pythonfiddle.com/ PythonFiddle] == Tutorials == When learning a new language, once you've memorized the words, you need to start conversing. Unfortunately, source code is not spoken. It's a stillborn language. One of the best ways to code well is to study and modify other, good code. For code, this means reading and tweaking tutorials first, then design patterns, then large-scale projects next. * [http://exercism.io/ Exercism Instructions for New Developers] * [http://matt.might.net/articles/bash-by-example Bash By Example] * [http://docs.python.org/3/tutorial/datastructures.html Data Structures in Python] * [http://www.u.arizona.edu/~erdmann/mse350/topics/basic_linear_algebra.html Linear Algebra in Numpy] * [[Code:gmxliquid|Liquid Structure With Gromacs]] Remember that it's not enough to just read them. It's actually a positive waste of time. Rather, you have to do some run-tweak-run-debug development cycles with them. == Publication-related Code == * [[Code:realpole]] Real-space quadrature implementation of multipole electrostatics. == C Libraries == With the exception of the standard libraries and the [http://www.gnu.org/software/gsl/ GNU Scientific Library], there are surprisingly few of these about. Here are some generics that we've implemented and are sharing under the GPL. Robust map and red/black tree code has recently been published to [https://github.com/frobnitzem?tab=repositories github]. The amazing, smallish, extensible, final-form, lambda interpreter in C [http://predictivestatmech.org/code/lambda_final.c]. == Python Libraries == * [[Code:libnwchem|libnwchem]] A patch against Nwchem 6.5 to build its functionality as a shared library, along with glue code for access using python ctypes. * [[Code:networkx|Networkx]] a quick guide. === Geometric Algebra === The [http://www.predictivestatmech.org/code/galg.py Multivector] class implements geometric algebra using Python's operator overloading. It works with minimal space for any number of spatial dimensions, since it's not based on the matrix / spinor representation of Clifford algebra. Instead, it takes the basis blade approach recommended by Dorst, Fondijne, and Mann [http://www.geometricalgebra.net]. It's really just as easy as ordering all the basis vectors, and keeping track of the commutator (+/- <math>\hat 1</math>). == Templates == The real world has forms, computation has templates. Pick one up, fill in the blanks, and send it down the chute. * [[NWChem|NWChem Jobs]] * [[Code:SLURM|Slurm (USF Circe)]] * [[Code:SGE|SGE (USF Circe)]] * [[Code:text2pdf|Text conversion using text2pdf]] == Efficiencies == To chop a tree quickly, spend twice the time sharpening your axe. * [[Vimrc|vimrc files]] == Code Humor == Put this into your makefile: <source lang=bash> Clint\ Eastwood: myday echo "I feel great!" </source> be8b8a6c90570a422cb1718baad388b97f8ec8d1 549 533 2017-02-01T17:10:50Z David M. Rogers 2 /* Python Libraries */ wikitext text/x-wiki This page contains a list of codes we've found useful for scientific HPC from a developer's perspective. To use existing codes, check out [[Best Practices]]. == Resources == These sites allow you to run code interactively in your web browser. They are useful for trying out new ideas and following along with tutorials. * [https://repl.it/languages/python3 Repl.it] (this is the only one that currently supports numpy) * [http://www.tutorialspoint.com/codingground.htm CodingGround] * [http://codepad.org/ CodePad] * [http://pythonfiddle.com/ PythonFiddle] == Tutorials == When learning a new language, once you've memorized the words, you need to start conversing. Unfortunately, source code is not spoken. It's a stillborn language. One of the best ways to code well is to study and modify other, good code. For code, this means reading and tweaking tutorials first, then design patterns, then large-scale projects next. * [http://exercism.io/ Exercism Instructions for New Developers] * [http://matt.might.net/articles/bash-by-example Bash By Example] * [http://docs.python.org/3/tutorial/datastructures.html Data Structures in Python] * [http://www.u.arizona.edu/~erdmann/mse350/topics/basic_linear_algebra.html Linear Algebra in Numpy] * [[Code:gmxliquid|Liquid Structure With Gromacs]] Remember that it's not enough to just read them. It's actually a positive waste of time. Rather, you have to do some run-tweak-run-debug development cycles with them. == Publication-related Code == * [[Code:realpole]] Real-space quadrature implementation of multipole electrostatics. == C Libraries == With the exception of the standard libraries and the [http://www.gnu.org/software/gsl/ GNU Scientific Library], there are surprisingly few of these about. Here are some generics that we've implemented and are sharing under the GPL. Robust map and red/black tree code has recently been published to [https://github.com/frobnitzem?tab=repositories github]. The amazing, smallish, extensible, final-form, lambda interpreter in C [http://predictivestatmech.org/code/lambda_final.c]. == Python Libraries == * [[Code:libnwchem|libnwchem]] A patch against Nwchem 6.5 to build its functionality as a shared library, along with glue code for access using python ctypes. * [[Code:networkx|Networkx]] a quick guide. * [https://www.predictivestatmech.org/code/dcd.py Python DCD Library] === Geometric Algebra === The [http://www.predictivestatmech.org/code/galg.py Multivector] class implements geometric algebra using Python's operator overloading. It works with minimal space for any number of spatial dimensions, since it's not based on the matrix / spinor representation of Clifford algebra. Instead, it takes the basis blade approach recommended by Dorst, Fondijne, and Mann [http://www.geometricalgebra.net]. It's really just as easy as ordering all the basis vectors, and keeping track of the commutator (+/- <math>\hat 1</math>). == Templates == The real world has forms, computation has templates. Pick one up, fill in the blanks, and send it down the chute. * [[NWChem|NWChem Jobs]] * [[Code:SLURM|Slurm (USF Circe)]] * [[Code:SGE|SGE (USF Circe)]] * [[Code:text2pdf|Text conversion using text2pdf]] == Efficiencies == To chop a tree quickly, spend twice the time sharpening your axe. * [[Vimrc|vimrc files]] == Code Humor == Put this into your makefile: <source lang=bash> Clint\ Eastwood: myday echo "I feel great!" </source> cbab679326a03f5d50d19f1574b36e621d779c1e Silmaril 0 51 534 262 2017-01-04T05:10:04Z David M. Rogers 2 wikitext text/x-wiki The Silmaril programming language is built from the ground up for bleeding edge HPC. It has the following, fully automatic, killer features: * Git-like source code versioning * Cryptographically secure, distributed filesystem storage * First-class objects ** functions ** types ** modules (aka. tables / record types / directories / structs / ML "Functors") * Extensible primitive operations (JIT C-compilation) * Extensible binary object types (i.e. opaque pointers) This documentation explains how to get up and running with the latest distribution. To interact with the server, you'll need an rsa key. The process for creating one is easy: <source lang="bash"> mkdir ~/.sil chmod 0700 ~/.sil sil generate "Your Name" "email@example.com" >~/.sil/config </source> This will set up your sil environment with a new identity and server. Next, send your name and public key (from that file) to me by email. Now, you are ready to create a new sil project! From a new directory, run git init git remote add --track master origin git@github.com:<username>/<project name>.git echo '"Hello world!"' >hello.sil This has created a new project with a simple hello world file. Next, you will need to compile the project using: sil compile This will parse the entire commit into sil object code, and sent it to the server. Compilation writes the sil.sha1 file as a side-effect. This file contains the id of the project source, and is used for communicating with the server. With setup out of the way, it's time to write some sil code! You can get started by reading the docs and examples: ([http://predictivestatmech.org/sil/docs/html/]). <!-- and following along with the [http://predictivestatmech.org/sil/tour.html tutorial].--> 2df6339d7ca3d992800b5a4f7a4ec272bf016f57 535 534 2017-01-04T16:20:17Z David M. Rogers 2 wikitext text/x-wiki The Silmaril programming language is built from the ground up for bleeding edge HPC. It has the following, fully automatic, killer features: * Git-like source code versioning * Cryptographically secure, distributed filesystem storage * First-class objects ** functions ** types ** modules (aka. tables / record types / directories / structs / ML "Functors") * Extensible primitive operations (JIT C-compilation) * Extensible binary object types (i.e. opaque pointers) This documentation explains how to get up and running with the latest distribution. To interact with the server, you'll need an rsa key. The process for creating one is easy: <source lang="bash"> mkdir ~/.sil chmod 0700 ~/.sil sil generate "Your Name" "email@example.com" >~/.sil/config </source> This will set up your sil environment with a new identity and server. Next, send your name and public key (from that file) to me by email. Now, you are ready to create a new sil project! From a new directory, run <source lang="bash"> git init git remote add --track master origin git@github.com:<username>/<project name>.git echo '"Hello world!"' >hello.sil </source> This has created a new project with a simple hello world file. Next, you will need to compile the project using: <source lang="bash"> sil compile </source> This will parse the entire commit into sil object code, and sent it to the server. Compilation writes the sil.sha1 file as a side-effect. This file contains the id of the project source, and is used for communicating with the server. With setup out of the way, it's time to write some sil code! You can get started by reading the docs and examples: ([http://predictivestatmech.org/sil/docs/html/]). <!-- and following along with the [http://predictivestatmech.org/sil/tour.html tutorial].--> db3102683c64153d09a308b0e253f5a728320fd0 CompSciSpring2017 0 122 536 2017-01-09T15:15:17Z David M. Rogers 2 Created page with "'''<BIG>Introduction to Scientific Computing</BIG>''' Course Info * Course Numbers CHM 4932-004/6938-010, CRN: 21864/21865 * Credit Hours: 3 * Meeting Dates: January 9 - Apri..." wikitext text/x-wiki '''<BIG>Introduction to Scientific Computing</BIG>''' Course Info * Course Numbers CHM 4932-004/6938-010, CRN: 21864/21865 * Credit Hours: 3 * Meeting Dates: January 9 - April 26, 2017 ** No Class Jan. 16 or Mar. 13-17 * Meeting Times: Mon. and Wed., 12:30-13:45 in SCA 222 ** Lab Session & Office Hours: Fri. 12:30-13:45 in IDR 214 (or SCA 222 by announcement) == Overview == Mathematical models in the natural sciences take many shapes and forms. The moment they become more complicated than tracking a few variables over time, we have to put away our Excel spreadsheets and make use of a solid foundation in computational science. The course establishes this foundation by introducing data structures and algorithms used in everyday scientific computing using examples in the python scripting language. By the end of the Semester, students will be able to navigate the Linux command-line to go from a mathematical model to a numerical solution. Best practices for working with computer code and visualizing data will also be covered. == Topics == # Languages #* bash (shell) #* python (scripting) #* stack & register-based machine languages: overview of C and Fortran syntax & compiling with gcc, ‘thread safety’ #* Shared libraries & language inter-operability (FFI) # Algorithms #* Horner’s algorithm for polynomials #* Newton’s root finding algo. #* Overview of general optimization algo-s (example: linear & nonlin. least-squares) #* Numerical integration (scripted, plus gnu ODE) #* Communication (how HTTP get/put works) # Data Structures #* Linked Lists #* Trees (file system hierarchies) #* Graphs #* Arrays (dense & sparse) example: vectors & rotations / transpositions, densities and difference operators # Presentation & visualization #* Flat CSV files (and excel) #* Working with binary data #* Python matplotlib (2D images) #* Binning histograms & weighted averages # Best Practices #* High-level code design (modularity, interface specifications, unit testing, etc.) #* Code audit: open-source libraries, ex. Gnu Scientific Library, qsort in libc, Boost #* Source code versioning (example: git or mercurial) #* gdb & execution profiling #* documentation #* Makefiles == Grading == '''Grading Scale (out of 400 points possible)''' {| class="wikitable" |- ! Grade ! Undergraduate ! Graduate |- | A | 230 | 300 |- | B | 180 | 230 |- | C | 150 | 180 |- | D | 120 | 150 |} * Points Possible: ** 10 homework assignments (20 points per homework) ** 2 projects / competitions (100 points per project) * Homework Rules ** For work done in groups, credit is divided equally among participants - so the max homework grade for a group of 2 is 10 points each. ** For each homework, 1 re-do at full credit can be sent at any time after the due date, but must present a unique solution to previous work from yourself or others. ** All work must cite co-group members (if any) and the source of any code snippets used online. === Grading Rationale === Homework points will only be awarded for correct, working code and correct algorithmic analysis, while the homework problems will become progressively tougher. Undergraduates should be able to pass the course with an A if they have correctly answered most of the homework, and made a strong attempt at one of the projects. Graduate students should both perform well on the homework and successfully complete one or two projects. Essentially, this means you should do your own homework when possible and may do a project in a small group. The re-grading and group options for homework allow making up for missed assignments, and encourage returning to core concepts at a later point in the class. Students who have completed significant portions of the homework have thus demonstrated programming proficiency, and are qualified for at least B/C grades. == Projects == TBA - see previous years (e.g. [[CompSciSpring2016]]) for a general idea. == Textbooks and Resources == * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-0072-7 Beginning Python, Hetland, 2005] (eBook avail. from USF Library) * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-3238-4 Python Algorithms, Hetland, 2010] (eBook avail. from USF Library) * [http://aosabook.org/en/index.html The Architecture of Open Source Applications] * [http://docs.python.org Python Documentation] * [https://developers.google.com/edu/python/ Google Introductory Python Notes] * [http://huffman.sourceforge.net/tao/tao-of-programming.html Tao of Programming] Other (possibly useful) materials: * [http://hackersdictionary.com/html/entry/larval-stage.html The Jargon File] * Chapters 7&8 of Modelling and Simulation, Birta and Arbez, Springer 2007 (eBook avail. from USF Library). * Chapters 4-6 of Models and Algorithms for Intelligent Data Analysis, Runkler, Springer 2012 (eBook avail. from USF Library). * Guide to Scientific Computing in C++, Francis and Whiteley, Springer, 2012. (eBook avail. from USF Library) * Extra info. On the basics: ** Chapters 3 and 7 of Mathematics in Computing, Regan, Springer 2013. (eBook avail. from USF Library) ** Instant feedback graphical programming with [https://www.khanacademy.org/cs/programming/ Khan Academy] * [http://www.meetup.com/python-178/ Local PyBulls Meetings] Code: * [http://carsonfarmer.com/2013/07/essential-python-geo-libraries Python Libraries Useful for Geospatial Problems] * [[Code#Python_Libraries|Python Libraries Useful for Computational Chemistry]] (very small list at present) Interactive Interpreters: * [http://www.codewars.com CodeWars] Recommended for building experience with practice problems. * [http://codecombat.com/ CodeCombat] A very visual way to interact with your python code. * [http://exercism.io Exercism] A command-line client with a similar learn-through-challenge philosophy. * [http://repl.it repl.it] A read-eval-print loop for several computer languages. * [http://en.cppreference.com/w/cpp/language CppReference] Documentation with an online evaluator for C++ code. === Notes === * In-Class Examples === Homework === * Homework will be assigned through [https://repl.it/classroom/invite/BtxEVLe Repl.IT] e315bc52ccdb8f9141ec2079d08e4f320f05cd65 539 536 2017-01-11T15:50:02Z David M. Rogers 2 /* Notes */ wikitext text/x-wiki '''<BIG>Introduction to Scientific Computing</BIG>''' Course Info * Course Numbers CHM 4932-004/6938-010, CRN: 21864/21865 * Credit Hours: 3 * Meeting Dates: January 9 - April 26, 2017 ** No Class Jan. 16 or Mar. 13-17 * Meeting Times: Mon. and Wed., 12:30-13:45 in SCA 222 ** Lab Session & Office Hours: Fri. 12:30-13:45 in IDR 214 (or SCA 222 by announcement) == Overview == Mathematical models in the natural sciences take many shapes and forms. The moment they become more complicated than tracking a few variables over time, we have to put away our Excel spreadsheets and make use of a solid foundation in computational science. The course establishes this foundation by introducing data structures and algorithms used in everyday scientific computing using examples in the python scripting language. By the end of the Semester, students will be able to navigate the Linux command-line to go from a mathematical model to a numerical solution. Best practices for working with computer code and visualizing data will also be covered. == Topics == # Languages #* bash (shell) #* python (scripting) #* stack & register-based machine languages: overview of C and Fortran syntax & compiling with gcc, ‘thread safety’ #* Shared libraries & language inter-operability (FFI) # Algorithms #* Horner’s algorithm for polynomials #* Newton’s root finding algo. #* Overview of general optimization algo-s (example: linear & nonlin. least-squares) #* Numerical integration (scripted, plus gnu ODE) #* Communication (how HTTP get/put works) # Data Structures #* Linked Lists #* Trees (file system hierarchies) #* Graphs #* Arrays (dense & sparse) example: vectors & rotations / transpositions, densities and difference operators # Presentation & visualization #* Flat CSV files (and excel) #* Working with binary data #* Python matplotlib (2D images) #* Binning histograms & weighted averages # Best Practices #* High-level code design (modularity, interface specifications, unit testing, etc.) #* Code audit: open-source libraries, ex. Gnu Scientific Library, qsort in libc, Boost #* Source code versioning (example: git or mercurial) #* gdb & execution profiling #* documentation #* Makefiles == Grading == '''Grading Scale (out of 400 points possible)''' {| class="wikitable" |- ! Grade ! Undergraduate ! Graduate |- | A | 230 | 300 |- | B | 180 | 230 |- | C | 150 | 180 |- | D | 120 | 150 |} * Points Possible: ** 10 homework assignments (20 points per homework) ** 2 projects / competitions (100 points per project) * Homework Rules ** For work done in groups, credit is divided equally among participants - so the max homework grade for a group of 2 is 10 points each. ** For each homework, 1 re-do at full credit can be sent at any time after the due date, but must present a unique solution to previous work from yourself or others. ** All work must cite co-group members (if any) and the source of any code snippets used online. === Grading Rationale === Homework points will only be awarded for correct, working code and correct algorithmic analysis, while the homework problems will become progressively tougher. Undergraduates should be able to pass the course with an A if they have correctly answered most of the homework, and made a strong attempt at one of the projects. Graduate students should both perform well on the homework and successfully complete one or two projects. Essentially, this means you should do your own homework when possible and may do a project in a small group. The re-grading and group options for homework allow making up for missed assignments, and encourage returning to core concepts at a later point in the class. Students who have completed significant portions of the homework have thus demonstrated programming proficiency, and are qualified for at least B/C grades. == Projects == TBA - see previous years (e.g. [[CompSciSpring2016]]) for a general idea. == Textbooks and Resources == * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-0072-7 Beginning Python, Hetland, 2005] (eBook avail. from USF Library) * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-3238-4 Python Algorithms, Hetland, 2010] (eBook avail. from USF Library) * [http://aosabook.org/en/index.html The Architecture of Open Source Applications] * [http://docs.python.org Python Documentation] * [https://developers.google.com/edu/python/ Google Introductory Python Notes] * [http://huffman.sourceforge.net/tao/tao-of-programming.html Tao of Programming] Other (possibly useful) materials: * [http://hackersdictionary.com/html/entry/larval-stage.html The Jargon File] * Chapters 7&8 of Modelling and Simulation, Birta and Arbez, Springer 2007 (eBook avail. from USF Library). * Chapters 4-6 of Models and Algorithms for Intelligent Data Analysis, Runkler, Springer 2012 (eBook avail. from USF Library). * Guide to Scientific Computing in C++, Francis and Whiteley, Springer, 2012. (eBook avail. from USF Library) * Extra info. On the basics: ** Chapters 3 and 7 of Mathematics in Computing, Regan, Springer 2013. (eBook avail. from USF Library) ** Instant feedback graphical programming with [https://www.khanacademy.org/cs/programming/ Khan Academy] * [http://www.meetup.com/python-178/ Local PyBulls Meetings] Code: * [http://carsonfarmer.com/2013/07/essential-python-geo-libraries Python Libraries Useful for Geospatial Problems] * [[Code#Python_Libraries|Python Libraries Useful for Computational Chemistry]] (very small list at present) Interactive Interpreters: * [http://www.codewars.com CodeWars] Recommended for building experience with practice problems. * [http://codecombat.com/ CodeCombat] A very visual way to interact with your python code. * [http://exercism.io Exercism] A command-line client with a similar learn-through-challenge philosophy. * [http://repl.it repl.it] A read-eval-print loop for several computer languages. * [http://en.cppreference.com/w/cpp/language CppReference] Documentation with an online evaluator for C++ code. === Notes === * In-Class Examples ** Acting out the Turing Machine [[Media:Turing.doc]] === Homework === * Homework will be assigned through [https://repl.it/classroom/invite/BtxEVLe Repl.IT] 45a5600d83a1ed47201579b31b0ad637ac138187 541 539 2017-01-11T15:54:19Z David M. Rogers 2 /* Notes */ wikitext text/x-wiki '''<BIG>Introduction to Scientific Computing</BIG>''' Course Info * Course Numbers CHM 4932-004/6938-010, CRN: 21864/21865 * Credit Hours: 3 * Meeting Dates: January 9 - April 26, 2017 ** No Class Jan. 16 or Mar. 13-17 * Meeting Times: Mon. and Wed., 12:30-13:45 in SCA 222 ** Lab Session & Office Hours: Fri. 12:30-13:45 in IDR 214 (or SCA 222 by announcement) == Overview == Mathematical models in the natural sciences take many shapes and forms. The moment they become more complicated than tracking a few variables over time, we have to put away our Excel spreadsheets and make use of a solid foundation in computational science. The course establishes this foundation by introducing data structures and algorithms used in everyday scientific computing using examples in the python scripting language. By the end of the Semester, students will be able to navigate the Linux command-line to go from a mathematical model to a numerical solution. Best practices for working with computer code and visualizing data will also be covered. == Topics == # Languages #* bash (shell) #* python (scripting) #* stack & register-based machine languages: overview of C and Fortran syntax & compiling with gcc, ‘thread safety’ #* Shared libraries & language inter-operability (FFI) # Algorithms #* Horner’s algorithm for polynomials #* Newton’s root finding algo. #* Overview of general optimization algo-s (example: linear & nonlin. least-squares) #* Numerical integration (scripted, plus gnu ODE) #* Communication (how HTTP get/put works) # Data Structures #* Linked Lists #* Trees (file system hierarchies) #* Graphs #* Arrays (dense & sparse) example: vectors & rotations / transpositions, densities and difference operators # Presentation & visualization #* Flat CSV files (and excel) #* Working with binary data #* Python matplotlib (2D images) #* Binning histograms & weighted averages # Best Practices #* High-level code design (modularity, interface specifications, unit testing, etc.) #* Code audit: open-source libraries, ex. Gnu Scientific Library, qsort in libc, Boost #* Source code versioning (example: git or mercurial) #* gdb & execution profiling #* documentation #* Makefiles == Grading == '''Grading Scale (out of 400 points possible)''' {| class="wikitable" |- ! Grade ! Undergraduate ! Graduate |- | A | 230 | 300 |- | B | 180 | 230 |- | C | 150 | 180 |- | D | 120 | 150 |} * Points Possible: ** 10 homework assignments (20 points per homework) ** 2 projects / competitions (100 points per project) * Homework Rules ** For work done in groups, credit is divided equally among participants - so the max homework grade for a group of 2 is 10 points each. ** For each homework, 1 re-do at full credit can be sent at any time after the due date, but must present a unique solution to previous work from yourself or others. ** All work must cite co-group members (if any) and the source of any code snippets used online. === Grading Rationale === Homework points will only be awarded for correct, working code and correct algorithmic analysis, while the homework problems will become progressively tougher. Undergraduates should be able to pass the course with an A if they have correctly answered most of the homework, and made a strong attempt at one of the projects. Graduate students should both perform well on the homework and successfully complete one or two projects. Essentially, this means you should do your own homework when possible and may do a project in a small group. The re-grading and group options for homework allow making up for missed assignments, and encourage returning to core concepts at a later point in the class. Students who have completed significant portions of the homework have thus demonstrated programming proficiency, and are qualified for at least B/C grades. == Projects == TBA - see previous years (e.g. [[CompSciSpring2016]]) for a general idea. == Textbooks and Resources == * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-0072-7 Beginning Python, Hetland, 2005] (eBook avail. from USF Library) * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-3238-4 Python Algorithms, Hetland, 2010] (eBook avail. from USF Library) * [http://aosabook.org/en/index.html The Architecture of Open Source Applications] * [http://docs.python.org Python Documentation] * [https://developers.google.com/edu/python/ Google Introductory Python Notes] * [http://huffman.sourceforge.net/tao/tao-of-programming.html Tao of Programming] Other (possibly useful) materials: * [http://hackersdictionary.com/html/entry/larval-stage.html The Jargon File] * Chapters 7&8 of Modelling and Simulation, Birta and Arbez, Springer 2007 (eBook avail. from USF Library). * Chapters 4-6 of Models and Algorithms for Intelligent Data Analysis, Runkler, Springer 2012 (eBook avail. from USF Library). * Guide to Scientific Computing in C++, Francis and Whiteley, Springer, 2012. (eBook avail. from USF Library) * Extra info. On the basics: ** Chapters 3 and 7 of Mathematics in Computing, Regan, Springer 2013. (eBook avail. from USF Library) ** Instant feedback graphical programming with [https://www.khanacademy.org/cs/programming/ Khan Academy] * [http://www.meetup.com/python-178/ Local PyBulls Meetings] Code: * [http://carsonfarmer.com/2013/07/essential-python-geo-libraries Python Libraries Useful for Geospatial Problems] * [[Code#Python_Libraries|Python Libraries Useful for Computational Chemistry]] (very small list at present) Interactive Interpreters: * [http://www.codewars.com CodeWars] Recommended for building experience with practice problems. * [http://codecombat.com/ CodeCombat] A very visual way to interact with your python code. * [http://exercism.io Exercism] A command-line client with a similar learn-through-challenge philosophy. * [http://repl.it repl.it] A read-eval-print loop for several computer languages. * [http://en.cppreference.com/w/cpp/language CppReference] Documentation with an online evaluator for C++ code. === Notes === * In-Class Examples ** [[Turing Exercise]] === Homework === * Homework will be assigned through [https://repl.it/classroom/invite/BtxEVLe Repl.IT] 8c5c17d5afc77e83a4d67a1e153859bbb8e408fd 542 541 2017-01-18T14:25:45Z David M. Rogers 2 /* Homework */ wikitext text/x-wiki '''<BIG>Introduction to Scientific Computing</BIG>''' Course Info * Course Numbers CHM 4932-004/6938-010, CRN: 21864/21865 * Credit Hours: 3 * Meeting Dates: January 9 - April 26, 2017 ** No Class Jan. 16 or Mar. 13-17 * Meeting Times: Mon. and Wed., 12:30-13:45 in SCA 222 ** Lab Session & Office Hours: Fri. 12:30-13:45 in IDR 214 (or SCA 222 by announcement) == Overview == Mathematical models in the natural sciences take many shapes and forms. The moment they become more complicated than tracking a few variables over time, we have to put away our Excel spreadsheets and make use of a solid foundation in computational science. The course establishes this foundation by introducing data structures and algorithms used in everyday scientific computing using examples in the python scripting language. By the end of the Semester, students will be able to navigate the Linux command-line to go from a mathematical model to a numerical solution. Best practices for working with computer code and visualizing data will also be covered. == Topics == # Languages #* bash (shell) #* python (scripting) #* stack & register-based machine languages: overview of C and Fortran syntax & compiling with gcc, ‘thread safety’ #* Shared libraries & language inter-operability (FFI) # Algorithms #* Horner’s algorithm for polynomials #* Newton’s root finding algo. #* Overview of general optimization algo-s (example: linear & nonlin. least-squares) #* Numerical integration (scripted, plus gnu ODE) #* Communication (how HTTP get/put works) # Data Structures #* Linked Lists #* Trees (file system hierarchies) #* Graphs #* Arrays (dense & sparse) example: vectors & rotations / transpositions, densities and difference operators # Presentation & visualization #* Flat CSV files (and excel) #* Working with binary data #* Python matplotlib (2D images) #* Binning histograms & weighted averages # Best Practices #* High-level code design (modularity, interface specifications, unit testing, etc.) #* Code audit: open-source libraries, ex. Gnu Scientific Library, qsort in libc, Boost #* Source code versioning (example: git or mercurial) #* gdb & execution profiling #* documentation #* Makefiles == Grading == '''Grading Scale (out of 400 points possible)''' {| class="wikitable" |- ! Grade ! Undergraduate ! Graduate |- | A | 230 | 300 |- | B | 180 | 230 |- | C | 150 | 180 |- | D | 120 | 150 |} * Points Possible: ** 10 homework assignments (20 points per homework) ** 2 projects / competitions (100 points per project) * Homework Rules ** For work done in groups, credit is divided equally among participants - so the max homework grade for a group of 2 is 10 points each. ** For each homework, 1 re-do at full credit can be sent at any time after the due date, but must present a unique solution to previous work from yourself or others. ** All work must cite co-group members (if any) and the source of any code snippets used online. === Grading Rationale === Homework points will only be awarded for correct, working code and correct algorithmic analysis, while the homework problems will become progressively tougher. Undergraduates should be able to pass the course with an A if they have correctly answered most of the homework, and made a strong attempt at one of the projects. Graduate students should both perform well on the homework and successfully complete one or two projects. Essentially, this means you should do your own homework when possible and may do a project in a small group. The re-grading and group options for homework allow making up for missed assignments, and encourage returning to core concepts at a later point in the class. Students who have completed significant portions of the homework have thus demonstrated programming proficiency, and are qualified for at least B/C grades. == Projects == TBA - see previous years (e.g. [[CompSciSpring2016]]) for a general idea. == Textbooks and Resources == * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-0072-7 Beginning Python, Hetland, 2005] (eBook avail. from USF Library) * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-3238-4 Python Algorithms, Hetland, 2010] (eBook avail. from USF Library) * [http://aosabook.org/en/index.html The Architecture of Open Source Applications] * [http://docs.python.org Python Documentation] * [https://developers.google.com/edu/python/ Google Introductory Python Notes] * [http://huffman.sourceforge.net/tao/tao-of-programming.html Tao of Programming] Other (possibly useful) materials: * [http://hackersdictionary.com/html/entry/larval-stage.html The Jargon File] * Chapters 7&8 of Modelling and Simulation, Birta and Arbez, Springer 2007 (eBook avail. from USF Library). * Chapters 4-6 of Models and Algorithms for Intelligent Data Analysis, Runkler, Springer 2012 (eBook avail. from USF Library). * Guide to Scientific Computing in C++, Francis and Whiteley, Springer, 2012. (eBook avail. from USF Library) * Extra info. On the basics: ** Chapters 3 and 7 of Mathematics in Computing, Regan, Springer 2013. (eBook avail. from USF Library) ** Instant feedback graphical programming with [https://www.khanacademy.org/cs/programming/ Khan Academy] * [http://www.meetup.com/python-178/ Local PyBulls Meetings] Code: * [http://carsonfarmer.com/2013/07/essential-python-geo-libraries Python Libraries Useful for Geospatial Problems] * [[Code#Python_Libraries|Python Libraries Useful for Computational Chemistry]] (very small list at present) Interactive Interpreters: * [http://www.codewars.com CodeWars] Recommended for building experience with practice problems. * [http://codecombat.com/ CodeCombat] A very visual way to interact with your python code. * [http://exercism.io Exercism] A command-line client with a similar learn-through-challenge philosophy. * [http://repl.it repl.it] A read-eval-print loop for several computer languages. * [http://en.cppreference.com/w/cpp/language CppReference] Documentation with an online evaluator for C++ code. === Notes === * In-Class Examples ** [[Turing Exercise]] === Homework === * Homework will be assigned through [https://repl.it/classroom/invite/BtxEVLe Repl.IT] ** Homework 1 is due Friday, Jan. 20 ** Homework 2 is due Friday, Jan 27 c05196ef4f2792512e25073a9e3a112337dea928 543 542 2017-01-18T17:13:10Z David M. Rogers 2 /* Notes */ wikitext text/x-wiki '''<BIG>Introduction to Scientific Computing</BIG>''' Course Info * Course Numbers CHM 4932-004/6938-010, CRN: 21864/21865 * Credit Hours: 3 * Meeting Dates: January 9 - April 26, 2017 ** No Class Jan. 16 or Mar. 13-17 * Meeting Times: Mon. and Wed., 12:30-13:45 in SCA 222 ** Lab Session & Office Hours: Fri. 12:30-13:45 in IDR 214 (or SCA 222 by announcement) == Overview == Mathematical models in the natural sciences take many shapes and forms. The moment they become more complicated than tracking a few variables over time, we have to put away our Excel spreadsheets and make use of a solid foundation in computational science. The course establishes this foundation by introducing data structures and algorithms used in everyday scientific computing using examples in the python scripting language. By the end of the Semester, students will be able to navigate the Linux command-line to go from a mathematical model to a numerical solution. Best practices for working with computer code and visualizing data will also be covered. == Topics == # Languages #* bash (shell) #* python (scripting) #* stack & register-based machine languages: overview of C and Fortran syntax & compiling with gcc, ‘thread safety’ #* Shared libraries & language inter-operability (FFI) # Algorithms #* Horner’s algorithm for polynomials #* Newton’s root finding algo. #* Overview of general optimization algo-s (example: linear & nonlin. least-squares) #* Numerical integration (scripted, plus gnu ODE) #* Communication (how HTTP get/put works) # Data Structures #* Linked Lists #* Trees (file system hierarchies) #* Graphs #* Arrays (dense & sparse) example: vectors & rotations / transpositions, densities and difference operators # Presentation & visualization #* Flat CSV files (and excel) #* Working with binary data #* Python matplotlib (2D images) #* Binning histograms & weighted averages # Best Practices #* High-level code design (modularity, interface specifications, unit testing, etc.) #* Code audit: open-source libraries, ex. Gnu Scientific Library, qsort in libc, Boost #* Source code versioning (example: git or mercurial) #* gdb & execution profiling #* documentation #* Makefiles == Grading == '''Grading Scale (out of 400 points possible)''' {| class="wikitable" |- ! Grade ! Undergraduate ! Graduate |- | A | 230 | 300 |- | B | 180 | 230 |- | C | 150 | 180 |- | D | 120 | 150 |} * Points Possible: ** 10 homework assignments (20 points per homework) ** 2 projects / competitions (100 points per project) * Homework Rules ** For work done in groups, credit is divided equally among participants - so the max homework grade for a group of 2 is 10 points each. ** For each homework, 1 re-do at full credit can be sent at any time after the due date, but must present a unique solution to previous work from yourself or others. ** All work must cite co-group members (if any) and the source of any code snippets used online. === Grading Rationale === Homework points will only be awarded for correct, working code and correct algorithmic analysis, while the homework problems will become progressively tougher. Undergraduates should be able to pass the course with an A if they have correctly answered most of the homework, and made a strong attempt at one of the projects. Graduate students should both perform well on the homework and successfully complete one or two projects. Essentially, this means you should do your own homework when possible and may do a project in a small group. The re-grading and group options for homework allow making up for missed assignments, and encourage returning to core concepts at a later point in the class. Students who have completed significant portions of the homework have thus demonstrated programming proficiency, and are qualified for at least B/C grades. == Projects == TBA - see previous years (e.g. [[CompSciSpring2016]]) for a general idea. == Textbooks and Resources == * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-0072-7 Beginning Python, Hetland, 2005] (eBook avail. from USF Library) * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-3238-4 Python Algorithms, Hetland, 2010] (eBook avail. from USF Library) * [http://aosabook.org/en/index.html The Architecture of Open Source Applications] * [http://docs.python.org Python Documentation] * [https://developers.google.com/edu/python/ Google Introductory Python Notes] * [http://huffman.sourceforge.net/tao/tao-of-programming.html Tao of Programming] Other (possibly useful) materials: * [http://hackersdictionary.com/html/entry/larval-stage.html The Jargon File] * Chapters 7&8 of Modelling and Simulation, Birta and Arbez, Springer 2007 (eBook avail. from USF Library). * Chapters 4-6 of Models and Algorithms for Intelligent Data Analysis, Runkler, Springer 2012 (eBook avail. from USF Library). * Guide to Scientific Computing in C++, Francis and Whiteley, Springer, 2012. (eBook avail. from USF Library) * Extra info. On the basics: ** Chapters 3 and 7 of Mathematics in Computing, Regan, Springer 2013. (eBook avail. from USF Library) ** Instant feedback graphical programming with [https://www.khanacademy.org/cs/programming/ Khan Academy] * [http://www.meetup.com/python-178/ Local PyBulls Meetings] Code: * [http://carsonfarmer.com/2013/07/essential-python-geo-libraries Python Libraries Useful for Geospatial Problems] * [[Code#Python_Libraries|Python Libraries Useful for Computational Chemistry]] (very small list at present) Interactive Interpreters: * [http://www.codewars.com CodeWars] Recommended for building experience with practice problems. * [http://codecombat.com/ CodeCombat] A very visual way to interact with your python code. * [http://exercism.io Exercism] A command-line client with a similar learn-through-challenge philosophy. * [http://repl.it repl.it] A read-eval-print loop for several computer languages. * [http://en.cppreference.com/w/cpp/language CppReference] Documentation with an online evaluator for C++ code. === Notes === * In-Class Examples ** [[Turing Exercise]] ** [[Media:Week2-2017.pdf]] === Homework === * Homework will be assigned through [https://repl.it/classroom/invite/BtxEVLe Repl.IT] ** Homework 1 is due Friday, Jan. 20 ** Homework 2 is due Friday, Jan 27 2315eb6f57dd5a63aa7277e192a170b1f8688562 546 543 2017-01-25T16:55:38Z David M. Rogers 2 /* Notes */ wikitext text/x-wiki '''<BIG>Introduction to Scientific Computing</BIG>''' Course Info * Course Numbers CHM 4932-004/6938-010, CRN: 21864/21865 * Credit Hours: 3 * Meeting Dates: January 9 - April 26, 2017 ** No Class Jan. 16 or Mar. 13-17 * Meeting Times: Mon. and Wed., 12:30-13:45 in SCA 222 ** Lab Session & Office Hours: Fri. 12:30-13:45 in IDR 214 (or SCA 222 by announcement) == Overview == Mathematical models in the natural sciences take many shapes and forms. The moment they become more complicated than tracking a few variables over time, we have to put away our Excel spreadsheets and make use of a solid foundation in computational science. The course establishes this foundation by introducing data structures and algorithms used in everyday scientific computing using examples in the python scripting language. By the end of the Semester, students will be able to navigate the Linux command-line to go from a mathematical model to a numerical solution. Best practices for working with computer code and visualizing data will also be covered. == Topics == # Languages #* bash (shell) #* python (scripting) #* stack & register-based machine languages: overview of C and Fortran syntax & compiling with gcc, ‘thread safety’ #* Shared libraries & language inter-operability (FFI) # Algorithms #* Horner’s algorithm for polynomials #* Newton’s root finding algo. #* Overview of general optimization algo-s (example: linear & nonlin. least-squares) #* Numerical integration (scripted, plus gnu ODE) #* Communication (how HTTP get/put works) # Data Structures #* Linked Lists #* Trees (file system hierarchies) #* Graphs #* Arrays (dense & sparse) example: vectors & rotations / transpositions, densities and difference operators # Presentation & visualization #* Flat CSV files (and excel) #* Working with binary data #* Python matplotlib (2D images) #* Binning histograms & weighted averages # Best Practices #* High-level code design (modularity, interface specifications, unit testing, etc.) #* Code audit: open-source libraries, ex. Gnu Scientific Library, qsort in libc, Boost #* Source code versioning (example: git or mercurial) #* gdb & execution profiling #* documentation #* Makefiles == Grading == '''Grading Scale (out of 400 points possible)''' {| class="wikitable" |- ! Grade ! Undergraduate ! Graduate |- | A | 230 | 300 |- | B | 180 | 230 |- | C | 150 | 180 |- | D | 120 | 150 |} * Points Possible: ** 10 homework assignments (20 points per homework) ** 2 projects / competitions (100 points per project) * Homework Rules ** For work done in groups, credit is divided equally among participants - so the max homework grade for a group of 2 is 10 points each. ** For each homework, 1 re-do at full credit can be sent at any time after the due date, but must present a unique solution to previous work from yourself or others. ** All work must cite co-group members (if any) and the source of any code snippets used online. === Grading Rationale === Homework points will only be awarded for correct, working code and correct algorithmic analysis, while the homework problems will become progressively tougher. Undergraduates should be able to pass the course with an A if they have correctly answered most of the homework, and made a strong attempt at one of the projects. Graduate students should both perform well on the homework and successfully complete one or two projects. Essentially, this means you should do your own homework when possible and may do a project in a small group. The re-grading and group options for homework allow making up for missed assignments, and encourage returning to core concepts at a later point in the class. Students who have completed significant portions of the homework have thus demonstrated programming proficiency, and are qualified for at least B/C grades. == Projects == TBA - see previous years (e.g. [[CompSciSpring2016]]) for a general idea. == Textbooks and Resources == * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-0072-7 Beginning Python, Hetland, 2005] (eBook avail. from USF Library) * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-3238-4 Python Algorithms, Hetland, 2010] (eBook avail. from USF Library) * [http://aosabook.org/en/index.html The Architecture of Open Source Applications] * [http://docs.python.org Python Documentation] * [https://developers.google.com/edu/python/ Google Introductory Python Notes] * [http://huffman.sourceforge.net/tao/tao-of-programming.html Tao of Programming] Other (possibly useful) materials: * [http://hackersdictionary.com/html/entry/larval-stage.html The Jargon File] * Chapters 7&8 of Modelling and Simulation, Birta and Arbez, Springer 2007 (eBook avail. from USF Library). * Chapters 4-6 of Models and Algorithms for Intelligent Data Analysis, Runkler, Springer 2012 (eBook avail. from USF Library). * Guide to Scientific Computing in C++, Francis and Whiteley, Springer, 2012. (eBook avail. from USF Library) * Extra info. On the basics: ** Chapters 3 and 7 of Mathematics in Computing, Regan, Springer 2013. (eBook avail. from USF Library) ** Instant feedback graphical programming with [https://www.khanacademy.org/cs/programming/ Khan Academy] * [http://www.meetup.com/python-178/ Local PyBulls Meetings] Code: * [http://carsonfarmer.com/2013/07/essential-python-geo-libraries Python Libraries Useful for Geospatial Problems] * [[Code#Python_Libraries|Python Libraries Useful for Computational Chemistry]] (very small list at present) Interactive Interpreters: * [http://www.codewars.com CodeWars] Recommended for building experience with practice problems. * [http://codecombat.com/ CodeCombat] A very visual way to interact with your python code. * [http://exercism.io Exercism] A command-line client with a similar learn-through-challenge philosophy. * [http://repl.it repl.it] A read-eval-print loop for several computer languages. * [http://en.cppreference.com/w/cpp/language CppReference] Documentation with an online evaluator for C++ code. === Notes === * In-Class Examples ** [[Turing Exercise]] ** [[Media:Week2-2017.pdf]] ** [https://predictivestatmech.org/code/example.dcd Example DCD File] === Homework === * Homework will be assigned through [https://repl.it/classroom/invite/BtxEVLe Repl.IT] ** Homework 1 is due Friday, Jan. 20 ** Homework 2 is due Friday, Jan 27 addcedc114281a6f47f6c704a790000ebe744c7d 548 546 2017-02-01T16:56:10Z David M. Rogers 2 /* Notes */ wikitext text/x-wiki '''<BIG>Introduction to Scientific Computing</BIG>''' Course Info * Course Numbers CHM 4932-004/6938-010, CRN: 21864/21865 * Credit Hours: 3 * Meeting Dates: January 9 - April 26, 2017 ** No Class Jan. 16 or Mar. 13-17 * Meeting Times: Mon. and Wed., 12:30-13:45 in SCA 222 ** Lab Session & Office Hours: Fri. 12:30-13:45 in IDR 214 (or SCA 222 by announcement) == Overview == Mathematical models in the natural sciences take many shapes and forms. The moment they become more complicated than tracking a few variables over time, we have to put away our Excel spreadsheets and make use of a solid foundation in computational science. The course establishes this foundation by introducing data structures and algorithms used in everyday scientific computing using examples in the python scripting language. By the end of the Semester, students will be able to navigate the Linux command-line to go from a mathematical model to a numerical solution. Best practices for working with computer code and visualizing data will also be covered. == Topics == # Languages #* bash (shell) #* python (scripting) #* stack & register-based machine languages: overview of C and Fortran syntax & compiling with gcc, ‘thread safety’ #* Shared libraries & language inter-operability (FFI) # Algorithms #* Horner’s algorithm for polynomials #* Newton’s root finding algo. #* Overview of general optimization algo-s (example: linear & nonlin. least-squares) #* Numerical integration (scripted, plus gnu ODE) #* Communication (how HTTP get/put works) # Data Structures #* Linked Lists #* Trees (file system hierarchies) #* Graphs #* Arrays (dense & sparse) example: vectors & rotations / transpositions, densities and difference operators # Presentation & visualization #* Flat CSV files (and excel) #* Working with binary data #* Python matplotlib (2D images) #* Binning histograms & weighted averages # Best Practices #* High-level code design (modularity, interface specifications, unit testing, etc.) #* Code audit: open-source libraries, ex. Gnu Scientific Library, qsort in libc, Boost #* Source code versioning (example: git or mercurial) #* gdb & execution profiling #* documentation #* Makefiles == Grading == '''Grading Scale (out of 400 points possible)''' {| class="wikitable" |- ! Grade ! Undergraduate ! Graduate |- | A | 230 | 300 |- | B | 180 | 230 |- | C | 150 | 180 |- | D | 120 | 150 |} * Points Possible: ** 10 homework assignments (20 points per homework) ** 2 projects / competitions (100 points per project) * Homework Rules ** For work done in groups, credit is divided equally among participants - so the max homework grade for a group of 2 is 10 points each. ** For each homework, 1 re-do at full credit can be sent at any time after the due date, but must present a unique solution to previous work from yourself or others. ** All work must cite co-group members (if any) and the source of any code snippets used online. === Grading Rationale === Homework points will only be awarded for correct, working code and correct algorithmic analysis, while the homework problems will become progressively tougher. Undergraduates should be able to pass the course with an A if they have correctly answered most of the homework, and made a strong attempt at one of the projects. Graduate students should both perform well on the homework and successfully complete one or two projects. Essentially, this means you should do your own homework when possible and may do a project in a small group. The re-grading and group options for homework allow making up for missed assignments, and encourage returning to core concepts at a later point in the class. Students who have completed significant portions of the homework have thus demonstrated programming proficiency, and are qualified for at least B/C grades. == Projects == TBA - see previous years (e.g. [[CompSciSpring2016]]) for a general idea. == Textbooks and Resources == * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-0072-7 Beginning Python, Hetland, 2005] (eBook avail. from USF Library) * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-3238-4 Python Algorithms, Hetland, 2010] (eBook avail. from USF Library) * [http://aosabook.org/en/index.html The Architecture of Open Source Applications] * [http://docs.python.org Python Documentation] * [https://developers.google.com/edu/python/ Google Introductory Python Notes] * [http://huffman.sourceforge.net/tao/tao-of-programming.html Tao of Programming] Other (possibly useful) materials: * [http://hackersdictionary.com/html/entry/larval-stage.html The Jargon File] * Chapters 7&8 of Modelling and Simulation, Birta and Arbez, Springer 2007 (eBook avail. from USF Library). * Chapters 4-6 of Models and Algorithms for Intelligent Data Analysis, Runkler, Springer 2012 (eBook avail. from USF Library). * Guide to Scientific Computing in C++, Francis and Whiteley, Springer, 2012. (eBook avail. from USF Library) * Extra info. On the basics: ** Chapters 3 and 7 of Mathematics in Computing, Regan, Springer 2013. (eBook avail. from USF Library) ** Instant feedback graphical programming with [https://www.khanacademy.org/cs/programming/ Khan Academy] * [http://www.meetup.com/python-178/ Local PyBulls Meetings] Code: * [http://carsonfarmer.com/2013/07/essential-python-geo-libraries Python Libraries Useful for Geospatial Problems] * [[Code#Python_Libraries|Python Libraries Useful for Computational Chemistry]] (very small list at present) Interactive Interpreters: * [http://www.codewars.com CodeWars] Recommended for building experience with practice problems. * [http://codecombat.com/ CodeCombat] A very visual way to interact with your python code. * [http://exercism.io Exercism] A command-line client with a similar learn-through-challenge philosophy. * [http://repl.it repl.it] A read-eval-print loop for several computer languages. * [http://en.cppreference.com/w/cpp/language CppReference] Documentation with an online evaluator for C++ code. === Notes === * [[Media:Intro.pdf|Introduction Notes]] * [[Media:Week2-2017.pdf|Week 2-3 Notes]] * Week 4: read through function syntax in [[Media:Week2.pdf|2016 Week 2]] and for-loops in [[Media:Week3.pdf|2016 Week 3-4]] * In-Class Examples ** [[Turing Exercise]] ** [https://predictivestatmech.org/code/example.dcd Example DCD File] === Homework === * Homework will be assigned through [https://repl.it/classroom/invite/BtxEVLe Repl.IT] ** Homework 1 is due Friday, Jan. 20 ** Homework 2 is due Friday, Jan 27 5ff1bf8924fd7777648899f3083cf086ee4858c0 550 548 2017-02-01T18:48:51Z David M. Rogers 2 /* Notes */ wikitext text/x-wiki '''<BIG>Introduction to Scientific Computing</BIG>''' Course Info * Course Numbers CHM 4932-004/6938-010, CRN: 21864/21865 * Credit Hours: 3 * Meeting Dates: January 9 - April 26, 2017 ** No Class Jan. 16 or Mar. 13-17 * Meeting Times: Mon. and Wed., 12:30-13:45 in SCA 222 ** Lab Session & Office Hours: Fri. 12:30-13:45 in IDR 214 (or SCA 222 by announcement) == Overview == Mathematical models in the natural sciences take many shapes and forms. The moment they become more complicated than tracking a few variables over time, we have to put away our Excel spreadsheets and make use of a solid foundation in computational science. The course establishes this foundation by introducing data structures and algorithms used in everyday scientific computing using examples in the python scripting language. By the end of the Semester, students will be able to navigate the Linux command-line to go from a mathematical model to a numerical solution. Best practices for working with computer code and visualizing data will also be covered. == Topics == # Languages #* bash (shell) #* python (scripting) #* stack & register-based machine languages: overview of C and Fortran syntax & compiling with gcc, ‘thread safety’ #* Shared libraries & language inter-operability (FFI) # Algorithms #* Horner’s algorithm for polynomials #* Newton’s root finding algo. #* Overview of general optimization algo-s (example: linear & nonlin. least-squares) #* Numerical integration (scripted, plus gnu ODE) #* Communication (how HTTP get/put works) # Data Structures #* Linked Lists #* Trees (file system hierarchies) #* Graphs #* Arrays (dense & sparse) example: vectors & rotations / transpositions, densities and difference operators # Presentation & visualization #* Flat CSV files (and excel) #* Working with binary data #* Python matplotlib (2D images) #* Binning histograms & weighted averages # Best Practices #* High-level code design (modularity, interface specifications, unit testing, etc.) #* Code audit: open-source libraries, ex. Gnu Scientific Library, qsort in libc, Boost #* Source code versioning (example: git or mercurial) #* gdb & execution profiling #* documentation #* Makefiles == Grading == '''Grading Scale (out of 400 points possible)''' {| class="wikitable" |- ! Grade ! Undergraduate ! Graduate |- | A | 230 | 300 |- | B | 180 | 230 |- | C | 150 | 180 |- | D | 120 | 150 |} * Points Possible: ** 10 homework assignments (20 points per homework) ** 2 projects / competitions (100 points per project) * Homework Rules ** For work done in groups, credit is divided equally among participants - so the max homework grade for a group of 2 is 10 points each. ** For each homework, 1 re-do at full credit can be sent at any time after the due date, but must present a unique solution to previous work from yourself or others. ** All work must cite co-group members (if any) and the source of any code snippets used online. === Grading Rationale === Homework points will only be awarded for correct, working code and correct algorithmic analysis, while the homework problems will become progressively tougher. Undergraduates should be able to pass the course with an A if they have correctly answered most of the homework, and made a strong attempt at one of the projects. Graduate students should both perform well on the homework and successfully complete one or two projects. Essentially, this means you should do your own homework when possible and may do a project in a small group. The re-grading and group options for homework allow making up for missed assignments, and encourage returning to core concepts at a later point in the class. Students who have completed significant portions of the homework have thus demonstrated programming proficiency, and are qualified for at least B/C grades. == Projects == TBA - see previous years (e.g. [[CompSciSpring2016]]) for a general idea. == Textbooks and Resources == * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-0072-7 Beginning Python, Hetland, 2005] (eBook avail. from USF Library) * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-3238-4 Python Algorithms, Hetland, 2010] (eBook avail. from USF Library) * [http://aosabook.org/en/index.html The Architecture of Open Source Applications] * [http://docs.python.org Python Documentation] * [https://developers.google.com/edu/python/ Google Introductory Python Notes] * [http://huffman.sourceforge.net/tao/tao-of-programming.html Tao of Programming] Other (possibly useful) materials: * [http://hackersdictionary.com/html/entry/larval-stage.html The Jargon File] * Chapters 7&8 of Modelling and Simulation, Birta and Arbez, Springer 2007 (eBook avail. from USF Library). * Chapters 4-6 of Models and Algorithms for Intelligent Data Analysis, Runkler, Springer 2012 (eBook avail. from USF Library). * Guide to Scientific Computing in C++, Francis and Whiteley, Springer, 2012. (eBook avail. from USF Library) * Extra info. On the basics: ** Chapters 3 and 7 of Mathematics in Computing, Regan, Springer 2013. (eBook avail. from USF Library) ** Instant feedback graphical programming with [https://www.khanacademy.org/cs/programming/ Khan Academy] * [http://www.meetup.com/python-178/ Local PyBulls Meetings] Code: * [http://carsonfarmer.com/2013/07/essential-python-geo-libraries Python Libraries Useful for Geospatial Problems] * [[Code#Python_Libraries|Python Libraries Useful for Computational Chemistry]] (very small list at present) Interactive Interpreters: * [http://www.codewars.com CodeWars] Recommended for building experience with practice problems. * [http://codecombat.com/ CodeCombat] A very visual way to interact with your python code. * [http://exercism.io Exercism] A command-line client with a similar learn-through-challenge philosophy. * [http://repl.it repl.it] A read-eval-print loop for several computer languages. * [http://en.cppreference.com/w/cpp/language CppReference] Documentation with an online evaluator for C++ code. === Notes === * [[Media:Intro.pdf|Introduction Notes]] * [[Media:Week2-2017.pdf|Week 2-3 Notes]] * Week 4: read through function syntax in [[Media:Week2.pdf|2016 Week 2]] and for-loops in [[Media:Week3.pdf|2016 Week 3-4]] * In-Class Examples ** [[Turing Exercise]] ** [https://predictivestatmech.org/code/example.dcd Example DCD File] <source lang="python"> # Loop examples T = [500, 100, 200, 300, 400, 100] Q = [0]*5 print(len(T)) print(len(Q)) k = 0.5 Q[0] = (T[1]-T[0])*(-k) Q[1] = (T[2]-T[1])*(-k) Q[2] = (T[3]-T[2])*(-k) Q[3] = (T[4]-T[3])*(-k) Q[4] = (T[5]-T[4])*(-k) # or use a for-loop! r = 0.25 x = 0.5 x = r*x*(1-x) x = r*x*(1-x) x = r*x*(1-x) x = r*x*(1-x) x = r*x*(1-x) x = r*x*(1-x) out = "" for i in [0,4,13,32,64,128]: out = out + str(i) + ", " # Hint for Homework 3 def dcd_info(f): # file -> string d = f.read() frames = unpack("<i", d[?]) # string -> int timestep = unpack("f", d[?]) # string -> float N = unpack("<i", d[?]) # string -> int return [frames, timestep, N] </source> === Homework === * Homework will be assigned through [https://repl.it/classroom/invite/BtxEVLe Repl.IT] ** Homework 1 is due Friday, Jan. 20 ** Homework 2 is due Friday, Jan 27 79b9022f75943ea82c53ad5ae9fd0b57dba64e37 552 550 2017-02-06T17:22:13Z David M. Rogers 2 /* Notes */ wikitext text/x-wiki '''<BIG>Introduction to Scientific Computing</BIG>''' Course Info * Course Numbers CHM 4932-004/6938-010, CRN: 21864/21865 * Credit Hours: 3 * Meeting Dates: January 9 - April 26, 2017 ** No Class Jan. 16 or Mar. 13-17 * Meeting Times: Mon. and Wed., 12:30-13:45 in SCA 222 ** Lab Session & Office Hours: Fri. 12:30-13:45 in IDR 214 (or SCA 222 by announcement) == Overview == Mathematical models in the natural sciences take many shapes and forms. The moment they become more complicated than tracking a few variables over time, we have to put away our Excel spreadsheets and make use of a solid foundation in computational science. The course establishes this foundation by introducing data structures and algorithms used in everyday scientific computing using examples in the python scripting language. By the end of the Semester, students will be able to navigate the Linux command-line to go from a mathematical model to a numerical solution. Best practices for working with computer code and visualizing data will also be covered. == Topics == # Languages #* bash (shell) #* python (scripting) #* stack & register-based machine languages: overview of C and Fortran syntax & compiling with gcc, ‘thread safety’ #* Shared libraries & language inter-operability (FFI) # Algorithms #* Horner’s algorithm for polynomials #* Newton’s root finding algo. #* Overview of general optimization algo-s (example: linear & nonlin. least-squares) #* Numerical integration (scripted, plus gnu ODE) #* Communication (how HTTP get/put works) # Data Structures #* Linked Lists #* Trees (file system hierarchies) #* Graphs #* Arrays (dense & sparse) example: vectors & rotations / transpositions, densities and difference operators # Presentation & visualization #* Flat CSV files (and excel) #* Working with binary data #* Python matplotlib (2D images) #* Binning histograms & weighted averages # Best Practices #* High-level code design (modularity, interface specifications, unit testing, etc.) #* Code audit: open-source libraries, ex. Gnu Scientific Library, qsort in libc, Boost #* Source code versioning (example: git or mercurial) #* gdb & execution profiling #* documentation #* Makefiles == Grading == '''Grading Scale (out of 400 points possible)''' {| class="wikitable" |- ! Grade ! Undergraduate ! Graduate |- | A | 230 | 300 |- | B | 180 | 230 |- | C | 150 | 180 |- | D | 120 | 150 |} * Points Possible: ** 10 homework assignments (20 points per homework) ** 2 projects / competitions (100 points per project) * Homework Rules ** For work done in groups, credit is divided equally among participants - so the max homework grade for a group of 2 is 10 points each. ** For each homework, 1 re-do at full credit can be sent at any time after the due date, but must present a unique solution to previous work from yourself or others. ** All work must cite co-group members (if any) and the source of any code snippets used online. === Grading Rationale === Homework points will only be awarded for correct, working code and correct algorithmic analysis, while the homework problems will become progressively tougher. Undergraduates should be able to pass the course with an A if they have correctly answered most of the homework, and made a strong attempt at one of the projects. Graduate students should both perform well on the homework and successfully complete one or two projects. Essentially, this means you should do your own homework when possible and may do a project in a small group. The re-grading and group options for homework allow making up for missed assignments, and encourage returning to core concepts at a later point in the class. Students who have completed significant portions of the homework have thus demonstrated programming proficiency, and are qualified for at least B/C grades. == Projects == TBA - see previous years (e.g. [[CompSciSpring2016]]) for a general idea. == Textbooks and Resources == * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-0072-7 Beginning Python, Hetland, 2005] (eBook avail. from USF Library) * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-3238-4 Python Algorithms, Hetland, 2010] (eBook avail. from USF Library) * [http://aosabook.org/en/index.html The Architecture of Open Source Applications] * [http://docs.python.org Python Documentation] * [https://developers.google.com/edu/python/ Google Introductory Python Notes] * [http://huffman.sourceforge.net/tao/tao-of-programming.html Tao of Programming] Other (possibly useful) materials: * [http://hackersdictionary.com/html/entry/larval-stage.html The Jargon File] * Chapters 7&8 of Modelling and Simulation, Birta and Arbez, Springer 2007 (eBook avail. from USF Library). * Chapters 4-6 of Models and Algorithms for Intelligent Data Analysis, Runkler, Springer 2012 (eBook avail. from USF Library). * Guide to Scientific Computing in C++, Francis and Whiteley, Springer, 2012. (eBook avail. from USF Library) * Extra info. On the basics: ** Chapters 3 and 7 of Mathematics in Computing, Regan, Springer 2013. (eBook avail. from USF Library) ** Instant feedback graphical programming with [https://www.khanacademy.org/cs/programming/ Khan Academy] * [http://www.meetup.com/python-178/ Local PyBulls Meetings] Code: * [http://carsonfarmer.com/2013/07/essential-python-geo-libraries Python Libraries Useful for Geospatial Problems] * [[Code#Python_Libraries|Python Libraries Useful for Computational Chemistry]] (very small list at present) Interactive Interpreters: * [http://www.codewars.com CodeWars] Recommended for building experience with practice problems. * [http://codecombat.com/ CodeCombat] A very visual way to interact with your python code. * [http://exercism.io Exercism] A command-line client with a similar learn-through-challenge philosophy. * [http://repl.it repl.it] A read-eval-print loop for several computer languages. * [http://en.cppreference.com/w/cpp/language CppReference] Documentation with an online evaluator for C++ code. === Notes === * [[Media:Intro.pdf|Introduction Notes]] * [[Media:Week2-2017.pdf|Week 2-3 Notes]] * Week 4: read through function syntax in [[Media:Week2.pdf|2016 Week 2]] and for-loops in [[Media:Week3.pdf|2016 Week 3-4]] * In-Class Examples ** [[Turing Exercise]] ** [https://predictivestatmech.org/code/example.dcd Example DCD File] * [[Media:Week-5.2017.pdf|Week 5 Notes]] ** [Code:PyTesting] <source lang="python"> # Loop examples T = [500, 100, 200, 300, 400, 100] Q = [0]*5 print(len(T)) print(len(Q)) k = 0.5 Q[0] = (T[1]-T[0])*(-k) Q[1] = (T[2]-T[1])*(-k) Q[2] = (T[3]-T[2])*(-k) Q[3] = (T[4]-T[3])*(-k) Q[4] = (T[5]-T[4])*(-k) # or use a for-loop! r = 0.25 x = 0.5 x = r*x*(1-x) x = r*x*(1-x) x = r*x*(1-x) x = r*x*(1-x) x = r*x*(1-x) x = r*x*(1-x) out = "" for i in [0,4,13,32,64,128]: out = out + str(i) + ", " # Hint for Homework 3 def dcd_info(f): # file -> string d = f.read() frames = unpack("<i", d[?]) # string -> int timestep = unpack("f", d[?]) # string -> float N = unpack("<i", d[?]) # string -> int return [frames, timestep, N] </source> === Homework === * Homework will be assigned through [https://repl.it/classroom/invite/BtxEVLe Repl.IT] ** Homework 1 is due Friday, Jan. 20 ** Homework 2 is due Friday, Jan 27 3bde86b7a95d8dfa9887e4e6e77baa7fde8f5a4d 553 552 2017-02-06T17:22:30Z David M. Rogers 2 /* Notes */ wikitext text/x-wiki '''<BIG>Introduction to Scientific Computing</BIG>''' Course Info * Course Numbers CHM 4932-004/6938-010, CRN: 21864/21865 * Credit Hours: 3 * Meeting Dates: January 9 - April 26, 2017 ** No Class Jan. 16 or Mar. 13-17 * Meeting Times: Mon. and Wed., 12:30-13:45 in SCA 222 ** Lab Session & Office Hours: Fri. 12:30-13:45 in IDR 214 (or SCA 222 by announcement) == Overview == Mathematical models in the natural sciences take many shapes and forms. The moment they become more complicated than tracking a few variables over time, we have to put away our Excel spreadsheets and make use of a solid foundation in computational science. The course establishes this foundation by introducing data structures and algorithms used in everyday scientific computing using examples in the python scripting language. By the end of the Semester, students will be able to navigate the Linux command-line to go from a mathematical model to a numerical solution. Best practices for working with computer code and visualizing data will also be covered. == Topics == # Languages #* bash (shell) #* python (scripting) #* stack & register-based machine languages: overview of C and Fortran syntax & compiling with gcc, ‘thread safety’ #* Shared libraries & language inter-operability (FFI) # Algorithms #* Horner’s algorithm for polynomials #* Newton’s root finding algo. #* Overview of general optimization algo-s (example: linear & nonlin. least-squares) #* Numerical integration (scripted, plus gnu ODE) #* Communication (how HTTP get/put works) # Data Structures #* Linked Lists #* Trees (file system hierarchies) #* Graphs #* Arrays (dense & sparse) example: vectors & rotations / transpositions, densities and difference operators # Presentation & visualization #* Flat CSV files (and excel) #* Working with binary data #* Python matplotlib (2D images) #* Binning histograms & weighted averages # Best Practices #* High-level code design (modularity, interface specifications, unit testing, etc.) #* Code audit: open-source libraries, ex. Gnu Scientific Library, qsort in libc, Boost #* Source code versioning (example: git or mercurial) #* gdb & execution profiling #* documentation #* Makefiles == Grading == '''Grading Scale (out of 400 points possible)''' {| class="wikitable" |- ! Grade ! Undergraduate ! Graduate |- | A | 230 | 300 |- | B | 180 | 230 |- | C | 150 | 180 |- | D | 120 | 150 |} * Points Possible: ** 10 homework assignments (20 points per homework) ** 2 projects / competitions (100 points per project) * Homework Rules ** For work done in groups, credit is divided equally among participants - so the max homework grade for a group of 2 is 10 points each. ** For each homework, 1 re-do at full credit can be sent at any time after the due date, but must present a unique solution to previous work from yourself or others. ** All work must cite co-group members (if any) and the source of any code snippets used online. === Grading Rationale === Homework points will only be awarded for correct, working code and correct algorithmic analysis, while the homework problems will become progressively tougher. Undergraduates should be able to pass the course with an A if they have correctly answered most of the homework, and made a strong attempt at one of the projects. Graduate students should both perform well on the homework and successfully complete one or two projects. Essentially, this means you should do your own homework when possible and may do a project in a small group. The re-grading and group options for homework allow making up for missed assignments, and encourage returning to core concepts at a later point in the class. Students who have completed significant portions of the homework have thus demonstrated programming proficiency, and are qualified for at least B/C grades. == Projects == TBA - see previous years (e.g. [[CompSciSpring2016]]) for a general idea. == Textbooks and Resources == * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-0072-7 Beginning Python, Hetland, 2005] (eBook avail. from USF Library) * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-3238-4 Python Algorithms, Hetland, 2010] (eBook avail. from USF Library) * [http://aosabook.org/en/index.html The Architecture of Open Source Applications] * [http://docs.python.org Python Documentation] * [https://developers.google.com/edu/python/ Google Introductory Python Notes] * [http://huffman.sourceforge.net/tao/tao-of-programming.html Tao of Programming] Other (possibly useful) materials: * [http://hackersdictionary.com/html/entry/larval-stage.html The Jargon File] * Chapters 7&8 of Modelling and Simulation, Birta and Arbez, Springer 2007 (eBook avail. from USF Library). * Chapters 4-6 of Models and Algorithms for Intelligent Data Analysis, Runkler, Springer 2012 (eBook avail. from USF Library). * Guide to Scientific Computing in C++, Francis and Whiteley, Springer, 2012. (eBook avail. from USF Library) * Extra info. On the basics: ** Chapters 3 and 7 of Mathematics in Computing, Regan, Springer 2013. (eBook avail. from USF Library) ** Instant feedback graphical programming with [https://www.khanacademy.org/cs/programming/ Khan Academy] * [http://www.meetup.com/python-178/ Local PyBulls Meetings] Code: * [http://carsonfarmer.com/2013/07/essential-python-geo-libraries Python Libraries Useful for Geospatial Problems] * [[Code#Python_Libraries|Python Libraries Useful for Computational Chemistry]] (very small list at present) Interactive Interpreters: * [http://www.codewars.com CodeWars] Recommended for building experience with practice problems. * [http://codecombat.com/ CodeCombat] A very visual way to interact with your python code. * [http://exercism.io Exercism] A command-line client with a similar learn-through-challenge philosophy. * [http://repl.it repl.it] A read-eval-print loop for several computer languages. * [http://en.cppreference.com/w/cpp/language CppReference] Documentation with an online evaluator for C++ code. === Notes === * [[Media:Intro.pdf|Introduction Notes]] * [[Media:Week2-2017.pdf|Week 2-3 Notes]] * Week 4: read through function syntax in [[Media:Week2.pdf|2016 Week 2]] and for-loops in [[Media:Week3.pdf|2016 Week 3-4]] * In-Class Examples ** [[Turing Exercise]] ** [https://predictivestatmech.org/code/example.dcd Example DCD File] * [[Media:Week-5.2017.pdf|Week 5 Notes]] ** [[Code:PyTesting]] <source lang="python"> # Loop examples T = [500, 100, 200, 300, 400, 100] Q = [0]*5 print(len(T)) print(len(Q)) k = 0.5 Q[0] = (T[1]-T[0])*(-k) Q[1] = (T[2]-T[1])*(-k) Q[2] = (T[3]-T[2])*(-k) Q[3] = (T[4]-T[3])*(-k) Q[4] = (T[5]-T[4])*(-k) # or use a for-loop! r = 0.25 x = 0.5 x = r*x*(1-x) x = r*x*(1-x) x = r*x*(1-x) x = r*x*(1-x) x = r*x*(1-x) x = r*x*(1-x) out = "" for i in [0,4,13,32,64,128]: out = out + str(i) + ", " # Hint for Homework 3 def dcd_info(f): # file -> string d = f.read() frames = unpack("<i", d[?]) # string -> int timestep = unpack("f", d[?]) # string -> float N = unpack("<i", d[?]) # string -> int return [frames, timestep, N] </source> === Homework === * Homework will be assigned through [https://repl.it/classroom/invite/BtxEVLe Repl.IT] ** Homework 1 is due Friday, Jan. 20 ** Homework 2 is due Friday, Jan 27 93fddd5f33f52a058cb7fa9560df09cc5c9a0f91 556 553 2017-02-08T17:17:28Z David M. Rogers 2 /* Homework */ wikitext text/x-wiki '''<BIG>Introduction to Scientific Computing</BIG>''' Course Info * Course Numbers CHM 4932-004/6938-010, CRN: 21864/21865 * Credit Hours: 3 * Meeting Dates: January 9 - April 26, 2017 ** No Class Jan. 16 or Mar. 13-17 * Meeting Times: Mon. and Wed., 12:30-13:45 in SCA 222 ** Lab Session & Office Hours: Fri. 12:30-13:45 in IDR 214 (or SCA 222 by announcement) == Overview == Mathematical models in the natural sciences take many shapes and forms. The moment they become more complicated than tracking a few variables over time, we have to put away our Excel spreadsheets and make use of a solid foundation in computational science. The course establishes this foundation by introducing data structures and algorithms used in everyday scientific computing using examples in the python scripting language. By the end of the Semester, students will be able to navigate the Linux command-line to go from a mathematical model to a numerical solution. Best practices for working with computer code and visualizing data will also be covered. == Topics == # Languages #* bash (shell) #* python (scripting) #* stack & register-based machine languages: overview of C and Fortran syntax & compiling with gcc, ‘thread safety’ #* Shared libraries & language inter-operability (FFI) # Algorithms #* Horner’s algorithm for polynomials #* Newton’s root finding algo. #* Overview of general optimization algo-s (example: linear & nonlin. least-squares) #* Numerical integration (scripted, plus gnu ODE) #* Communication (how HTTP get/put works) # Data Structures #* Linked Lists #* Trees (file system hierarchies) #* Graphs #* Arrays (dense & sparse) example: vectors & rotations / transpositions, densities and difference operators # Presentation & visualization #* Flat CSV files (and excel) #* Working with binary data #* Python matplotlib (2D images) #* Binning histograms & weighted averages # Best Practices #* High-level code design (modularity, interface specifications, unit testing, etc.) #* Code audit: open-source libraries, ex. Gnu Scientific Library, qsort in libc, Boost #* Source code versioning (example: git or mercurial) #* gdb & execution profiling #* documentation #* Makefiles == Grading == '''Grading Scale (out of 400 points possible)''' {| class="wikitable" |- ! Grade ! Undergraduate ! Graduate |- | A | 230 | 300 |- | B | 180 | 230 |- | C | 150 | 180 |- | D | 120 | 150 |} * Points Possible: ** 10 homework assignments (20 points per homework) ** 2 projects / competitions (100 points per project) * Homework Rules ** For work done in groups, credit is divided equally among participants - so the max homework grade for a group of 2 is 10 points each. ** For each homework, 1 re-do at full credit can be sent at any time after the due date, but must present a unique solution to previous work from yourself or others. ** All work must cite co-group members (if any) and the source of any code snippets used online. === Grading Rationale === Homework points will only be awarded for correct, working code and correct algorithmic analysis, while the homework problems will become progressively tougher. Undergraduates should be able to pass the course with an A if they have correctly answered most of the homework, and made a strong attempt at one of the projects. Graduate students should both perform well on the homework and successfully complete one or two projects. Essentially, this means you should do your own homework when possible and may do a project in a small group. The re-grading and group options for homework allow making up for missed assignments, and encourage returning to core concepts at a later point in the class. Students who have completed significant portions of the homework have thus demonstrated programming proficiency, and are qualified for at least B/C grades. == Projects == TBA - see previous years (e.g. [[CompSciSpring2016]]) for a general idea. == Textbooks and Resources == * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-0072-7 Beginning Python, Hetland, 2005] (eBook avail. from USF Library) * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-3238-4 Python Algorithms, Hetland, 2010] (eBook avail. from USF Library) * [http://aosabook.org/en/index.html The Architecture of Open Source Applications] * [http://docs.python.org Python Documentation] * [https://developers.google.com/edu/python/ Google Introductory Python Notes] * [http://huffman.sourceforge.net/tao/tao-of-programming.html Tao of Programming] Other (possibly useful) materials: * [http://hackersdictionary.com/html/entry/larval-stage.html The Jargon File] * Chapters 7&8 of Modelling and Simulation, Birta and Arbez, Springer 2007 (eBook avail. from USF Library). * Chapters 4-6 of Models and Algorithms for Intelligent Data Analysis, Runkler, Springer 2012 (eBook avail. from USF Library). * Guide to Scientific Computing in C++, Francis and Whiteley, Springer, 2012. (eBook avail. from USF Library) * Extra info. On the basics: ** Chapters 3 and 7 of Mathematics in Computing, Regan, Springer 2013. (eBook avail. from USF Library) ** Instant feedback graphical programming with [https://www.khanacademy.org/cs/programming/ Khan Academy] * [http://www.meetup.com/python-178/ Local PyBulls Meetings] Code: * [http://carsonfarmer.com/2013/07/essential-python-geo-libraries Python Libraries Useful for Geospatial Problems] * [[Code#Python_Libraries|Python Libraries Useful for Computational Chemistry]] (very small list at present) Interactive Interpreters: * [http://www.codewars.com CodeWars] Recommended for building experience with practice problems. * [http://codecombat.com/ CodeCombat] A very visual way to interact with your python code. * [http://exercism.io Exercism] A command-line client with a similar learn-through-challenge philosophy. * [http://repl.it repl.it] A read-eval-print loop for several computer languages. * [http://en.cppreference.com/w/cpp/language CppReference] Documentation with an online evaluator for C++ code. === Notes === * [[Media:Intro.pdf|Introduction Notes]] * [[Media:Week2-2017.pdf|Week 2-3 Notes]] * Week 4: read through function syntax in [[Media:Week2.pdf|2016 Week 2]] and for-loops in [[Media:Week3.pdf|2016 Week 3-4]] * In-Class Examples ** [[Turing Exercise]] ** [https://predictivestatmech.org/code/example.dcd Example DCD File] * [[Media:Week-5.2017.pdf|Week 5 Notes]] ** [[Code:PyTesting]] <source lang="python"> # Loop examples T = [500, 100, 200, 300, 400, 100] Q = [0]*5 print(len(T)) print(len(Q)) k = 0.5 Q[0] = (T[1]-T[0])*(-k) Q[1] = (T[2]-T[1])*(-k) Q[2] = (T[3]-T[2])*(-k) Q[3] = (T[4]-T[3])*(-k) Q[4] = (T[5]-T[4])*(-k) # or use a for-loop! r = 0.25 x = 0.5 x = r*x*(1-x) x = r*x*(1-x) x = r*x*(1-x) x = r*x*(1-x) x = r*x*(1-x) x = r*x*(1-x) out = "" for i in [0,4,13,32,64,128]: out = out + str(i) + ", " # Hint for Homework 3 def dcd_info(f): # file -> string d = f.read() frames = unpack("<i", d[?]) # string -> int timestep = unpack("f", d[?]) # string -> float N = unpack("<i", d[?]) # string -> int return [frames, timestep, N] </source> === Homework === * Homework will be assigned through [https://repl.it/classroom/invite/BtxEVLe Repl.IT] ** Homework 1 is due Friday, Jan. 20 ** Homework 2 is due Friday, Jan 27 ** Homework 3 is due Friday, Feb 10 ** Homework 4 is due Friday, Feb 17 57b8f2bb11d0f411afa33cefcbbdfaf5a5bc6f93 557 556 2017-02-08T17:18:13Z David M. Rogers 2 /* Notes */ wikitext text/x-wiki '''<BIG>Introduction to Scientific Computing</BIG>''' Course Info * Course Numbers CHM 4932-004/6938-010, CRN: 21864/21865 * Credit Hours: 3 * Meeting Dates: January 9 - April 26, 2017 ** No Class Jan. 16 or Mar. 13-17 * Meeting Times: Mon. and Wed., 12:30-13:45 in SCA 222 ** Lab Session & Office Hours: Fri. 12:30-13:45 in IDR 214 (or SCA 222 by announcement) == Overview == Mathematical models in the natural sciences take many shapes and forms. The moment they become more complicated than tracking a few variables over time, we have to put away our Excel spreadsheets and make use of a solid foundation in computational science. The course establishes this foundation by introducing data structures and algorithms used in everyday scientific computing using examples in the python scripting language. By the end of the Semester, students will be able to navigate the Linux command-line to go from a mathematical model to a numerical solution. Best practices for working with computer code and visualizing data will also be covered. == Topics == # Languages #* bash (shell) #* python (scripting) #* stack & register-based machine languages: overview of C and Fortran syntax & compiling with gcc, ‘thread safety’ #* Shared libraries & language inter-operability (FFI) # Algorithms #* Horner’s algorithm for polynomials #* Newton’s root finding algo. #* Overview of general optimization algo-s (example: linear & nonlin. least-squares) #* Numerical integration (scripted, plus gnu ODE) #* Communication (how HTTP get/put works) # Data Structures #* Linked Lists #* Trees (file system hierarchies) #* Graphs #* Arrays (dense & sparse) example: vectors & rotations / transpositions, densities and difference operators # Presentation & visualization #* Flat CSV files (and excel) #* Working with binary data #* Python matplotlib (2D images) #* Binning histograms & weighted averages # Best Practices #* High-level code design (modularity, interface specifications, unit testing, etc.) #* Code audit: open-source libraries, ex. Gnu Scientific Library, qsort in libc, Boost #* Source code versioning (example: git or mercurial) #* gdb & execution profiling #* documentation #* Makefiles == Grading == '''Grading Scale (out of 400 points possible)''' {| class="wikitable" |- ! Grade ! Undergraduate ! Graduate |- | A | 230 | 300 |- | B | 180 | 230 |- | C | 150 | 180 |- | D | 120 | 150 |} * Points Possible: ** 10 homework assignments (20 points per homework) ** 2 projects / competitions (100 points per project) * Homework Rules ** For work done in groups, credit is divided equally among participants - so the max homework grade for a group of 2 is 10 points each. ** For each homework, 1 re-do at full credit can be sent at any time after the due date, but must present a unique solution to previous work from yourself or others. ** All work must cite co-group members (if any) and the source of any code snippets used online. === Grading Rationale === Homework points will only be awarded for correct, working code and correct algorithmic analysis, while the homework problems will become progressively tougher. Undergraduates should be able to pass the course with an A if they have correctly answered most of the homework, and made a strong attempt at one of the projects. Graduate students should both perform well on the homework and successfully complete one or two projects. Essentially, this means you should do your own homework when possible and may do a project in a small group. The re-grading and group options for homework allow making up for missed assignments, and encourage returning to core concepts at a later point in the class. Students who have completed significant portions of the homework have thus demonstrated programming proficiency, and are qualified for at least B/C grades. == Projects == TBA - see previous years (e.g. [[CompSciSpring2016]]) for a general idea. == Textbooks and Resources == * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-0072-7 Beginning Python, Hetland, 2005] (eBook avail. from USF Library) * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-3238-4 Python Algorithms, Hetland, 2010] (eBook avail. from USF Library) * [http://aosabook.org/en/index.html The Architecture of Open Source Applications] * [http://docs.python.org Python Documentation] * [https://developers.google.com/edu/python/ Google Introductory Python Notes] * [http://huffman.sourceforge.net/tao/tao-of-programming.html Tao of Programming] Other (possibly useful) materials: * [http://hackersdictionary.com/html/entry/larval-stage.html The Jargon File] * Chapters 7&8 of Modelling and Simulation, Birta and Arbez, Springer 2007 (eBook avail. from USF Library). * Chapters 4-6 of Models and Algorithms for Intelligent Data Analysis, Runkler, Springer 2012 (eBook avail. from USF Library). * Guide to Scientific Computing in C++, Francis and Whiteley, Springer, 2012. (eBook avail. from USF Library) * Extra info. On the basics: ** Chapters 3 and 7 of Mathematics in Computing, Regan, Springer 2013. (eBook avail. from USF Library) ** Instant feedback graphical programming with [https://www.khanacademy.org/cs/programming/ Khan Academy] * [http://www.meetup.com/python-178/ Local PyBulls Meetings] Code: * [http://carsonfarmer.com/2013/07/essential-python-geo-libraries Python Libraries Useful for Geospatial Problems] * [[Code#Python_Libraries|Python Libraries Useful for Computational Chemistry]] (very small list at present) Interactive Interpreters: * [http://www.codewars.com CodeWars] Recommended for building experience with practice problems. * [http://codecombat.com/ CodeCombat] A very visual way to interact with your python code. * [http://exercism.io Exercism] A command-line client with a similar learn-through-challenge philosophy. * [http://repl.it repl.it] A read-eval-print loop for several computer languages. * [http://en.cppreference.com/w/cpp/language CppReference] Documentation with an online evaluator for C++ code. === Notes === * [[Media:Intro.pdf|Introduction Notes]] * [[Media:Week2-2017.pdf|Week 2-3 Notes]] * Week 4: read through function syntax in [[Media:Week2.pdf|2016 Week 2]] and for-loops in [[Media:Week3.pdf|2016 Week 3-4]] * In-Class Examples ** [[Turing Exercise]] ** [https://predictivestatmech.org/code/example.dcd Example DCD File] * [[Media:Week-5.2017.pdf|Week 5 Notes]] * [[Media:Week-6.2017.pdf|Week 6 Notes]] ** [[Code:PyTesting]] <source lang="python"> # Loop examples T = [500, 100, 200, 300, 400, 100] Q = [0]*5 print(len(T)) print(len(Q)) k = 0.5 Q[0] = (T[1]-T[0])*(-k) Q[1] = (T[2]-T[1])*(-k) Q[2] = (T[3]-T[2])*(-k) Q[3] = (T[4]-T[3])*(-k) Q[4] = (T[5]-T[4])*(-k) # or use a for-loop! r = 0.25 x = 0.5 x = r*x*(1-x) x = r*x*(1-x) x = r*x*(1-x) x = r*x*(1-x) x = r*x*(1-x) x = r*x*(1-x) out = "" for i in [0,4,13,32,64,128]: out = out + str(i) + ", " # Hint for Homework 3 def dcd_info(f): # file -> string d = f.read() frames = unpack("<i", d[?]) # string -> int timestep = unpack("f", d[?]) # string -> float N = unpack("<i", d[?]) # string -> int return [frames, timestep, N] </source> === Homework === * Homework will be assigned through [https://repl.it/classroom/invite/BtxEVLe Repl.IT] ** Homework 1 is due Friday, Jan. 20 ** Homework 2 is due Friday, Jan 27 ** Homework 3 is due Friday, Feb 10 ** Homework 4 is due Friday, Feb 17 3f59377a9f89f6987519314c5b51141ce7e474d7 559 557 2017-02-08T17:21:27Z David M. Rogers 2 /* Notes */ wikitext text/x-wiki '''<BIG>Introduction to Scientific Computing</BIG>''' Course Info * Course Numbers CHM 4932-004/6938-010, CRN: 21864/21865 * Credit Hours: 3 * Meeting Dates: January 9 - April 26, 2017 ** No Class Jan. 16 or Mar. 13-17 * Meeting Times: Mon. and Wed., 12:30-13:45 in SCA 222 ** Lab Session & Office Hours: Fri. 12:30-13:45 in IDR 214 (or SCA 222 by announcement) == Overview == Mathematical models in the natural sciences take many shapes and forms. The moment they become more complicated than tracking a few variables over time, we have to put away our Excel spreadsheets and make use of a solid foundation in computational science. The course establishes this foundation by introducing data structures and algorithms used in everyday scientific computing using examples in the python scripting language. By the end of the Semester, students will be able to navigate the Linux command-line to go from a mathematical model to a numerical solution. Best practices for working with computer code and visualizing data will also be covered. == Topics == # Languages #* bash (shell) #* python (scripting) #* stack & register-based machine languages: overview of C and Fortran syntax & compiling with gcc, ‘thread safety’ #* Shared libraries & language inter-operability (FFI) # Algorithms #* Horner’s algorithm for polynomials #* Newton’s root finding algo. #* Overview of general optimization algo-s (example: linear & nonlin. least-squares) #* Numerical integration (scripted, plus gnu ODE) #* Communication (how HTTP get/put works) # Data Structures #* Linked Lists #* Trees (file system hierarchies) #* Graphs #* Arrays (dense & sparse) example: vectors & rotations / transpositions, densities and difference operators # Presentation & visualization #* Flat CSV files (and excel) #* Working with binary data #* Python matplotlib (2D images) #* Binning histograms & weighted averages # Best Practices #* High-level code design (modularity, interface specifications, unit testing, etc.) #* Code audit: open-source libraries, ex. Gnu Scientific Library, qsort in libc, Boost #* Source code versioning (example: git or mercurial) #* gdb & execution profiling #* documentation #* Makefiles == Grading == '''Grading Scale (out of 400 points possible)''' {| class="wikitable" |- ! Grade ! Undergraduate ! Graduate |- | A | 230 | 300 |- | B | 180 | 230 |- | C | 150 | 180 |- | D | 120 | 150 |} * Points Possible: ** 10 homework assignments (20 points per homework) ** 2 projects / competitions (100 points per project) * Homework Rules ** For work done in groups, credit is divided equally among participants - so the max homework grade for a group of 2 is 10 points each. ** For each homework, 1 re-do at full credit can be sent at any time after the due date, but must present a unique solution to previous work from yourself or others. ** All work must cite co-group members (if any) and the source of any code snippets used online. === Grading Rationale === Homework points will only be awarded for correct, working code and correct algorithmic analysis, while the homework problems will become progressively tougher. Undergraduates should be able to pass the course with an A if they have correctly answered most of the homework, and made a strong attempt at one of the projects. Graduate students should both perform well on the homework and successfully complete one or two projects. Essentially, this means you should do your own homework when possible and may do a project in a small group. The re-grading and group options for homework allow making up for missed assignments, and encourage returning to core concepts at a later point in the class. Students who have completed significant portions of the homework have thus demonstrated programming proficiency, and are qualified for at least B/C grades. == Projects == TBA - see previous years (e.g. [[CompSciSpring2016]]) for a general idea. == Textbooks and Resources == * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-0072-7 Beginning Python, Hetland, 2005] (eBook avail. from USF Library) * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-3238-4 Python Algorithms, Hetland, 2010] (eBook avail. from USF Library) * [http://aosabook.org/en/index.html The Architecture of Open Source Applications] * [http://docs.python.org Python Documentation] * [https://developers.google.com/edu/python/ Google Introductory Python Notes] * [http://huffman.sourceforge.net/tao/tao-of-programming.html Tao of Programming] Other (possibly useful) materials: * [http://hackersdictionary.com/html/entry/larval-stage.html The Jargon File] * Chapters 7&8 of Modelling and Simulation, Birta and Arbez, Springer 2007 (eBook avail. from USF Library). * Chapters 4-6 of Models and Algorithms for Intelligent Data Analysis, Runkler, Springer 2012 (eBook avail. from USF Library). * Guide to Scientific Computing in C++, Francis and Whiteley, Springer, 2012. (eBook avail. from USF Library) * Extra info. On the basics: ** Chapters 3 and 7 of Mathematics in Computing, Regan, Springer 2013. (eBook avail. from USF Library) ** Instant feedback graphical programming with [https://www.khanacademy.org/cs/programming/ Khan Academy] * [http://www.meetup.com/python-178/ Local PyBulls Meetings] Code: * [http://carsonfarmer.com/2013/07/essential-python-geo-libraries Python Libraries Useful for Geospatial Problems] * [[Code#Python_Libraries|Python Libraries Useful for Computational Chemistry]] (very small list at present) Interactive Interpreters: * [http://www.codewars.com CodeWars] Recommended for building experience with practice problems. * [http://codecombat.com/ CodeCombat] A very visual way to interact with your python code. * [http://exercism.io Exercism] A command-line client with a similar learn-through-challenge philosophy. * [http://repl.it repl.it] A read-eval-print loop for several computer languages. * [http://en.cppreference.com/w/cpp/language CppReference] Documentation with an online evaluator for C++ code. === Notes === * [[Media:Intro.pdf|Introduction Notes]] * [[Media:Week2-2017.pdf|Week 2-3 Notes]] * Week 4: read through function syntax in [[Media:Week2.pdf|2016 Week 2]] and for-loops in [[Media:Week3.pdf|2016 Week 3-4]] * In-Class Examples ** [[Turing Exercise]] ** [https://predictivestatmech.org/code/example.dcd Example DCD File] * [[Media:Week-5.2017.pdf|Week 5 Notes]] * [[Media:PlottingMaps.pdf|Week 6 Notes]] ** [[Code:PyTesting]] <source lang="python"> # Loop examples T = [500, 100, 200, 300, 400, 100] Q = [0]*5 print(len(T)) print(len(Q)) k = 0.5 Q[0] = (T[1]-T[0])*(-k) Q[1] = (T[2]-T[1])*(-k) Q[2] = (T[3]-T[2])*(-k) Q[3] = (T[4]-T[3])*(-k) Q[4] = (T[5]-T[4])*(-k) # or use a for-loop! r = 0.25 x = 0.5 x = r*x*(1-x) x = r*x*(1-x) x = r*x*(1-x) x = r*x*(1-x) x = r*x*(1-x) x = r*x*(1-x) out = "" for i in [0,4,13,32,64,128]: out = out + str(i) + ", " # Hint for Homework 3 def dcd_info(f): # file -> string d = f.read() frames = unpack("<i", d[?]) # string -> int timestep = unpack("f", d[?]) # string -> float N = unpack("<i", d[?]) # string -> int return [frames, timestep, N] </source> === Homework === * Homework will be assigned through [https://repl.it/classroom/invite/BtxEVLe Repl.IT] ** Homework 1 is due Friday, Jan. 20 ** Homework 2 is due Friday, Jan 27 ** Homework 3 is due Friday, Feb 10 ** Homework 4 is due Friday, Feb 17 f39f68f4360b686a6ad2a4c1e37e93a772c98973 Turing Exercise 0 123 540 2017-01-11T15:53:33Z David M. Rogers 2 Created page with "= Class Exercise: Understanding Pseudocode and the Turing Machine = The Diffusion algorithm * Inputs: ** Two end temperatures (TL and TR) ** A list of 5 starting temperature..." wikitext text/x-wiki = Class Exercise: Understanding Pseudocode and the Turing Machine = The Diffusion algorithm * Inputs: ** Two end temperatures (TL and TR) ** A list of 5 starting temperatures. * Outputs: ** A list of 5 steady-state temperatures and the heat current. * Pseudocode: # Compute QLA = (TL – TA)/2 # Compute QAB = (TA – TB)/2 # Compute QBC = (TB – TC)/2 # Compute QCD = (TC – TD)/2 # Compute QDE = (TD – TE)/2 # Compute QER = (TE – TR)/2 # Set TA = TA + QLA - QAB # Set TB = TB + QAB - QBC # Set TC = TC + QBC - QCD # Set TD = TD + QCD - QDE # Set TE= TE + QDE - QER # If there were changes, go to step 1 Task: Choose 1 person as the CPU, and 11 others as memory locations (5 temperatures in the first row and 6 Q values in the back row). The CPU runs through the algorithm one step at a time and issues instructions to the memory locations (who hopefully remember their numbers). Assume the starting conditions are: TL=500 TA=100 TB = 200 TC=300 TD=400 TE=500 TR=100 QLA QAB QBC QCD QDE QER (undefined values at start) === Notes === Our class was able to achieve all 12 steps in about 5 minutes, giving us a processor speed of 0.04 operations per second (compare to giga-flops…). 3721b577adf1f77dfd781dd6b58daaa7ffb08a6a File:Week2-2017.pdf 6 124 544 2017-01-18T17:13:35Z David M. Rogers 2 wikitext text/x-wiki da39a3ee5e6b4b0d3255bfef95601890afd80709 545 544 2017-01-23T17:31:36Z David M. Rogers 2 David M. Rogers uploaded a new version of &quot;[[File:Week2-2017.pdf]]&quot; wikitext text/x-wiki da39a3ee5e6b4b0d3255bfef95601890afd80709 547 545 2017-01-25T17:23:00Z David M. Rogers 2 David M. Rogers uploaded a new version of &quot;[[File:Week2-2017.pdf]]&quot; wikitext text/x-wiki da39a3ee5e6b4b0d3255bfef95601890afd80709 555 547 2017-02-06T22:18:43Z David M. Rogers 2 David M. Rogers uploaded a new version of &quot;[[File:Week2-2017.pdf]]&quot; wikitext text/x-wiki da39a3ee5e6b4b0d3255bfef95601890afd80709 Code:PyTesting 0 125 551 2017-02-06T17:21:22Z David M. Rogers 2 Created page with "Use the following to get started with implementing your own dynamics programs. Focus on writing clean code, testing, and documentation with pseudocode. <source lang="python">..." wikitext text/x-wiki Use the following to get started with implementing your own dynamics programs. Focus on writing clean code, testing, and documentation with pseudocode. <source lang="python"> def logistic(r, x): ''' Execute a single step of the logistic map. input: output: >>> logistic(0.25, 0.5) 0.0625 >>> logistic(3.2, 0.7) 0.672 >>> round(logistic(3.6, 0.1), 6) 0.324 ''' return r*x*(1.0-x) # TODO: Create explanation and tests here! def order(a, b): if a < b: return a, b else: # a >= b return b, a def gcd(a, b): ''' Implement Euclid's algorithm to find the greatest common divisor of a and b input: integer a, b output: integer gcd(a,b) >>> gcd(10, 2) 2 >>> gcd(30, 18) 6 ''' b, a = order(b, a) while b != 0: #print "%d, %d"%(a,b) a = a % b # a < b a, b = b, a return a def reduce(n, m): ''' Reduce the quotient n/m into lowest terms. >>> reduce(10, 2) (5, 1) ''' return (5, 1) # More functions to implement here: ## Arnold's cat map ## Tinkerbell attractor ## Lorentz attractor if __name__ == "__main__": import doctest doctest.testmod() </source> 109598f34fcd60de2dc728a1e7641febb18e2264 File:Week-5.2017.pdf 6 126 554 2017-02-06T17:22:48Z David M. Rogers 2 wikitext text/x-wiki da39a3ee5e6b4b0d3255bfef95601890afd80709 560 554 2017-02-08T20:28:27Z David M. Rogers 2 David M. Rogers uploaded a new version of &quot;[[File:Week-5.2017.pdf]]&quot; wikitext text/x-wiki da39a3ee5e6b4b0d3255bfef95601890afd80709 File:PlottingMaps.pdf 6 127 558 2017-02-08T17:20:53Z David M. Rogers 2 changed name wikitext text/x-wiki changed name d7a0ef4c27433e4976dcf1ea525325e952ee266c CompSciSpring2017 0 122 561 559 2017-02-13T17:26:17Z David M. Rogers 2 /* Notes */ wikitext text/x-wiki '''<BIG>Introduction to Scientific Computing</BIG>''' Course Info * Course Numbers CHM 4932-004/6938-010, CRN: 21864/21865 * Credit Hours: 3 * Meeting Dates: January 9 - April 26, 2017 ** No Class Jan. 16 or Mar. 13-17 * Meeting Times: Mon. and Wed., 12:30-13:45 in SCA 222 ** Lab Session & Office Hours: Fri. 12:30-13:45 in IDR 214 (or SCA 222 by announcement) == Overview == Mathematical models in the natural sciences take many shapes and forms. The moment they become more complicated than tracking a few variables over time, we have to put away our Excel spreadsheets and make use of a solid foundation in computational science. The course establishes this foundation by introducing data structures and algorithms used in everyday scientific computing using examples in the python scripting language. By the end of the Semester, students will be able to navigate the Linux command-line to go from a mathematical model to a numerical solution. Best practices for working with computer code and visualizing data will also be covered. == Topics == # Languages #* bash (shell) #* python (scripting) #* stack & register-based machine languages: overview of C and Fortran syntax & compiling with gcc, ‘thread safety’ #* Shared libraries & language inter-operability (FFI) # Algorithms #* Horner’s algorithm for polynomials #* Newton’s root finding algo. #* Overview of general optimization algo-s (example: linear & nonlin. least-squares) #* Numerical integration (scripted, plus gnu ODE) #* Communication (how HTTP get/put works) # Data Structures #* Linked Lists #* Trees (file system hierarchies) #* Graphs #* Arrays (dense & sparse) example: vectors & rotations / transpositions, densities and difference operators # Presentation & visualization #* Flat CSV files (and excel) #* Working with binary data #* Python matplotlib (2D images) #* Binning histograms & weighted averages # Best Practices #* High-level code design (modularity, interface specifications, unit testing, etc.) #* Code audit: open-source libraries, ex. Gnu Scientific Library, qsort in libc, Boost #* Source code versioning (example: git or mercurial) #* gdb & execution profiling #* documentation #* Makefiles == Grading == '''Grading Scale (out of 400 points possible)''' {| class="wikitable" |- ! Grade ! Undergraduate ! Graduate |- | A | 230 | 300 |- | B | 180 | 230 |- | C | 150 | 180 |- | D | 120 | 150 |} * Points Possible: ** 10 homework assignments (20 points per homework) ** 2 projects / competitions (100 points per project) * Homework Rules ** For work done in groups, credit is divided equally among participants - so the max homework grade for a group of 2 is 10 points each. ** For each homework, 1 re-do at full credit can be sent at any time after the due date, but must present a unique solution to previous work from yourself or others. ** All work must cite co-group members (if any) and the source of any code snippets used online. === Grading Rationale === Homework points will only be awarded for correct, working code and correct algorithmic analysis, while the homework problems will become progressively tougher. Undergraduates should be able to pass the course with an A if they have correctly answered most of the homework, and made a strong attempt at one of the projects. Graduate students should both perform well on the homework and successfully complete one or two projects. Essentially, this means you should do your own homework when possible and may do a project in a small group. The re-grading and group options for homework allow making up for missed assignments, and encourage returning to core concepts at a later point in the class. Students who have completed significant portions of the homework have thus demonstrated programming proficiency, and are qualified for at least B/C grades. == Projects == TBA - see previous years (e.g. [[CompSciSpring2016]]) for a general idea. == Textbooks and Resources == * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-0072-7 Beginning Python, Hetland, 2005] (eBook avail. from USF Library) * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-3238-4 Python Algorithms, Hetland, 2010] (eBook avail. from USF Library) * [http://aosabook.org/en/index.html The Architecture of Open Source Applications] * [http://docs.python.org Python Documentation] * [https://developers.google.com/edu/python/ Google Introductory Python Notes] * [http://huffman.sourceforge.net/tao/tao-of-programming.html Tao of Programming] Other (possibly useful) materials: * [http://hackersdictionary.com/html/entry/larval-stage.html The Jargon File] * Chapters 7&8 of Modelling and Simulation, Birta and Arbez, Springer 2007 (eBook avail. from USF Library). * Chapters 4-6 of Models and Algorithms for Intelligent Data Analysis, Runkler, Springer 2012 (eBook avail. from USF Library). * Guide to Scientific Computing in C++, Francis and Whiteley, Springer, 2012. (eBook avail. from USF Library) * Extra info. On the basics: ** Chapters 3 and 7 of Mathematics in Computing, Regan, Springer 2013. (eBook avail. from USF Library) ** Instant feedback graphical programming with [https://www.khanacademy.org/cs/programming/ Khan Academy] * [http://www.meetup.com/python-178/ Local PyBulls Meetings] Code: * [http://carsonfarmer.com/2013/07/essential-python-geo-libraries Python Libraries Useful for Geospatial Problems] * [[Code#Python_Libraries|Python Libraries Useful for Computational Chemistry]] (very small list at present) Interactive Interpreters: * [http://www.codewars.com CodeWars] Recommended for building experience with practice problems. * [http://codecombat.com/ CodeCombat] A very visual way to interact with your python code. * [http://exercism.io Exercism] A command-line client with a similar learn-through-challenge philosophy. * [http://repl.it repl.it] A read-eval-print loop for several computer languages. * [http://en.cppreference.com/w/cpp/language CppReference] Documentation with an online evaluator for C++ code. === Notes === * [[Media:Intro.pdf|Introduction Notes]] * [[Media:Week2-2017.pdf|Week 2-3 Notes]] * Week 4: read through function syntax in [[Media:Week2.pdf|2016 Week 2]] and for-loops in [[Media:Week3.pdf|2016 Week 3-4]] * In-Class Examples ** [[Turing Exercise]] ** [https://predictivestatmech.org/code/example.dcd Example DCD File] * [[Media:Week-5.2017.pdf|Week 5 Notes]] * [[Media:PlottingMaps.pdf|Week 6 Notes]] ** [[Code:PyTesting]] <source lang="python"> # Loop examples T = [500, 100, 200, 300, 400, 100] Q = [0]*5 print(len(T)) print(len(Q)) k = 0.5 Q[0] = (T[1]-T[0])*(-k) Q[1] = (T[2]-T[1])*(-k) Q[2] = (T[3]-T[2])*(-k) Q[3] = (T[4]-T[3])*(-k) Q[4] = (T[5]-T[4])*(-k) # or use a for-loop! r = 0.25 x = 0.5 x = r*x*(1-x) x = r*x*(1-x) x = r*x*(1-x) x = r*x*(1-x) x = r*x*(1-x) x = r*x*(1-x) out = "" for i in [0,4,13,32,64,128]: out = out + str(i) + ", " # Hint for Homework 3 def dcd_info(f): # file -> string d = f.read() frames = unpack("<i", d[?]) # string -> int timestep = unpack("f", d[?]) # string -> float N = unpack("<i", d[?]) # string -> int return [frames, timestep, N] </source> * Homework 4 cut and paste! <source lang="python"> # from https://adamcoster.com/2011/01/13/python-clean-up-and-translate-nucleotide-sequences/ gencode = { 'ATA':'I', 'ATC':'I', 'ATT':'I', 'ATG':'M', 'ACA':'T', 'ACC':'T', 'ACG':'T', 'ACT':'T', 'AAC':'N', 'AAT':'N', 'AAA':'K', 'AAG':'K', 'AGC':'S', 'AGT':'S', 'AGA':'R', 'AGG':'R', 'CTA':'L', 'CTC':'L', 'CTG':'L', 'CTT':'L', 'CCA':'P', 'CCC':'P', 'CCG':'P', 'CCT':'P', 'CAC':'H', 'CAT':'H', 'CAA':'Q', 'CAG':'Q', 'CGA':'R', 'CGC':'R', 'CGG':'R', 'CGT':'R', 'GTA':'V', 'GTC':'V', 'GTG':'V', 'GTT':'V', 'GCA':'A', 'GCC':'A', 'GCG':'A', 'GCT':'A', 'GAC':'D', 'GAT':'D', 'GAA':'E', 'GAG':'E', 'GGA':'G', 'GGC':'G', 'GGG':'G', 'GGT':'G', 'TCA':'S', 'TCC':'S', 'TCG':'S', 'TCT':'S', 'TTC':'F', 'TTT':'F', 'TTA':'L', 'TTG':'L', 'TAC':'Y', 'TAT':'Y', 'TAA':'_', 'TAG':'_', 'TGC':'C', 'TGT':'C', 'TGA':'_', 'TGG':'W'} def translate(nuc): """ Translate a nucleotide sequence (containing letters from ATGC) to a protein sequence (containing one-character abbreviations for the 20-common amino acids). >>> translate('ATG') 'M' >>> translate(' 1 AtG CAT gat') 'MHD' >>> translate(' 1 atggaagaat cacaggcaga actcaatgtg gagccccctc tgagtcag') 'MEESQAELNVEPPLSQ' """ prot = [] for i in range(2): prot += gencode[nuc[i:i+3]] return "".join(prot) # Given a list of parameter names and a list of numeric values, create # a dictionary mapping names to values. def get_params(sparams): r""" Input: sparams : str Output: params : dict >>> get_params("atoms = 100") {'atoms': 100.0} >>> get_params("dt = 0.001\n" \ ... +"temp = 300\n") {'dt': 0.001, 'temp': 300.0} >>> get_params("press = 10\n" \ ... +"vol = 220\n") {'press': 10.0, 'vol': 220.0} >>> get_params("dt = 0.002\n" \ ... +"N = 3000\n" \ ... +"temp = 320\n" \ ... +"press = 1\n" \ ... +"L = 20\n") {'press': 1.0, 'dt': 0.002, 'L': 20.0, 'temp': 320.0, 'N': 3000.0} """ return {'dt': 0.001, 'N': 400.0} def newton(x, v, m, k, dt): ''' Carry out one step of Newton's equation, F = m a Using the Euler integration scheme with timestep 'dt'. The force should be computed using Hook's law: F = -k*x >>> newton(1.0, 0.0, 1.0, 0.3, 0.1) (1.0, -0.03) >>> newton(0.2,-0.2, 1.0, 0.4, 0.02) (0.196, -0.2016) >>> newton(0.5, 0.1, 1.0, 0.2, 0.05) (0.505, 0.095) >>> newton(-0.2, -0.1, 1.0, 0.3, 0.01) (-0.201, -0.0994) ''' return (x, v) print(translate("ATGC")) print(get_params(" atoms = 100 ")) print(newton(1.0, 0.0, 1.0, 0.3, 0.1)) </source> === Homework === * Homework will be assigned through [https://repl.it/classroom/invite/BtxEVLe Repl.IT] ** Homework 1 is due Friday, Jan. 20 ** Homework 2 is due Friday, Jan 27 ** Homework 3 is due Friday, Feb 10 ** Homework 4 is due Friday, Feb 17 1ed60c9e704edfa24e7f91f64f38825347749d54 563 561 2017-02-20T17:19:28Z David M. Rogers 2 /* Notes */ wikitext text/x-wiki '''<BIG>Introduction to Scientific Computing</BIG>''' Course Info * Course Numbers CHM 4932-004/6938-010, CRN: 21864/21865 * Credit Hours: 3 * Meeting Dates: January 9 - April 26, 2017 ** No Class Jan. 16 or Mar. 13-17 * Meeting Times: Mon. and Wed., 12:30-13:45 in SCA 222 ** Lab Session & Office Hours: Fri. 12:30-13:45 in IDR 214 (or SCA 222 by announcement) == Overview == Mathematical models in the natural sciences take many shapes and forms. The moment they become more complicated than tracking a few variables over time, we have to put away our Excel spreadsheets and make use of a solid foundation in computational science. The course establishes this foundation by introducing data structures and algorithms used in everyday scientific computing using examples in the python scripting language. By the end of the Semester, students will be able to navigate the Linux command-line to go from a mathematical model to a numerical solution. Best practices for working with computer code and visualizing data will also be covered. == Topics == # Languages #* bash (shell) #* python (scripting) #* stack & register-based machine languages: overview of C and Fortran syntax & compiling with gcc, ‘thread safety’ #* Shared libraries & language inter-operability (FFI) # Algorithms #* Horner’s algorithm for polynomials #* Newton’s root finding algo. #* Overview of general optimization algo-s (example: linear & nonlin. least-squares) #* Numerical integration (scripted, plus gnu ODE) #* Communication (how HTTP get/put works) # Data Structures #* Linked Lists #* Trees (file system hierarchies) #* Graphs #* Arrays (dense & sparse) example: vectors & rotations / transpositions, densities and difference operators # Presentation & visualization #* Flat CSV files (and excel) #* Working with binary data #* Python matplotlib (2D images) #* Binning histograms & weighted averages # Best Practices #* High-level code design (modularity, interface specifications, unit testing, etc.) #* Code audit: open-source libraries, ex. Gnu Scientific Library, qsort in libc, Boost #* Source code versioning (example: git or mercurial) #* gdb & execution profiling #* documentation #* Makefiles == Grading == '''Grading Scale (out of 400 points possible)''' {| class="wikitable" |- ! Grade ! Undergraduate ! Graduate |- | A | 230 | 300 |- | B | 180 | 230 |- | C | 150 | 180 |- | D | 120 | 150 |} * Points Possible: ** 10 homework assignments (20 points per homework) ** 2 projects / competitions (100 points per project) * Homework Rules ** For work done in groups, credit is divided equally among participants - so the max homework grade for a group of 2 is 10 points each. ** For each homework, 1 re-do at full credit can be sent at any time after the due date, but must present a unique solution to previous work from yourself or others. ** All work must cite co-group members (if any) and the source of any code snippets used online. === Grading Rationale === Homework points will only be awarded for correct, working code and correct algorithmic analysis, while the homework problems will become progressively tougher. Undergraduates should be able to pass the course with an A if they have correctly answered most of the homework, and made a strong attempt at one of the projects. Graduate students should both perform well on the homework and successfully complete one or two projects. Essentially, this means you should do your own homework when possible and may do a project in a small group. The re-grading and group options for homework allow making up for missed assignments, and encourage returning to core concepts at a later point in the class. Students who have completed significant portions of the homework have thus demonstrated programming proficiency, and are qualified for at least B/C grades. == Projects == TBA - see previous years (e.g. [[CompSciSpring2016]]) for a general idea. == Textbooks and Resources == * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-0072-7 Beginning Python, Hetland, 2005] (eBook avail. from USF Library) * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-3238-4 Python Algorithms, Hetland, 2010] (eBook avail. from USF Library) * [http://aosabook.org/en/index.html The Architecture of Open Source Applications] * [http://docs.python.org Python Documentation] * [https://developers.google.com/edu/python/ Google Introductory Python Notes] * [http://huffman.sourceforge.net/tao/tao-of-programming.html Tao of Programming] Other (possibly useful) materials: * [http://hackersdictionary.com/html/entry/larval-stage.html The Jargon File] * Chapters 7&8 of Modelling and Simulation, Birta and Arbez, Springer 2007 (eBook avail. from USF Library). * Chapters 4-6 of Models and Algorithms for Intelligent Data Analysis, Runkler, Springer 2012 (eBook avail. from USF Library). * Guide to Scientific Computing in C++, Francis and Whiteley, Springer, 2012. (eBook avail. from USF Library) * Extra info. On the basics: ** Chapters 3 and 7 of Mathematics in Computing, Regan, Springer 2013. (eBook avail. from USF Library) ** Instant feedback graphical programming with [https://www.khanacademy.org/cs/programming/ Khan Academy] * [http://www.meetup.com/python-178/ Local PyBulls Meetings] Code: * [http://carsonfarmer.com/2013/07/essential-python-geo-libraries Python Libraries Useful for Geospatial Problems] * [[Code#Python_Libraries|Python Libraries Useful for Computational Chemistry]] (very small list at present) Interactive Interpreters: * [http://www.codewars.com CodeWars] Recommended for building experience with practice problems. * [http://codecombat.com/ CodeCombat] A very visual way to interact with your python code. * [http://exercism.io Exercism] A command-line client with a similar learn-through-challenge philosophy. * [http://repl.it repl.it] A read-eval-print loop for several computer languages. * [http://en.cppreference.com/w/cpp/language CppReference] Documentation with an online evaluator for C++ code. === Notes === * [[Media:Intro.pdf|Introduction Notes]] * [[Media:Week2-2017.pdf|Week 2-3 Notes]] * Week 4: read through function syntax in [[Media:Week2.pdf|2016 Week 2]] and for-loops in [[Media:Week3.pdf|2016 Week 3-4]] * In-Class Examples ** [[Turing Exercise]] ** [https://predictivestatmech.org/code/example.dcd Example DCD File] * [[Media:Week-5.2017.pdf|Week 5 Notes]] * [[Media:PlottingMaps.pdf|Week 6 Notes]] ** [[Code:PyTesting]] * [[Media:NumpyArrays|Week 7 Notes]] ** [http://www.labri.fr/perso/nrougier/from-python-to-numpy/ all about numpy] === Homework === * Homework will be assigned through [https://repl.it/classroom/invite/BtxEVLe Repl.IT] ** Homework 1 is due Friday, Jan. 20 ** Homework 2 is due Friday, Jan 27 ** Homework 3 is due Friday, Feb 10 ** Homework 4 is due Friday, Feb 17 1a84fab796baf130cb67d56cc6d3d59dc13149ca 565 563 2017-02-20T17:21:14Z David M. Rogers 2 /* Notes */ wikitext text/x-wiki '''<BIG>Introduction to Scientific Computing</BIG>''' Course Info * Course Numbers CHM 4932-004/6938-010, CRN: 21864/21865 * Credit Hours: 3 * Meeting Dates: January 9 - April 26, 2017 ** No Class Jan. 16 or Mar. 13-17 * Meeting Times: Mon. and Wed., 12:30-13:45 in SCA 222 ** Lab Session & Office Hours: Fri. 12:30-13:45 in IDR 214 (or SCA 222 by announcement) == Overview == Mathematical models in the natural sciences take many shapes and forms. The moment they become more complicated than tracking a few variables over time, we have to put away our Excel spreadsheets and make use of a solid foundation in computational science. The course establishes this foundation by introducing data structures and algorithms used in everyday scientific computing using examples in the python scripting language. By the end of the Semester, students will be able to navigate the Linux command-line to go from a mathematical model to a numerical solution. Best practices for working with computer code and visualizing data will also be covered. == Topics == # Languages #* bash (shell) #* python (scripting) #* stack & register-based machine languages: overview of C and Fortran syntax & compiling with gcc, ‘thread safety’ #* Shared libraries & language inter-operability (FFI) # Algorithms #* Horner’s algorithm for polynomials #* Newton’s root finding algo. #* Overview of general optimization algo-s (example: linear & nonlin. least-squares) #* Numerical integration (scripted, plus gnu ODE) #* Communication (how HTTP get/put works) # Data Structures #* Linked Lists #* Trees (file system hierarchies) #* Graphs #* Arrays (dense & sparse) example: vectors & rotations / transpositions, densities and difference operators # Presentation & visualization #* Flat CSV files (and excel) #* Working with binary data #* Python matplotlib (2D images) #* Binning histograms & weighted averages # Best Practices #* High-level code design (modularity, interface specifications, unit testing, etc.) #* Code audit: open-source libraries, ex. Gnu Scientific Library, qsort in libc, Boost #* Source code versioning (example: git or mercurial) #* gdb & execution profiling #* documentation #* Makefiles == Grading == '''Grading Scale (out of 400 points possible)''' {| class="wikitable" |- ! Grade ! Undergraduate ! Graduate |- | A | 230 | 300 |- | B | 180 | 230 |- | C | 150 | 180 |- | D | 120 | 150 |} * Points Possible: ** 10 homework assignments (20 points per homework) ** 2 projects / competitions (100 points per project) * Homework Rules ** For work done in groups, credit is divided equally among participants - so the max homework grade for a group of 2 is 10 points each. ** For each homework, 1 re-do at full credit can be sent at any time after the due date, but must present a unique solution to previous work from yourself or others. ** All work must cite co-group members (if any) and the source of any code snippets used online. === Grading Rationale === Homework points will only be awarded for correct, working code and correct algorithmic analysis, while the homework problems will become progressively tougher. Undergraduates should be able to pass the course with an A if they have correctly answered most of the homework, and made a strong attempt at one of the projects. Graduate students should both perform well on the homework and successfully complete one or two projects. Essentially, this means you should do your own homework when possible and may do a project in a small group. The re-grading and group options for homework allow making up for missed assignments, and encourage returning to core concepts at a later point in the class. Students who have completed significant portions of the homework have thus demonstrated programming proficiency, and are qualified for at least B/C grades. == Projects == TBA - see previous years (e.g. [[CompSciSpring2016]]) for a general idea. == Textbooks and Resources == * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-0072-7 Beginning Python, Hetland, 2005] (eBook avail. from USF Library) * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-3238-4 Python Algorithms, Hetland, 2010] (eBook avail. from USF Library) * [http://aosabook.org/en/index.html The Architecture of Open Source Applications] * [http://docs.python.org Python Documentation] * [https://developers.google.com/edu/python/ Google Introductory Python Notes] * [http://huffman.sourceforge.net/tao/tao-of-programming.html Tao of Programming] Other (possibly useful) materials: * [http://hackersdictionary.com/html/entry/larval-stage.html The Jargon File] * Chapters 7&8 of Modelling and Simulation, Birta and Arbez, Springer 2007 (eBook avail. from USF Library). * Chapters 4-6 of Models and Algorithms for Intelligent Data Analysis, Runkler, Springer 2012 (eBook avail. from USF Library). * Guide to Scientific Computing in C++, Francis and Whiteley, Springer, 2012. (eBook avail. from USF Library) * Extra info. On the basics: ** Chapters 3 and 7 of Mathematics in Computing, Regan, Springer 2013. (eBook avail. from USF Library) ** Instant feedback graphical programming with [https://www.khanacademy.org/cs/programming/ Khan Academy] * [http://www.meetup.com/python-178/ Local PyBulls Meetings] Code: * [http://carsonfarmer.com/2013/07/essential-python-geo-libraries Python Libraries Useful for Geospatial Problems] * [[Code#Python_Libraries|Python Libraries Useful for Computational Chemistry]] (very small list at present) Interactive Interpreters: * [http://www.codewars.com CodeWars] Recommended for building experience with practice problems. * [http://codecombat.com/ CodeCombat] A very visual way to interact with your python code. * [http://exercism.io Exercism] A command-line client with a similar learn-through-challenge philosophy. * [http://repl.it repl.it] A read-eval-print loop for several computer languages. * [http://en.cppreference.com/w/cpp/language CppReference] Documentation with an online evaluator for C++ code. === Notes === * [[Media:Intro.pdf|Introduction Notes]] * [[Media:Week2-2017.pdf|Week 2-3 Notes]] * Week 4: read through function syntax in [[Media:Week2.pdf|2016 Week 2]] and for-loops in [[Media:Week3.pdf|2016 Week 3-4]] * In-Class Examples ** [[Turing Exercise]] ** [https://predictivestatmech.org/code/example.dcd Example DCD File] * [[Media:Week-5.2017.pdf|Week 5 Notes]] * [[Media:PlottingMaps.pdf|Week 6 Notes]] ** [[Code:PyTesting]] * [[Media:NumpyArrays.pdf|Week 7 Notes]] ** [http://www.labri.fr/perso/nrougier/from-python-to-numpy/ all about numpy] === Homework === * Homework will be assigned through [https://repl.it/classroom/invite/BtxEVLe Repl.IT] ** Homework 1 is due Friday, Jan. 20 ** Homework 2 is due Friday, Jan 27 ** Homework 3 is due Friday, Feb 10 ** Homework 4 is due Friday, Feb 17 51532f446d2526c195ed61ae6710bb0e8c519555 566 565 2017-02-22T17:29:12Z David M. Rogers 2 /* Projects */ wikitext text/x-wiki '''<BIG>Introduction to Scientific Computing</BIG>''' Course Info * Course Numbers CHM 4932-004/6938-010, CRN: 21864/21865 * Credit Hours: 3 * Meeting Dates: January 9 - April 26, 2017 ** No Class Jan. 16 or Mar. 13-17 * Meeting Times: Mon. and Wed., 12:30-13:45 in SCA 222 ** Lab Session & Office Hours: Fri. 12:30-13:45 in IDR 214 (or SCA 222 by announcement) == Overview == Mathematical models in the natural sciences take many shapes and forms. The moment they become more complicated than tracking a few variables over time, we have to put away our Excel spreadsheets and make use of a solid foundation in computational science. The course establishes this foundation by introducing data structures and algorithms used in everyday scientific computing using examples in the python scripting language. By the end of the Semester, students will be able to navigate the Linux command-line to go from a mathematical model to a numerical solution. Best practices for working with computer code and visualizing data will also be covered. == Topics == # Languages #* bash (shell) #* python (scripting) #* stack & register-based machine languages: overview of C and Fortran syntax & compiling with gcc, ‘thread safety’ #* Shared libraries & language inter-operability (FFI) # Algorithms #* Horner’s algorithm for polynomials #* Newton’s root finding algo. #* Overview of general optimization algo-s (example: linear & nonlin. least-squares) #* Numerical integration (scripted, plus gnu ODE) #* Communication (how HTTP get/put works) # Data Structures #* Linked Lists #* Trees (file system hierarchies) #* Graphs #* Arrays (dense & sparse) example: vectors & rotations / transpositions, densities and difference operators # Presentation & visualization #* Flat CSV files (and excel) #* Working with binary data #* Python matplotlib (2D images) #* Binning histograms & weighted averages # Best Practices #* High-level code design (modularity, interface specifications, unit testing, etc.) #* Code audit: open-source libraries, ex. Gnu Scientific Library, qsort in libc, Boost #* Source code versioning (example: git or mercurial) #* gdb & execution profiling #* documentation #* Makefiles == Grading == '''Grading Scale (out of 400 points possible)''' {| class="wikitable" |- ! Grade ! Undergraduate ! Graduate |- | A | 230 | 300 |- | B | 180 | 230 |- | C | 150 | 180 |- | D | 120 | 150 |} * Points Possible: ** 10 homework assignments (20 points per homework) ** 2 projects / competitions (100 points per project) * Homework Rules ** For work done in groups, credit is divided equally among participants - so the max homework grade for a group of 2 is 10 points each. ** For each homework, 1 re-do at full credit can be sent at any time after the due date, but must present a unique solution to previous work from yourself or others. ** All work must cite co-group members (if any) and the source of any code snippets used online. === Grading Rationale === Homework points will only be awarded for correct, working code and correct algorithmic analysis, while the homework problems will become progressively tougher. Undergraduates should be able to pass the course with an A if they have correctly answered most of the homework, and made a strong attempt at one of the projects. Graduate students should both perform well on the homework and successfully complete one or two projects. Essentially, this means you should do your own homework when possible and may do a project in a small group. The re-grading and group options for homework allow making up for missed assignments, and encourage returning to core concepts at a later point in the class. Students who have completed significant portions of the homework have thus demonstrated programming proficiency, and are qualified for at least B/C grades. == Projects == * Midterm Project Description [[Media:Midterm2017.pdf]] == Textbooks and Resources == * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-0072-7 Beginning Python, Hetland, 2005] (eBook avail. from USF Library) * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-3238-4 Python Algorithms, Hetland, 2010] (eBook avail. from USF Library) * [http://aosabook.org/en/index.html The Architecture of Open Source Applications] * [http://docs.python.org Python Documentation] * [https://developers.google.com/edu/python/ Google Introductory Python Notes] * [http://huffman.sourceforge.net/tao/tao-of-programming.html Tao of Programming] Other (possibly useful) materials: * [http://hackersdictionary.com/html/entry/larval-stage.html The Jargon File] * Chapters 7&8 of Modelling and Simulation, Birta and Arbez, Springer 2007 (eBook avail. from USF Library). * Chapters 4-6 of Models and Algorithms for Intelligent Data Analysis, Runkler, Springer 2012 (eBook avail. from USF Library). * Guide to Scientific Computing in C++, Francis and Whiteley, Springer, 2012. (eBook avail. from USF Library) * Extra info. On the basics: ** Chapters 3 and 7 of Mathematics in Computing, Regan, Springer 2013. (eBook avail. from USF Library) ** Instant feedback graphical programming with [https://www.khanacademy.org/cs/programming/ Khan Academy] * [http://www.meetup.com/python-178/ Local PyBulls Meetings] Code: * [http://carsonfarmer.com/2013/07/essential-python-geo-libraries Python Libraries Useful for Geospatial Problems] * [[Code#Python_Libraries|Python Libraries Useful for Computational Chemistry]] (very small list at present) Interactive Interpreters: * [http://www.codewars.com CodeWars] Recommended for building experience with practice problems. * [http://codecombat.com/ CodeCombat] A very visual way to interact with your python code. * [http://exercism.io Exercism] A command-line client with a similar learn-through-challenge philosophy. * [http://repl.it repl.it] A read-eval-print loop for several computer languages. * [http://en.cppreference.com/w/cpp/language CppReference] Documentation with an online evaluator for C++ code. === Notes === * [[Media:Intro.pdf|Introduction Notes]] * [[Media:Week2-2017.pdf|Week 2-3 Notes]] * Week 4: read through function syntax in [[Media:Week2.pdf|2016 Week 2]] and for-loops in [[Media:Week3.pdf|2016 Week 3-4]] * In-Class Examples ** [[Turing Exercise]] ** [https://predictivestatmech.org/code/example.dcd Example DCD File] * [[Media:Week-5.2017.pdf|Week 5 Notes]] * [[Media:PlottingMaps.pdf|Week 6 Notes]] ** [[Code:PyTesting]] * [[Media:NumpyArrays.pdf|Week 7 Notes]] ** [http://www.labri.fr/perso/nrougier/from-python-to-numpy/ all about numpy] === Homework === * Homework will be assigned through [https://repl.it/classroom/invite/BtxEVLe Repl.IT] ** Homework 1 is due Friday, Jan. 20 ** Homework 2 is due Friday, Jan 27 ** Homework 3 is due Friday, Feb 10 ** Homework 4 is due Friday, Feb 17 dfbccce88b4cc3608371d1d31cfb11ff0d512894 568 566 2017-02-22T18:21:18Z David M. Rogers 2 /* Homework */ wikitext text/x-wiki '''<BIG>Introduction to Scientific Computing</BIG>''' Course Info * Course Numbers CHM 4932-004/6938-010, CRN: 21864/21865 * Credit Hours: 3 * Meeting Dates: January 9 - April 26, 2017 ** No Class Jan. 16 or Mar. 13-17 * Meeting Times: Mon. and Wed., 12:30-13:45 in SCA 222 ** Lab Session & Office Hours: Fri. 12:30-13:45 in IDR 214 (or SCA 222 by announcement) == Overview == Mathematical models in the natural sciences take many shapes and forms. The moment they become more complicated than tracking a few variables over time, we have to put away our Excel spreadsheets and make use of a solid foundation in computational science. The course establishes this foundation by introducing data structures and algorithms used in everyday scientific computing using examples in the python scripting language. By the end of the Semester, students will be able to navigate the Linux command-line to go from a mathematical model to a numerical solution. Best practices for working with computer code and visualizing data will also be covered. == Topics == # Languages #* bash (shell) #* python (scripting) #* stack & register-based machine languages: overview of C and Fortran syntax & compiling with gcc, ‘thread safety’ #* Shared libraries & language inter-operability (FFI) # Algorithms #* Horner’s algorithm for polynomials #* Newton’s root finding algo. #* Overview of general optimization algo-s (example: linear & nonlin. least-squares) #* Numerical integration (scripted, plus gnu ODE) #* Communication (how HTTP get/put works) # Data Structures #* Linked Lists #* Trees (file system hierarchies) #* Graphs #* Arrays (dense & sparse) example: vectors & rotations / transpositions, densities and difference operators # Presentation & visualization #* Flat CSV files (and excel) #* Working with binary data #* Python matplotlib (2D images) #* Binning histograms & weighted averages # Best Practices #* High-level code design (modularity, interface specifications, unit testing, etc.) #* Code audit: open-source libraries, ex. Gnu Scientific Library, qsort in libc, Boost #* Source code versioning (example: git or mercurial) #* gdb & execution profiling #* documentation #* Makefiles == Grading == '''Grading Scale (out of 400 points possible)''' {| class="wikitable" |- ! Grade ! Undergraduate ! Graduate |- | A | 230 | 300 |- | B | 180 | 230 |- | C | 150 | 180 |- | D | 120 | 150 |} * Points Possible: ** 10 homework assignments (20 points per homework) ** 2 projects / competitions (100 points per project) * Homework Rules ** For work done in groups, credit is divided equally among participants - so the max homework grade for a group of 2 is 10 points each. ** For each homework, 1 re-do at full credit can be sent at any time after the due date, but must present a unique solution to previous work from yourself or others. ** All work must cite co-group members (if any) and the source of any code snippets used online. === Grading Rationale === Homework points will only be awarded for correct, working code and correct algorithmic analysis, while the homework problems will become progressively tougher. Undergraduates should be able to pass the course with an A if they have correctly answered most of the homework, and made a strong attempt at one of the projects. Graduate students should both perform well on the homework and successfully complete one or two projects. Essentially, this means you should do your own homework when possible and may do a project in a small group. The re-grading and group options for homework allow making up for missed assignments, and encourage returning to core concepts at a later point in the class. Students who have completed significant portions of the homework have thus demonstrated programming proficiency, and are qualified for at least B/C grades. == Projects == * Midterm Project Description [[Media:Midterm2017.pdf]] == Textbooks and Resources == * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-0072-7 Beginning Python, Hetland, 2005] (eBook avail. from USF Library) * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-3238-4 Python Algorithms, Hetland, 2010] (eBook avail. from USF Library) * [http://aosabook.org/en/index.html The Architecture of Open Source Applications] * [http://docs.python.org Python Documentation] * [https://developers.google.com/edu/python/ Google Introductory Python Notes] * [http://huffman.sourceforge.net/tao/tao-of-programming.html Tao of Programming] Other (possibly useful) materials: * [http://hackersdictionary.com/html/entry/larval-stage.html The Jargon File] * Chapters 7&8 of Modelling and Simulation, Birta and Arbez, Springer 2007 (eBook avail. from USF Library). * Chapters 4-6 of Models and Algorithms for Intelligent Data Analysis, Runkler, Springer 2012 (eBook avail. from USF Library). * Guide to Scientific Computing in C++, Francis and Whiteley, Springer, 2012. (eBook avail. from USF Library) * Extra info. On the basics: ** Chapters 3 and 7 of Mathematics in Computing, Regan, Springer 2013. (eBook avail. from USF Library) ** Instant feedback graphical programming with [https://www.khanacademy.org/cs/programming/ Khan Academy] * [http://www.meetup.com/python-178/ Local PyBulls Meetings] Code: * [http://carsonfarmer.com/2013/07/essential-python-geo-libraries Python Libraries Useful for Geospatial Problems] * [[Code#Python_Libraries|Python Libraries Useful for Computational Chemistry]] (very small list at present) Interactive Interpreters: * [http://www.codewars.com CodeWars] Recommended for building experience with practice problems. * [http://codecombat.com/ CodeCombat] A very visual way to interact with your python code. * [http://exercism.io Exercism] A command-line client with a similar learn-through-challenge philosophy. * [http://repl.it repl.it] A read-eval-print loop for several computer languages. * [http://en.cppreference.com/w/cpp/language CppReference] Documentation with an online evaluator for C++ code. === Notes === * [[Media:Intro.pdf|Introduction Notes]] * [[Media:Week2-2017.pdf|Week 2-3 Notes]] * Week 4: read through function syntax in [[Media:Week2.pdf|2016 Week 2]] and for-loops in [[Media:Week3.pdf|2016 Week 3-4]] * In-Class Examples ** [[Turing Exercise]] ** [https://predictivestatmech.org/code/example.dcd Example DCD File] * [[Media:Week-5.2017.pdf|Week 5 Notes]] * [[Media:PlottingMaps.pdf|Week 6 Notes]] ** [[Code:PyTesting]] * [[Media:NumpyArrays.pdf|Week 7 Notes]] ** [http://www.labri.fr/perso/nrougier/from-python-to-numpy/ all about numpy] === Homework === * Homework will be assigned through [https://repl.it/classroom/invite/BtxEVLe Repl.IT] ** Homework 1 is due Friday, Jan. 20 ** Homework 2 is due Friday, Jan 27 ** Homework 3 is due Friday, Feb 10 ** Homework 4 is due Friday, Feb 17 Hints for HW 4 <source lang="python"> def translate(nuc): # 1. remove all non-ATGC characters from nuc # str -> str (nuc.translate) # str -> [char], [char] -> str # 2. capitalize all characters : str -> str # 3. translate 3-char blocks # str -> [char] # hint: range(0, len(s), 3) prot = [] for i in range(2): prot += gencode[nuc[i:i+3]] # 4. join characters return "".join(prot) # TODO: fix empty return and string-values! def get_params(sparams): print(sparams) # 1. split sparams on newlines # str -> [str] lines = sparams.split('\n') print(lines) # 2. create an empty dictionary d = {} # 3. for each line, split on ' ' # add key = val to d for line in lines: tok = line.split() print(tok) continue d[tok[0]] = tok[2] return d def newton(x, v, m, k, dt): dxdt = v dvdt = # acceleration (use F = m a), F = (use Hook's law) return (x+dt*dxdt, v+dt*dvdt) </source> 6438efd10005c8e941f7fbb5ad2474d52f7b2025 570 568 2017-02-27T17:30:47Z David M. Rogers 2 /* Notes */ wikitext text/x-wiki '''<BIG>Introduction to Scientific Computing</BIG>''' Course Info * Course Numbers CHM 4932-004/6938-010, CRN: 21864/21865 * Credit Hours: 3 * Meeting Dates: January 9 - April 26, 2017 ** No Class Jan. 16 or Mar. 13-17 * Meeting Times: Mon. and Wed., 12:30-13:45 in SCA 222 ** Lab Session & Office Hours: Fri. 12:30-13:45 in IDR 214 (or SCA 222 by announcement) == Overview == Mathematical models in the natural sciences take many shapes and forms. The moment they become more complicated than tracking a few variables over time, we have to put away our Excel spreadsheets and make use of a solid foundation in computational science. The course establishes this foundation by introducing data structures and algorithms used in everyday scientific computing using examples in the python scripting language. By the end of the Semester, students will be able to navigate the Linux command-line to go from a mathematical model to a numerical solution. Best practices for working with computer code and visualizing data will also be covered. == Topics == # Languages #* bash (shell) #* python (scripting) #* stack & register-based machine languages: overview of C and Fortran syntax & compiling with gcc, ‘thread safety’ #* Shared libraries & language inter-operability (FFI) # Algorithms #* Horner’s algorithm for polynomials #* Newton’s root finding algo. #* Overview of general optimization algo-s (example: linear & nonlin. least-squares) #* Numerical integration (scripted, plus gnu ODE) #* Communication (how HTTP get/put works) # Data Structures #* Linked Lists #* Trees (file system hierarchies) #* Graphs #* Arrays (dense & sparse) example: vectors & rotations / transpositions, densities and difference operators # Presentation & visualization #* Flat CSV files (and excel) #* Working with binary data #* Python matplotlib (2D images) #* Binning histograms & weighted averages # Best Practices #* High-level code design (modularity, interface specifications, unit testing, etc.) #* Code audit: open-source libraries, ex. Gnu Scientific Library, qsort in libc, Boost #* Source code versioning (example: git or mercurial) #* gdb & execution profiling #* documentation #* Makefiles == Grading == '''Grading Scale (out of 400 points possible)''' {| class="wikitable" |- ! Grade ! Undergraduate ! Graduate |- | A | 230 | 300 |- | B | 180 | 230 |- | C | 150 | 180 |- | D | 120 | 150 |} * Points Possible: ** 10 homework assignments (20 points per homework) ** 2 projects / competitions (100 points per project) * Homework Rules ** For work done in groups, credit is divided equally among participants - so the max homework grade for a group of 2 is 10 points each. ** For each homework, 1 re-do at full credit can be sent at any time after the due date, but must present a unique solution to previous work from yourself or others. ** All work must cite co-group members (if any) and the source of any code snippets used online. === Grading Rationale === Homework points will only be awarded for correct, working code and correct algorithmic analysis, while the homework problems will become progressively tougher. Undergraduates should be able to pass the course with an A if they have correctly answered most of the homework, and made a strong attempt at one of the projects. Graduate students should both perform well on the homework and successfully complete one or two projects. Essentially, this means you should do your own homework when possible and may do a project in a small group. The re-grading and group options for homework allow making up for missed assignments, and encourage returning to core concepts at a later point in the class. Students who have completed significant portions of the homework have thus demonstrated programming proficiency, and are qualified for at least B/C grades. == Projects == * Midterm Project Description [[Media:Midterm2017.pdf]] == Textbooks and Resources == * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-0072-7 Beginning Python, Hetland, 2005] (eBook avail. from USF Library) * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-3238-4 Python Algorithms, Hetland, 2010] (eBook avail. from USF Library) * [http://aosabook.org/en/index.html The Architecture of Open Source Applications] * [http://docs.python.org Python Documentation] * [https://developers.google.com/edu/python/ Google Introductory Python Notes] * [http://huffman.sourceforge.net/tao/tao-of-programming.html Tao of Programming] Other (possibly useful) materials: * [http://hackersdictionary.com/html/entry/larval-stage.html The Jargon File] * Chapters 7&8 of Modelling and Simulation, Birta and Arbez, Springer 2007 (eBook avail. from USF Library). * Chapters 4-6 of Models and Algorithms for Intelligent Data Analysis, Runkler, Springer 2012 (eBook avail. from USF Library). * Guide to Scientific Computing in C++, Francis and Whiteley, Springer, 2012. (eBook avail. from USF Library) * Extra info. On the basics: ** Chapters 3 and 7 of Mathematics in Computing, Regan, Springer 2013. (eBook avail. from USF Library) ** Instant feedback graphical programming with [https://www.khanacademy.org/cs/programming/ Khan Academy] * [http://www.meetup.com/python-178/ Local PyBulls Meetings] Code: * [http://carsonfarmer.com/2013/07/essential-python-geo-libraries Python Libraries Useful for Geospatial Problems] * [[Code#Python_Libraries|Python Libraries Useful for Computational Chemistry]] (very small list at present) Interactive Interpreters: * [http://www.codewars.com CodeWars] Recommended for building experience with practice problems. * [http://codecombat.com/ CodeCombat] A very visual way to interact with your python code. * [http://exercism.io Exercism] A command-line client with a similar learn-through-challenge philosophy. * [http://repl.it repl.it] A read-eval-print loop for several computer languages. * [http://en.cppreference.com/w/cpp/language CppReference] Documentation with an online evaluator for C++ code. === Notes === * [[Media:Intro.pdf|Introduction Notes]] * [[Media:Week2-2017.pdf|Week 2-3 Notes]] * Week 4: read through function syntax in [[Media:Week2.pdf|2016 Week 2]] and for-loops in [[Media:Week3.pdf|2016 Week 3-4]] * In-Class Examples ** [[Turing Exercise]] ** [https://predictivestatmech.org/code/example.dcd Example DCD File] * [[Media:Week-5.2017.pdf|Week 5 Notes]] * [[Media:PlottingMaps.pdf|Week 6 Notes]] ** [[Code:PyTesting]] * [[Media:NumpyArrays.pdf|Week 7 Notes]] ** [http://www.labri.fr/perso/nrougier/from-python-to-numpy/ all about numpy] ** [[Physics:Pairs|Rundown of Pair Interactions]] === Homework === * Homework will be assigned through [https://repl.it/classroom/invite/BtxEVLe Repl.IT] ** Homework 1 is due Friday, Jan. 20 ** Homework 2 is due Friday, Jan 27 ** Homework 3 is due Friday, Feb 10 ** Homework 4 is due Friday, Feb 17 Hints for HW 4 <source lang="python"> def translate(nuc): # 1. remove all non-ATGC characters from nuc # str -> str (nuc.translate) # str -> [char], [char] -> str # 2. capitalize all characters : str -> str # 3. translate 3-char blocks # str -> [char] # hint: range(0, len(s), 3) prot = [] for i in range(2): prot += gencode[nuc[i:i+3]] # 4. join characters return "".join(prot) # TODO: fix empty return and string-values! def get_params(sparams): print(sparams) # 1. split sparams on newlines # str -> [str] lines = sparams.split('\n') print(lines) # 2. create an empty dictionary d = {} # 3. for each line, split on ' ' # add key = val to d for line in lines: tok = line.split() print(tok) continue d[tok[0]] = tok[2] return d def newton(x, v, m, k, dt): dxdt = v dvdt = # acceleration (use F = m a), F = (use Hook's law) return (x+dt*dxdt, v+dt*dvdt) </source> 24b6ccbff9f871f6e75d6c898a1c78ffbe4cbbed 571 570 2017-03-01T19:09:25Z David M. Rogers 2 /* Homework */ wikitext text/x-wiki '''<BIG>Introduction to Scientific Computing</BIG>''' Course Info * Course Numbers CHM 4932-004/6938-010, CRN: 21864/21865 * Credit Hours: 3 * Meeting Dates: January 9 - April 26, 2017 ** No Class Jan. 16 or Mar. 13-17 * Meeting Times: Mon. and Wed., 12:30-13:45 in SCA 222 ** Lab Session & Office Hours: Fri. 12:30-13:45 in IDR 214 (or SCA 222 by announcement) == Overview == Mathematical models in the natural sciences take many shapes and forms. The moment they become more complicated than tracking a few variables over time, we have to put away our Excel spreadsheets and make use of a solid foundation in computational science. The course establishes this foundation by introducing data structures and algorithms used in everyday scientific computing using examples in the python scripting language. By the end of the Semester, students will be able to navigate the Linux command-line to go from a mathematical model to a numerical solution. Best practices for working with computer code and visualizing data will also be covered. == Topics == # Languages #* bash (shell) #* python (scripting) #* stack & register-based machine languages: overview of C and Fortran syntax & compiling with gcc, ‘thread safety’ #* Shared libraries & language inter-operability (FFI) # Algorithms #* Horner’s algorithm for polynomials #* Newton’s root finding algo. #* Overview of general optimization algo-s (example: linear & nonlin. least-squares) #* Numerical integration (scripted, plus gnu ODE) #* Communication (how HTTP get/put works) # Data Structures #* Linked Lists #* Trees (file system hierarchies) #* Graphs #* Arrays (dense & sparse) example: vectors & rotations / transpositions, densities and difference operators # Presentation & visualization #* Flat CSV files (and excel) #* Working with binary data #* Python matplotlib (2D images) #* Binning histograms & weighted averages # Best Practices #* High-level code design (modularity, interface specifications, unit testing, etc.) #* Code audit: open-source libraries, ex. Gnu Scientific Library, qsort in libc, Boost #* Source code versioning (example: git or mercurial) #* gdb & execution profiling #* documentation #* Makefiles == Grading == '''Grading Scale (out of 400 points possible)''' {| class="wikitable" |- ! Grade ! Undergraduate ! Graduate |- | A | 230 | 300 |- | B | 180 | 230 |- | C | 150 | 180 |- | D | 120 | 150 |} * Points Possible: ** 10 homework assignments (20 points per homework) ** 2 projects / competitions (100 points per project) * Homework Rules ** For work done in groups, credit is divided equally among participants - so the max homework grade for a group of 2 is 10 points each. ** For each homework, 1 re-do at full credit can be sent at any time after the due date, but must present a unique solution to previous work from yourself or others. ** All work must cite co-group members (if any) and the source of any code snippets used online. === Grading Rationale === Homework points will only be awarded for correct, working code and correct algorithmic analysis, while the homework problems will become progressively tougher. Undergraduates should be able to pass the course with an A if they have correctly answered most of the homework, and made a strong attempt at one of the projects. Graduate students should both perform well on the homework and successfully complete one or two projects. Essentially, this means you should do your own homework when possible and may do a project in a small group. The re-grading and group options for homework allow making up for missed assignments, and encourage returning to core concepts at a later point in the class. Students who have completed significant portions of the homework have thus demonstrated programming proficiency, and are qualified for at least B/C grades. == Projects == * Midterm Project Description [[Media:Midterm2017.pdf]] == Textbooks and Resources == * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-0072-7 Beginning Python, Hetland, 2005] (eBook avail. from USF Library) * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-3238-4 Python Algorithms, Hetland, 2010] (eBook avail. from USF Library) * [http://aosabook.org/en/index.html The Architecture of Open Source Applications] * [http://docs.python.org Python Documentation] * [https://developers.google.com/edu/python/ Google Introductory Python Notes] * [http://huffman.sourceforge.net/tao/tao-of-programming.html Tao of Programming] Other (possibly useful) materials: * [http://hackersdictionary.com/html/entry/larval-stage.html The Jargon File] * Chapters 7&8 of Modelling and Simulation, Birta and Arbez, Springer 2007 (eBook avail. from USF Library). * Chapters 4-6 of Models and Algorithms for Intelligent Data Analysis, Runkler, Springer 2012 (eBook avail. from USF Library). * Guide to Scientific Computing in C++, Francis and Whiteley, Springer, 2012. (eBook avail. from USF Library) * Extra info. On the basics: ** Chapters 3 and 7 of Mathematics in Computing, Regan, Springer 2013. (eBook avail. from USF Library) ** Instant feedback graphical programming with [https://www.khanacademy.org/cs/programming/ Khan Academy] * [http://www.meetup.com/python-178/ Local PyBulls Meetings] Code: * [http://carsonfarmer.com/2013/07/essential-python-geo-libraries Python Libraries Useful for Geospatial Problems] * [[Code#Python_Libraries|Python Libraries Useful for Computational Chemistry]] (very small list at present) Interactive Interpreters: * [http://www.codewars.com CodeWars] Recommended for building experience with practice problems. * [http://codecombat.com/ CodeCombat] A very visual way to interact with your python code. * [http://exercism.io Exercism] A command-line client with a similar learn-through-challenge philosophy. * [http://repl.it repl.it] A read-eval-print loop for several computer languages. * [http://en.cppreference.com/w/cpp/language CppReference] Documentation with an online evaluator for C++ code. === Notes === * [[Media:Intro.pdf|Introduction Notes]] * [[Media:Week2-2017.pdf|Week 2-3 Notes]] * Week 4: read through function syntax in [[Media:Week2.pdf|2016 Week 2]] and for-loops in [[Media:Week3.pdf|2016 Week 3-4]] * In-Class Examples ** [[Turing Exercise]] ** [https://predictivestatmech.org/code/example.dcd Example DCD File] * [[Media:Week-5.2017.pdf|Week 5 Notes]] * [[Media:PlottingMaps.pdf|Week 6 Notes]] ** [[Code:PyTesting]] * [[Media:NumpyArrays.pdf|Week 7 Notes]] ** [http://www.labri.fr/perso/nrougier/from-python-to-numpy/ all about numpy] ** [[Physics:Pairs|Rundown of Pair Interactions]] === Homework === * Homework will be assigned through [https://repl.it/classroom/invite/BtxEVLe Repl.IT] ** Homework 1 is due Friday, Jan. 20 ** Homework 2 is due Friday, Jan 27 ** Homework 3 is due Friday, Feb 10 ** Homework 4 is due Friday, Feb 17 ** Homework 5 is due Wednesday, Mar. 8 * Project presentations start Monday, Mar 27 Hints for HW 4 <source lang="python"> def translate(nuc): # 1. remove all non-ATGC characters from nuc # str -> str (nuc.translate) # str -> [char], [char] -> str # 2. capitalize all characters : str -> str # 3. translate 3-char blocks # str -> [char] # hint: range(0, len(s), 3) prot = [] for i in range(2): prot += gencode[nuc[i:i+3]] # 4. join characters return "".join(prot) # TODO: fix empty return and string-values! def get_params(sparams): print(sparams) # 1. split sparams on newlines # str -> [str] lines = sparams.split('\n') print(lines) # 2. create an empty dictionary d = {} # 3. for each line, split on ' ' # add key = val to d for line in lines: tok = line.split() print(tok) continue d[tok[0]] = tok[2] return d def newton(x, v, m, k, dt): dxdt = v dvdt = # acceleration (use F = m a), F = (use Hook's law) return (x+dt*dxdt, v+dt*dvdt) </source> 361ea351226d5dc0d438375befd45398862c847a 577 571 2017-03-08T17:31:29Z David M. Rogers 2 /* Notes */ wikitext text/x-wiki '''<BIG>Introduction to Scientific Computing</BIG>''' Course Info * Course Numbers CHM 4932-004/6938-010, CRN: 21864/21865 * Credit Hours: 3 * Meeting Dates: January 9 - April 26, 2017 ** No Class Jan. 16 or Mar. 13-17 * Meeting Times: Mon. and Wed., 12:30-13:45 in SCA 222 ** Lab Session & Office Hours: Fri. 12:30-13:45 in IDR 214 (or SCA 222 by announcement) == Overview == Mathematical models in the natural sciences take many shapes and forms. The moment they become more complicated than tracking a few variables over time, we have to put away our Excel spreadsheets and make use of a solid foundation in computational science. The course establishes this foundation by introducing data structures and algorithms used in everyday scientific computing using examples in the python scripting language. By the end of the Semester, students will be able to navigate the Linux command-line to go from a mathematical model to a numerical solution. Best practices for working with computer code and visualizing data will also be covered. == Topics == # Languages #* bash (shell) #* python (scripting) #* stack & register-based machine languages: overview of C and Fortran syntax & compiling with gcc, ‘thread safety’ #* Shared libraries & language inter-operability (FFI) # Algorithms #* Horner’s algorithm for polynomials #* Newton’s root finding algo. #* Overview of general optimization algo-s (example: linear & nonlin. least-squares) #* Numerical integration (scripted, plus gnu ODE) #* Communication (how HTTP get/put works) # Data Structures #* Linked Lists #* Trees (file system hierarchies) #* Graphs #* Arrays (dense & sparse) example: vectors & rotations / transpositions, densities and difference operators # Presentation & visualization #* Flat CSV files (and excel) #* Working with binary data #* Python matplotlib (2D images) #* Binning histograms & weighted averages # Best Practices #* High-level code design (modularity, interface specifications, unit testing, etc.) #* Code audit: open-source libraries, ex. Gnu Scientific Library, qsort in libc, Boost #* Source code versioning (example: git or mercurial) #* gdb & execution profiling #* documentation #* Makefiles == Grading == '''Grading Scale (out of 400 points possible)''' {| class="wikitable" |- ! Grade ! Undergraduate ! Graduate |- | A | 230 | 300 |- | B | 180 | 230 |- | C | 150 | 180 |- | D | 120 | 150 |} * Points Possible: ** 10 homework assignments (20 points per homework) ** 2 projects / competitions (100 points per project) * Homework Rules ** For work done in groups, credit is divided equally among participants - so the max homework grade for a group of 2 is 10 points each. ** For each homework, 1 re-do at full credit can be sent at any time after the due date, but must present a unique solution to previous work from yourself or others. ** All work must cite co-group members (if any) and the source of any code snippets used online. === Grading Rationale === Homework points will only be awarded for correct, working code and correct algorithmic analysis, while the homework problems will become progressively tougher. Undergraduates should be able to pass the course with an A if they have correctly answered most of the homework, and made a strong attempt at one of the projects. Graduate students should both perform well on the homework and successfully complete one or two projects. Essentially, this means you should do your own homework when possible and may do a project in a small group. The re-grading and group options for homework allow making up for missed assignments, and encourage returning to core concepts at a later point in the class. Students who have completed significant portions of the homework have thus demonstrated programming proficiency, and are qualified for at least B/C grades. == Projects == * Midterm Project Description [[Media:Midterm2017.pdf]] == Textbooks and Resources == * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-0072-7 Beginning Python, Hetland, 2005] (eBook avail. from USF Library) * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-3238-4 Python Algorithms, Hetland, 2010] (eBook avail. from USF Library) * [http://aosabook.org/en/index.html The Architecture of Open Source Applications] * [http://docs.python.org Python Documentation] * [https://developers.google.com/edu/python/ Google Introductory Python Notes] * [http://huffman.sourceforge.net/tao/tao-of-programming.html Tao of Programming] Other (possibly useful) materials: * [http://hackersdictionary.com/html/entry/larval-stage.html The Jargon File] * Chapters 7&8 of Modelling and Simulation, Birta and Arbez, Springer 2007 (eBook avail. from USF Library). * Chapters 4-6 of Models and Algorithms for Intelligent Data Analysis, Runkler, Springer 2012 (eBook avail. from USF Library). * Guide to Scientific Computing in C++, Francis and Whiteley, Springer, 2012. (eBook avail. from USF Library) * Extra info. On the basics: ** Chapters 3 and 7 of Mathematics in Computing, Regan, Springer 2013. (eBook avail. from USF Library) ** Instant feedback graphical programming with [https://www.khanacademy.org/cs/programming/ Khan Academy] * [http://www.meetup.com/python-178/ Local PyBulls Meetings] Code: * [http://carsonfarmer.com/2013/07/essential-python-geo-libraries Python Libraries Useful for Geospatial Problems] * [[Code#Python_Libraries|Python Libraries Useful for Computational Chemistry]] (very small list at present) Interactive Interpreters: * [http://www.codewars.com CodeWars] Recommended for building experience with practice problems. * [http://codecombat.com/ CodeCombat] A very visual way to interact with your python code. * [http://exercism.io Exercism] A command-line client with a similar learn-through-challenge philosophy. * [http://repl.it repl.it] A read-eval-print loop for several computer languages. * [http://en.cppreference.com/w/cpp/language CppReference] Documentation with an online evaluator for C++ code. === Notes === * [[Media:Intro.pdf|Introduction Notes]] * [[Media:Week2-2017.pdf|Week 2-3 Notes]] * Week 4: read through function syntax in [[Media:Week2.pdf|2016 Week 2]] and for-loops in [[Media:Week3.pdf|2016 Week 3-4]] * In-Class Examples ** [[Turing Exercise]] ** [https://predictivestatmech.org/code/example.dcd Example DCD File] * [[Media:Week-5.2017.pdf|Week 5 Notes]] * [[Media:PlottingMaps.pdf|Week 6 Notes]] ** [[Code:PyTesting]] * [[Media:NumpyArrays.pdf|Week 7 Notes]] ** [http://www.labri.fr/perso/nrougier/from-python-to-numpy/ all about numpy] * Misc. Notes for Week 8 ** [[Physics:Pairs|Rundown of Pair Interactions]] ** Parameterized surfaces [[Media:param1.jpg|1]] and [[Media:param2.jpg|2]] === Homework === * Homework will be assigned through [https://repl.it/classroom/invite/BtxEVLe Repl.IT] ** Homework 1 is due Friday, Jan. 20 ** Homework 2 is due Friday, Jan 27 ** Homework 3 is due Friday, Feb 10 ** Homework 4 is due Friday, Feb 17 ** Homework 5 is due Wednesday, Mar. 8 * Project presentations start Monday, Mar 27 Hints for HW 4 <source lang="python"> def translate(nuc): # 1. remove all non-ATGC characters from nuc # str -> str (nuc.translate) # str -> [char], [char] -> str # 2. capitalize all characters : str -> str # 3. translate 3-char blocks # str -> [char] # hint: range(0, len(s), 3) prot = [] for i in range(2): prot += gencode[nuc[i:i+3]] # 4. join characters return "".join(prot) # TODO: fix empty return and string-values! def get_params(sparams): print(sparams) # 1. split sparams on newlines # str -> [str] lines = sparams.split('\n') print(lines) # 2. create an empty dictionary d = {} # 3. for each line, split on ' ' # add key = val to d for line in lines: tok = line.split() print(tok) continue d[tok[0]] = tok[2] return d def newton(x, v, m, k, dt): dxdt = v dvdt = # acceleration (use F = m a), F = (use Hook's law) return (x+dt*dxdt, v+dt*dvdt) </source> 1feeed309b4a39de1bc599dbafdf73d6bceb1aff 580 577 2017-03-08T17:49:08Z David M. Rogers 2 /* Homework */ wikitext text/x-wiki '''<BIG>Introduction to Scientific Computing</BIG>''' Course Info * Course Numbers CHM 4932-004/6938-010, CRN: 21864/21865 * Credit Hours: 3 * Meeting Dates: January 9 - April 26, 2017 ** No Class Jan. 16 or Mar. 13-17 * Meeting Times: Mon. and Wed., 12:30-13:45 in SCA 222 ** Lab Session & Office Hours: Fri. 12:30-13:45 in IDR 214 (or SCA 222 by announcement) == Overview == Mathematical models in the natural sciences take many shapes and forms. The moment they become more complicated than tracking a few variables over time, we have to put away our Excel spreadsheets and make use of a solid foundation in computational science. The course establishes this foundation by introducing data structures and algorithms used in everyday scientific computing using examples in the python scripting language. By the end of the Semester, students will be able to navigate the Linux command-line to go from a mathematical model to a numerical solution. Best practices for working with computer code and visualizing data will also be covered. == Topics == # Languages #* bash (shell) #* python (scripting) #* stack & register-based machine languages: overview of C and Fortran syntax & compiling with gcc, ‘thread safety’ #* Shared libraries & language inter-operability (FFI) # Algorithms #* Horner’s algorithm for polynomials #* Newton’s root finding algo. #* Overview of general optimization algo-s (example: linear & nonlin. least-squares) #* Numerical integration (scripted, plus gnu ODE) #* Communication (how HTTP get/put works) # Data Structures #* Linked Lists #* Trees (file system hierarchies) #* Graphs #* Arrays (dense & sparse) example: vectors & rotations / transpositions, densities and difference operators # Presentation & visualization #* Flat CSV files (and excel) #* Working with binary data #* Python matplotlib (2D images) #* Binning histograms & weighted averages # Best Practices #* High-level code design (modularity, interface specifications, unit testing, etc.) #* Code audit: open-source libraries, ex. Gnu Scientific Library, qsort in libc, Boost #* Source code versioning (example: git or mercurial) #* gdb & execution profiling #* documentation #* Makefiles == Grading == '''Grading Scale (out of 400 points possible)''' {| class="wikitable" |- ! Grade ! Undergraduate ! Graduate |- | A | 230 | 300 |- | B | 180 | 230 |- | C | 150 | 180 |- | D | 120 | 150 |} * Points Possible: ** 10 homework assignments (20 points per homework) ** 2 projects / competitions (100 points per project) * Homework Rules ** For work done in groups, credit is divided equally among participants - so the max homework grade for a group of 2 is 10 points each. ** For each homework, 1 re-do at full credit can be sent at any time after the due date, but must present a unique solution to previous work from yourself or others. ** All work must cite co-group members (if any) and the source of any code snippets used online. === Grading Rationale === Homework points will only be awarded for correct, working code and correct algorithmic analysis, while the homework problems will become progressively tougher. Undergraduates should be able to pass the course with an A if they have correctly answered most of the homework, and made a strong attempt at one of the projects. Graduate students should both perform well on the homework and successfully complete one or two projects. Essentially, this means you should do your own homework when possible and may do a project in a small group. The re-grading and group options for homework allow making up for missed assignments, and encourage returning to core concepts at a later point in the class. Students who have completed significant portions of the homework have thus demonstrated programming proficiency, and are qualified for at least B/C grades. == Projects == * Midterm Project Description [[Media:Midterm2017.pdf]] == Textbooks and Resources == * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-0072-7 Beginning Python, Hetland, 2005] (eBook avail. from USF Library) * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-3238-4 Python Algorithms, Hetland, 2010] (eBook avail. from USF Library) * [http://aosabook.org/en/index.html The Architecture of Open Source Applications] * [http://docs.python.org Python Documentation] * [https://developers.google.com/edu/python/ Google Introductory Python Notes] * [http://huffman.sourceforge.net/tao/tao-of-programming.html Tao of Programming] Other (possibly useful) materials: * [http://hackersdictionary.com/html/entry/larval-stage.html The Jargon File] * Chapters 7&8 of Modelling and Simulation, Birta and Arbez, Springer 2007 (eBook avail. from USF Library). * Chapters 4-6 of Models and Algorithms for Intelligent Data Analysis, Runkler, Springer 2012 (eBook avail. from USF Library). * Guide to Scientific Computing in C++, Francis and Whiteley, Springer, 2012. (eBook avail. from USF Library) * Extra info. On the basics: ** Chapters 3 and 7 of Mathematics in Computing, Regan, Springer 2013. (eBook avail. from USF Library) ** Instant feedback graphical programming with [https://www.khanacademy.org/cs/programming/ Khan Academy] * [http://www.meetup.com/python-178/ Local PyBulls Meetings] Code: * [http://carsonfarmer.com/2013/07/essential-python-geo-libraries Python Libraries Useful for Geospatial Problems] * [[Code#Python_Libraries|Python Libraries Useful for Computational Chemistry]] (very small list at present) Interactive Interpreters: * [http://www.codewars.com CodeWars] Recommended for building experience with practice problems. * [http://codecombat.com/ CodeCombat] A very visual way to interact with your python code. * [http://exercism.io Exercism] A command-line client with a similar learn-through-challenge philosophy. * [http://repl.it repl.it] A read-eval-print loop for several computer languages. * [http://en.cppreference.com/w/cpp/language CppReference] Documentation with an online evaluator for C++ code. === Notes === * [[Media:Intro.pdf|Introduction Notes]] * [[Media:Week2-2017.pdf|Week 2-3 Notes]] * Week 4: read through function syntax in [[Media:Week2.pdf|2016 Week 2]] and for-loops in [[Media:Week3.pdf|2016 Week 3-4]] * In-Class Examples ** [[Turing Exercise]] ** [https://predictivestatmech.org/code/example.dcd Example DCD File] * [[Media:Week-5.2017.pdf|Week 5 Notes]] * [[Media:PlottingMaps.pdf|Week 6 Notes]] ** [[Code:PyTesting]] * [[Media:NumpyArrays.pdf|Week 7 Notes]] ** [http://www.labri.fr/perso/nrougier/from-python-to-numpy/ all about numpy] * Misc. Notes for Week 8 ** [[Physics:Pairs|Rundown of Pair Interactions]] ** Parameterized surfaces [[Media:param1.jpg|1]] and [[Media:param2.jpg|2]] === Homework === * Homework will be assigned through [https://repl.it/classroom/invite/BtxEVLe Repl.IT] ** Homework 1 is due Friday, Jan. 20 ** Homework 2 is due Friday, Jan 27 ** Homework 3 is due Friday, Feb 10 ** Homework 4 is due Friday, Feb 17 ** Homework 5 is due Wednesday, Mar. 8 * Project presentations start Monday, Mar 27 Hints for HW 4 <source lang="python"> def translate(nuc): # 1. remove all non-ATGC characters from nuc # str -> str (nuc.translate) # str -> [char], [char] -> str # 2. capitalize all characters : str -> str # 3. translate 3-char blocks # str -> [char] # hint: range(0, len(s), 3) prot = [] for i in range(2): prot += gencode[nuc[i:i+3]] # 4. join characters return "".join(prot) # TODO: fix empty return and string-values! def get_params(sparams): print(sparams) # 1. split sparams on newlines # str -> [str] lines = sparams.split('\n') print(lines) # 2. create an empty dictionary d = {} # 3. for each line, split on ' ' # add key = val to d for line in lines: tok = line.split() print(tok) continue d[tok[0]] = tok[2] return d def newton(x, v, m, k, dt): dxdt = v dvdt = # acceleration (use F = m a), F = (use Hook's law) return (x+dt*dxdt, v+dt*dvdt) </source> 3d plotting example: <source lang="python"> # modified 3d plot from http://matplotlib.org/examples/mplot3d/rotate_axes3d_demo.html from numpy import * import pylab as plt from mpl_toolkits.mplot3d import axes3d fig = plt.figure() ax = fig.add_subplot(111, projection='3d') # load some test data for demonstration and plot a wireframe #X, Y, Z = axes3d.get_test_data(0.1) X = [5, 6] Y = [5, 7] Z = [0, -1] ax.scatter(X, Y, Z)#, rstride=5, cstride=5) #print(X.shape) # rotate the axes and update for angle in range(0, 360): ax.view_init(30, angle) plt.draw() plt.pause(.001) </source> 74940517c89063a9843d9b88f49f3e3b978d7849 581 580 2017-03-08T18:04:54Z David M. Rogers 2 /* Homework */ wikitext text/x-wiki '''<BIG>Introduction to Scientific Computing</BIG>''' Course Info * Course Numbers CHM 4932-004/6938-010, CRN: 21864/21865 * Credit Hours: 3 * Meeting Dates: January 9 - April 26, 2017 ** No Class Jan. 16 or Mar. 13-17 * Meeting Times: Mon. and Wed., 12:30-13:45 in SCA 222 ** Lab Session & Office Hours: Fri. 12:30-13:45 in IDR 214 (or SCA 222 by announcement) == Overview == Mathematical models in the natural sciences take many shapes and forms. The moment they become more complicated than tracking a few variables over time, we have to put away our Excel spreadsheets and make use of a solid foundation in computational science. The course establishes this foundation by introducing data structures and algorithms used in everyday scientific computing using examples in the python scripting language. By the end of the Semester, students will be able to navigate the Linux command-line to go from a mathematical model to a numerical solution. Best practices for working with computer code and visualizing data will also be covered. == Topics == # Languages #* bash (shell) #* python (scripting) #* stack & register-based machine languages: overview of C and Fortran syntax & compiling with gcc, ‘thread safety’ #* Shared libraries & language inter-operability (FFI) # Algorithms #* Horner’s algorithm for polynomials #* Newton’s root finding algo. #* Overview of general optimization algo-s (example: linear & nonlin. least-squares) #* Numerical integration (scripted, plus gnu ODE) #* Communication (how HTTP get/put works) # Data Structures #* Linked Lists #* Trees (file system hierarchies) #* Graphs #* Arrays (dense & sparse) example: vectors & rotations / transpositions, densities and difference operators # Presentation & visualization #* Flat CSV files (and excel) #* Working with binary data #* Python matplotlib (2D images) #* Binning histograms & weighted averages # Best Practices #* High-level code design (modularity, interface specifications, unit testing, etc.) #* Code audit: open-source libraries, ex. Gnu Scientific Library, qsort in libc, Boost #* Source code versioning (example: git or mercurial) #* gdb & execution profiling #* documentation #* Makefiles == Grading == '''Grading Scale (out of 400 points possible)''' {| class="wikitable" |- ! Grade ! Undergraduate ! Graduate |- | A | 230 | 300 |- | B | 180 | 230 |- | C | 150 | 180 |- | D | 120 | 150 |} * Points Possible: ** 10 homework assignments (20 points per homework) ** 2 projects / competitions (100 points per project) * Homework Rules ** For work done in groups, credit is divided equally among participants - so the max homework grade for a group of 2 is 10 points each. ** For each homework, 1 re-do at full credit can be sent at any time after the due date, but must present a unique solution to previous work from yourself or others. ** All work must cite co-group members (if any) and the source of any code snippets used online. === Grading Rationale === Homework points will only be awarded for correct, working code and correct algorithmic analysis, while the homework problems will become progressively tougher. Undergraduates should be able to pass the course with an A if they have correctly answered most of the homework, and made a strong attempt at one of the projects. Graduate students should both perform well on the homework and successfully complete one or two projects. Essentially, this means you should do your own homework when possible and may do a project in a small group. The re-grading and group options for homework allow making up for missed assignments, and encourage returning to core concepts at a later point in the class. Students who have completed significant portions of the homework have thus demonstrated programming proficiency, and are qualified for at least B/C grades. == Projects == * Midterm Project Description [[Media:Midterm2017.pdf]] == Textbooks and Resources == * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-0072-7 Beginning Python, Hetland, 2005] (eBook avail. from USF Library) * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-3238-4 Python Algorithms, Hetland, 2010] (eBook avail. from USF Library) * [http://aosabook.org/en/index.html The Architecture of Open Source Applications] * [http://docs.python.org Python Documentation] * [https://developers.google.com/edu/python/ Google Introductory Python Notes] * [http://huffman.sourceforge.net/tao/tao-of-programming.html Tao of Programming] Other (possibly useful) materials: * [http://hackersdictionary.com/html/entry/larval-stage.html The Jargon File] * Chapters 7&8 of Modelling and Simulation, Birta and Arbez, Springer 2007 (eBook avail. from USF Library). * Chapters 4-6 of Models and Algorithms for Intelligent Data Analysis, Runkler, Springer 2012 (eBook avail. from USF Library). * Guide to Scientific Computing in C++, Francis and Whiteley, Springer, 2012. (eBook avail. from USF Library) * Extra info. On the basics: ** Chapters 3 and 7 of Mathematics in Computing, Regan, Springer 2013. (eBook avail. from USF Library) ** Instant feedback graphical programming with [https://www.khanacademy.org/cs/programming/ Khan Academy] * [http://www.meetup.com/python-178/ Local PyBulls Meetings] Code: * [http://carsonfarmer.com/2013/07/essential-python-geo-libraries Python Libraries Useful for Geospatial Problems] * [[Code#Python_Libraries|Python Libraries Useful for Computational Chemistry]] (very small list at present) Interactive Interpreters: * [http://www.codewars.com CodeWars] Recommended for building experience with practice problems. * [http://codecombat.com/ CodeCombat] A very visual way to interact with your python code. * [http://exercism.io Exercism] A command-line client with a similar learn-through-challenge philosophy. * [http://repl.it repl.it] A read-eval-print loop for several computer languages. * [http://en.cppreference.com/w/cpp/language CppReference] Documentation with an online evaluator for C++ code. === Notes === * [[Media:Intro.pdf|Introduction Notes]] * [[Media:Week2-2017.pdf|Week 2-3 Notes]] * Week 4: read through function syntax in [[Media:Week2.pdf|2016 Week 2]] and for-loops in [[Media:Week3.pdf|2016 Week 3-4]] * In-Class Examples ** [[Turing Exercise]] ** [https://predictivestatmech.org/code/example.dcd Example DCD File] * [[Media:Week-5.2017.pdf|Week 5 Notes]] * [[Media:PlottingMaps.pdf|Week 6 Notes]] ** [[Code:PyTesting]] * [[Media:NumpyArrays.pdf|Week 7 Notes]] ** [http://www.labri.fr/perso/nrougier/from-python-to-numpy/ all about numpy] * Misc. Notes for Week 8 ** [[Physics:Pairs|Rundown of Pair Interactions]] ** Parameterized surfaces [[Media:param1.jpg|1]] and [[Media:param2.jpg|2]] === Homework === * Homework will be assigned through [https://repl.it/classroom/invite/BtxEVLe Repl.IT] ** Homework 1 is due Friday, Jan. 20 ** Homework 2 is due Friday, Jan 27 ** Homework 3 is due Friday, Feb 10 ** Homework 4 is due Friday, Feb 17 ** Homework 5 is due Wednesday, Mar. 8 * Project presentations start Monday, Mar 27 Hints for HW 4 <source lang="python"> def translate(nuc): # 1. remove all non-ATGC characters from nuc # str -> str (nuc.translate) # str -> [char], [char] -> str # 2. capitalize all characters : str -> str # 3. translate 3-char blocks # str -> [char] # hint: range(0, len(s), 3) prot = [] for i in range(2): prot += gencode[nuc[i:i+3]] # 4. join characters return "".join(prot) # TODO: fix empty return and string-values! def get_params(sparams): print(sparams) # 1. split sparams on newlines # str -> [str] lines = sparams.split('\n') print(lines) # 2. create an empty dictionary d = {} # 3. for each line, split on ' ' # add key = val to d for line in lines: tok = line.split() print(tok) continue d[tok[0]] = tok[2] return d def newton(x, v, m, k, dt): dxdt = v dvdt = # acceleration (use F = m a), F = (use Hook's law) return (x+dt*dxdt, v+dt*dvdt) </source> 3d plotting example: <source lang="python"> # modified 3d plot from http://matplotlib.org/examples/mplot3d/rotate_axes3d_demo.html from numpy import * import pylab as plt from mpl_toolkits.mplot3d import axes3d def plot_a_list(x): fig = plt.figure() ax = fig.add_subplot(111, projection='3d') x = array(x) X = x[:,0] Y = x[:,1] #[x[0,1], x[1,1], x[2,1], ... Z = x[:,2] # [x[0,2], x[1,2], ... ax.scatter(X, Y, Z) # rotate the axes and update for angle in range(0, 360): ax.view_init(30, angle) plt.draw() plt.pause(.001) x = [ [5,5,0], [6,7,-1], [7, 9, -2], [8, 11, -3], [9, 13, -4]] x.append([10,15,-5]) plot_a_list(x) </source> 77c84f7dd2b7b838f7b9d87ea6b717a802b12738 582 581 2017-03-20T16:03:54Z David M. Rogers 2 /* Projects */ wikitext text/x-wiki '''<BIG>Introduction to Scientific Computing</BIG>''' Course Info * Course Numbers CHM 4932-004/6938-010, CRN: 21864/21865 * Credit Hours: 3 * Meeting Dates: January 9 - April 26, 2017 ** No Class Jan. 16 or Mar. 13-17 * Meeting Times: Mon. and Wed., 12:30-13:45 in SCA 222 ** Lab Session & Office Hours: Fri. 12:30-13:45 in IDR 214 (or SCA 222 by announcement) == Overview == Mathematical models in the natural sciences take many shapes and forms. The moment they become more complicated than tracking a few variables over time, we have to put away our Excel spreadsheets and make use of a solid foundation in computational science. The course establishes this foundation by introducing data structures and algorithms used in everyday scientific computing using examples in the python scripting language. By the end of the Semester, students will be able to navigate the Linux command-line to go from a mathematical model to a numerical solution. Best practices for working with computer code and visualizing data will also be covered. == Topics == # Languages #* bash (shell) #* python (scripting) #* stack & register-based machine languages: overview of C and Fortran syntax & compiling with gcc, ‘thread safety’ #* Shared libraries & language inter-operability (FFI) # Algorithms #* Horner’s algorithm for polynomials #* Newton’s root finding algo. #* Overview of general optimization algo-s (example: linear & nonlin. least-squares) #* Numerical integration (scripted, plus gnu ODE) #* Communication (how HTTP get/put works) # Data Structures #* Linked Lists #* Trees (file system hierarchies) #* Graphs #* Arrays (dense & sparse) example: vectors & rotations / transpositions, densities and difference operators # Presentation & visualization #* Flat CSV files (and excel) #* Working with binary data #* Python matplotlib (2D images) #* Binning histograms & weighted averages # Best Practices #* High-level code design (modularity, interface specifications, unit testing, etc.) #* Code audit: open-source libraries, ex. Gnu Scientific Library, qsort in libc, Boost #* Source code versioning (example: git or mercurial) #* gdb & execution profiling #* documentation #* Makefiles == Grading == '''Grading Scale (out of 400 points possible)''' {| class="wikitable" |- ! Grade ! Undergraduate ! Graduate |- | A | 230 | 300 |- | B | 180 | 230 |- | C | 150 | 180 |- | D | 120 | 150 |} * Points Possible: ** 10 homework assignments (20 points per homework) ** 2 projects / competitions (100 points per project) * Homework Rules ** For work done in groups, credit is divided equally among participants - so the max homework grade for a group of 2 is 10 points each. ** For each homework, 1 re-do at full credit can be sent at any time after the due date, but must present a unique solution to previous work from yourself or others. ** All work must cite co-group members (if any) and the source of any code snippets used online. === Grading Rationale === Homework points will only be awarded for correct, working code and correct algorithmic analysis, while the homework problems will become progressively tougher. Undergraduates should be able to pass the course with an A if they have correctly answered most of the homework, and made a strong attempt at one of the projects. Graduate students should both perform well on the homework and successfully complete one or two projects. Essentially, this means you should do your own homework when possible and may do a project in a small group. The re-grading and group options for homework allow making up for missed assignments, and encourage returning to core concepts at a later point in the class. Students who have completed significant portions of the homework have thus demonstrated programming proficiency, and are qualified for at least B/C grades. == Projects == * Midterm Project Description [[Media:Midterm2017.pdf]] ** [[Agile|Agile Development Tips & Tricks]] == Textbooks and Resources == * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-0072-7 Beginning Python, Hetland, 2005] (eBook avail. from USF Library) * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-3238-4 Python Algorithms, Hetland, 2010] (eBook avail. from USF Library) * [http://aosabook.org/en/index.html The Architecture of Open Source Applications] * [http://docs.python.org Python Documentation] * [https://developers.google.com/edu/python/ Google Introductory Python Notes] * [http://huffman.sourceforge.net/tao/tao-of-programming.html Tao of Programming] Other (possibly useful) materials: * [http://hackersdictionary.com/html/entry/larval-stage.html The Jargon File] * Chapters 7&8 of Modelling and Simulation, Birta and Arbez, Springer 2007 (eBook avail. from USF Library). * Chapters 4-6 of Models and Algorithms for Intelligent Data Analysis, Runkler, Springer 2012 (eBook avail. from USF Library). * Guide to Scientific Computing in C++, Francis and Whiteley, Springer, 2012. (eBook avail. from USF Library) * Extra info. On the basics: ** Chapters 3 and 7 of Mathematics in Computing, Regan, Springer 2013. (eBook avail. from USF Library) ** Instant feedback graphical programming with [https://www.khanacademy.org/cs/programming/ Khan Academy] * [http://www.meetup.com/python-178/ Local PyBulls Meetings] Code: * [http://carsonfarmer.com/2013/07/essential-python-geo-libraries Python Libraries Useful for Geospatial Problems] * [[Code#Python_Libraries|Python Libraries Useful for Computational Chemistry]] (very small list at present) Interactive Interpreters: * [http://www.codewars.com CodeWars] Recommended for building experience with practice problems. * [http://codecombat.com/ CodeCombat] A very visual way to interact with your python code. * [http://exercism.io Exercism] A command-line client with a similar learn-through-challenge philosophy. * [http://repl.it repl.it] A read-eval-print loop for several computer languages. * [http://en.cppreference.com/w/cpp/language CppReference] Documentation with an online evaluator for C++ code. === Notes === * [[Media:Intro.pdf|Introduction Notes]] * [[Media:Week2-2017.pdf|Week 2-3 Notes]] * Week 4: read through function syntax in [[Media:Week2.pdf|2016 Week 2]] and for-loops in [[Media:Week3.pdf|2016 Week 3-4]] * In-Class Examples ** [[Turing Exercise]] ** [https://predictivestatmech.org/code/example.dcd Example DCD File] * [[Media:Week-5.2017.pdf|Week 5 Notes]] * [[Media:PlottingMaps.pdf|Week 6 Notes]] ** [[Code:PyTesting]] * [[Media:NumpyArrays.pdf|Week 7 Notes]] ** [http://www.labri.fr/perso/nrougier/from-python-to-numpy/ all about numpy] * Misc. Notes for Week 8 ** [[Physics:Pairs|Rundown of Pair Interactions]] ** Parameterized surfaces [[Media:param1.jpg|1]] and [[Media:param2.jpg|2]] === Homework === * Homework will be assigned through [https://repl.it/classroom/invite/BtxEVLe Repl.IT] ** Homework 1 is due Friday, Jan. 20 ** Homework 2 is due Friday, Jan 27 ** Homework 3 is due Friday, Feb 10 ** Homework 4 is due Friday, Feb 17 ** Homework 5 is due Wednesday, Mar. 8 * Project presentations start Monday, Mar 27 Hints for HW 4 <source lang="python"> def translate(nuc): # 1. remove all non-ATGC characters from nuc # str -> str (nuc.translate) # str -> [char], [char] -> str # 2. capitalize all characters : str -> str # 3. translate 3-char blocks # str -> [char] # hint: range(0, len(s), 3) prot = [] for i in range(2): prot += gencode[nuc[i:i+3]] # 4. join characters return "".join(prot) # TODO: fix empty return and string-values! def get_params(sparams): print(sparams) # 1. split sparams on newlines # str -> [str] lines = sparams.split('\n') print(lines) # 2. create an empty dictionary d = {} # 3. for each line, split on ' ' # add key = val to d for line in lines: tok = line.split() print(tok) continue d[tok[0]] = tok[2] return d def newton(x, v, m, k, dt): dxdt = v dvdt = # acceleration (use F = m a), F = (use Hook's law) return (x+dt*dxdt, v+dt*dvdt) </source> 3d plotting example: <source lang="python"> # modified 3d plot from http://matplotlib.org/examples/mplot3d/rotate_axes3d_demo.html from numpy import * import pylab as plt from mpl_toolkits.mplot3d import axes3d def plot_a_list(x): fig = plt.figure() ax = fig.add_subplot(111, projection='3d') x = array(x) X = x[:,0] Y = x[:,1] #[x[0,1], x[1,1], x[2,1], ... Z = x[:,2] # [x[0,2], x[1,2], ... ax.scatter(X, Y, Z) # rotate the axes and update for angle in range(0, 360): ax.view_init(30, angle) plt.draw() plt.pause(.001) x = [ [5,5,0], [6,7,-1], [7, 9, -2], [8, 11, -3], [9, 13, -4]] x.append([10,15,-5]) plot_a_list(x) </source> d6f454b1e888f4b3b1513deee101b58d496b5571 584 582 2017-03-27T15:26:07Z David M. Rogers 2 /* Homework */ wikitext text/x-wiki '''<BIG>Introduction to Scientific Computing</BIG>''' Course Info * Course Numbers CHM 4932-004/6938-010, CRN: 21864/21865 * Credit Hours: 3 * Meeting Dates: January 9 - April 26, 2017 ** No Class Jan. 16 or Mar. 13-17 * Meeting Times: Mon. and Wed., 12:30-13:45 in SCA 222 ** Lab Session & Office Hours: Fri. 12:30-13:45 in IDR 214 (or SCA 222 by announcement) == Overview == Mathematical models in the natural sciences take many shapes and forms. The moment they become more complicated than tracking a few variables over time, we have to put away our Excel spreadsheets and make use of a solid foundation in computational science. The course establishes this foundation by introducing data structures and algorithms used in everyday scientific computing using examples in the python scripting language. By the end of the Semester, students will be able to navigate the Linux command-line to go from a mathematical model to a numerical solution. Best practices for working with computer code and visualizing data will also be covered. == Topics == # Languages #* bash (shell) #* python (scripting) #* stack & register-based machine languages: overview of C and Fortran syntax & compiling with gcc, ‘thread safety’ #* Shared libraries & language inter-operability (FFI) # Algorithms #* Horner’s algorithm for polynomials #* Newton’s root finding algo. #* Overview of general optimization algo-s (example: linear & nonlin. least-squares) #* Numerical integration (scripted, plus gnu ODE) #* Communication (how HTTP get/put works) # Data Structures #* Linked Lists #* Trees (file system hierarchies) #* Graphs #* Arrays (dense & sparse) example: vectors & rotations / transpositions, densities and difference operators # Presentation & visualization #* Flat CSV files (and excel) #* Working with binary data #* Python matplotlib (2D images) #* Binning histograms & weighted averages # Best Practices #* High-level code design (modularity, interface specifications, unit testing, etc.) #* Code audit: open-source libraries, ex. Gnu Scientific Library, qsort in libc, Boost #* Source code versioning (example: git or mercurial) #* gdb & execution profiling #* documentation #* Makefiles == Grading == '''Grading Scale (out of 400 points possible)''' {| class="wikitable" |- ! Grade ! Undergraduate ! Graduate |- | A | 230 | 300 |- | B | 180 | 230 |- | C | 150 | 180 |- | D | 120 | 150 |} * Points Possible: ** 10 homework assignments (20 points per homework) ** 2 projects / competitions (100 points per project) * Homework Rules ** For work done in groups, credit is divided equally among participants - so the max homework grade for a group of 2 is 10 points each. ** For each homework, 1 re-do at full credit can be sent at any time after the due date, but must present a unique solution to previous work from yourself or others. ** All work must cite co-group members (if any) and the source of any code snippets used online. === Grading Rationale === Homework points will only be awarded for correct, working code and correct algorithmic analysis, while the homework problems will become progressively tougher. Undergraduates should be able to pass the course with an A if they have correctly answered most of the homework, and made a strong attempt at one of the projects. Graduate students should both perform well on the homework and successfully complete one or two projects. Essentially, this means you should do your own homework when possible and may do a project in a small group. The re-grading and group options for homework allow making up for missed assignments, and encourage returning to core concepts at a later point in the class. Students who have completed significant portions of the homework have thus demonstrated programming proficiency, and are qualified for at least B/C grades. == Projects == * Midterm Project Description [[Media:Midterm2017.pdf]] ** [[Agile|Agile Development Tips & Tricks]] == Textbooks and Resources == * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-0072-7 Beginning Python, Hetland, 2005] (eBook avail. from USF Library) * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-3238-4 Python Algorithms, Hetland, 2010] (eBook avail. from USF Library) * [http://aosabook.org/en/index.html The Architecture of Open Source Applications] * [http://docs.python.org Python Documentation] * [https://developers.google.com/edu/python/ Google Introductory Python Notes] * [http://huffman.sourceforge.net/tao/tao-of-programming.html Tao of Programming] Other (possibly useful) materials: * [http://hackersdictionary.com/html/entry/larval-stage.html The Jargon File] * Chapters 7&8 of Modelling and Simulation, Birta and Arbez, Springer 2007 (eBook avail. from USF Library). * Chapters 4-6 of Models and Algorithms for Intelligent Data Analysis, Runkler, Springer 2012 (eBook avail. from USF Library). * Guide to Scientific Computing in C++, Francis and Whiteley, Springer, 2012. (eBook avail. from USF Library) * Extra info. On the basics: ** Chapters 3 and 7 of Mathematics in Computing, Regan, Springer 2013. (eBook avail. from USF Library) ** Instant feedback graphical programming with [https://www.khanacademy.org/cs/programming/ Khan Academy] * [http://www.meetup.com/python-178/ Local PyBulls Meetings] Code: * [http://carsonfarmer.com/2013/07/essential-python-geo-libraries Python Libraries Useful for Geospatial Problems] * [[Code#Python_Libraries|Python Libraries Useful for Computational Chemistry]] (very small list at present) Interactive Interpreters: * [http://www.codewars.com CodeWars] Recommended for building experience with practice problems. * [http://codecombat.com/ CodeCombat] A very visual way to interact with your python code. * [http://exercism.io Exercism] A command-line client with a similar learn-through-challenge philosophy. * [http://repl.it repl.it] A read-eval-print loop for several computer languages. * [http://en.cppreference.com/w/cpp/language CppReference] Documentation with an online evaluator for C++ code. === Notes === * [[Media:Intro.pdf|Introduction Notes]] * [[Media:Week2-2017.pdf|Week 2-3 Notes]] * Week 4: read through function syntax in [[Media:Week2.pdf|2016 Week 2]] and for-loops in [[Media:Week3.pdf|2016 Week 3-4]] * In-Class Examples ** [[Turing Exercise]] ** [https://predictivestatmech.org/code/example.dcd Example DCD File] * [[Media:Week-5.2017.pdf|Week 5 Notes]] * [[Media:PlottingMaps.pdf|Week 6 Notes]] ** [[Code:PyTesting]] * [[Media:NumpyArrays.pdf|Week 7 Notes]] ** [http://www.labri.fr/perso/nrougier/from-python-to-numpy/ all about numpy] * Misc. Notes for Week 8 ** [[Physics:Pairs|Rundown of Pair Interactions]] ** Parameterized surfaces [[Media:param1.jpg|1]] and [[Media:param2.jpg|2]] === Homework === * Homework will be assigned through [https://repl.it/classroom/invite/BtxEVLe Repl.IT] ** Homework 1 is due Friday, Jan. 20 ** Homework 2 is due Friday, Jan 27 ** Homework 3 is due Friday, Feb 10 ** Homework 4 is due Friday, Feb 17 ** Homework 5 is due Wednesday, Mar. 8 * Project presentations will be on Wed., Mar 29 ** Homework 6 is due Friday, Mar. 31 ** Homework 7 is due Friday, Apr. 7 ** Homework 8 is due Friday, Apr. 14 ** Homework 9 is due Friday, Apr. 21 ** Homework 10 is due Friday, Apr. 28 * Final Project presentations will be during exam time. Hints for HW 4 <source lang="python"> def translate(nuc): # 1. remove all non-ATGC characters from nuc # str -> str (nuc.translate) # str -> [char], [char] -> str # 2. capitalize all characters : str -> str # 3. translate 3-char blocks # str -> [char] # hint: range(0, len(s), 3) prot = [] for i in range(2): prot += gencode[nuc[i:i+3]] # 4. join characters return "".join(prot) # TODO: fix empty return and string-values! def get_params(sparams): print(sparams) # 1. split sparams on newlines # str -> [str] lines = sparams.split('\n') print(lines) # 2. create an empty dictionary d = {} # 3. for each line, split on ' ' # add key = val to d for line in lines: tok = line.split() print(tok) continue d[tok[0]] = tok[2] return d def newton(x, v, m, k, dt): dxdt = v dvdt = # acceleration (use F = m a), F = (use Hook's law) return (x+dt*dxdt, v+dt*dvdt) </source> 3d plotting example: <source lang="python"> # modified 3d plot from http://matplotlib.org/examples/mplot3d/rotate_axes3d_demo.html from numpy import * import pylab as plt from mpl_toolkits.mplot3d import axes3d def plot_a_list(x): fig = plt.figure() ax = fig.add_subplot(111, projection='3d') x = array(x) X = x[:,0] Y = x[:,1] #[x[0,1], x[1,1], x[2,1], ... Z = x[:,2] # [x[0,2], x[1,2], ... ax.scatter(X, Y, Z) # rotate the axes and update for angle in range(0, 360): ax.view_init(30, angle) plt.draw() plt.pause(.001) x = [ [5,5,0], [6,7,-1], [7, 9, -2], [8, 11, -3], [9, 13, -4]] x.append([10,15,-5]) plot_a_list(x) </source> 94b9d24eba32c29ff981f0282c34b0c0af22971c 586 584 2017-04-03T16:21:12Z David M. Rogers 2 /* Notes */ wikitext text/x-wiki '''<BIG>Introduction to Scientific Computing</BIG>''' Course Info * Course Numbers CHM 4932-004/6938-010, CRN: 21864/21865 * Credit Hours: 3 * Meeting Dates: January 9 - April 26, 2017 ** No Class Jan. 16 or Mar. 13-17 * Meeting Times: Mon. and Wed., 12:30-13:45 in SCA 222 ** Lab Session & Office Hours: Fri. 12:30-13:45 in IDR 214 (or SCA 222 by announcement) == Overview == Mathematical models in the natural sciences take many shapes and forms. The moment they become more complicated than tracking a few variables over time, we have to put away our Excel spreadsheets and make use of a solid foundation in computational science. The course establishes this foundation by introducing data structures and algorithms used in everyday scientific computing using examples in the python scripting language. By the end of the Semester, students will be able to navigate the Linux command-line to go from a mathematical model to a numerical solution. Best practices for working with computer code and visualizing data will also be covered. == Topics == # Languages #* bash (shell) #* python (scripting) #* stack & register-based machine languages: overview of C and Fortran syntax & compiling with gcc, ‘thread safety’ #* Shared libraries & language inter-operability (FFI) # Algorithms #* Horner’s algorithm for polynomials #* Newton’s root finding algo. #* Overview of general optimization algo-s (example: linear & nonlin. least-squares) #* Numerical integration (scripted, plus gnu ODE) #* Communication (how HTTP get/put works) # Data Structures #* Linked Lists #* Trees (file system hierarchies) #* Graphs #* Arrays (dense & sparse) example: vectors & rotations / transpositions, densities and difference operators # Presentation & visualization #* Flat CSV files (and excel) #* Working with binary data #* Python matplotlib (2D images) #* Binning histograms & weighted averages # Best Practices #* High-level code design (modularity, interface specifications, unit testing, etc.) #* Code audit: open-source libraries, ex. Gnu Scientific Library, qsort in libc, Boost #* Source code versioning (example: git or mercurial) #* gdb & execution profiling #* documentation #* Makefiles == Grading == '''Grading Scale (out of 400 points possible)''' {| class="wikitable" |- ! Grade ! Undergraduate ! Graduate |- | A | 230 | 300 |- | B | 180 | 230 |- | C | 150 | 180 |- | D | 120 | 150 |} * Points Possible: ** 10 homework assignments (20 points per homework) ** 2 projects / competitions (100 points per project) * Homework Rules ** For work done in groups, credit is divided equally among participants - so the max homework grade for a group of 2 is 10 points each. ** For each homework, 1 re-do at full credit can be sent at any time after the due date, but must present a unique solution to previous work from yourself or others. ** All work must cite co-group members (if any) and the source of any code snippets used online. === Grading Rationale === Homework points will only be awarded for correct, working code and correct algorithmic analysis, while the homework problems will become progressively tougher. Undergraduates should be able to pass the course with an A if they have correctly answered most of the homework, and made a strong attempt at one of the projects. Graduate students should both perform well on the homework and successfully complete one or two projects. Essentially, this means you should do your own homework when possible and may do a project in a small group. The re-grading and group options for homework allow making up for missed assignments, and encourage returning to core concepts at a later point in the class. Students who have completed significant portions of the homework have thus demonstrated programming proficiency, and are qualified for at least B/C grades. == Projects == * Midterm Project Description [[Media:Midterm2017.pdf]] ** [[Agile|Agile Development Tips & Tricks]] == Textbooks and Resources == * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-0072-7 Beginning Python, Hetland, 2005] (eBook avail. from USF Library) * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-3238-4 Python Algorithms, Hetland, 2010] (eBook avail. from USF Library) * [http://aosabook.org/en/index.html The Architecture of Open Source Applications] * [http://docs.python.org Python Documentation] * [https://developers.google.com/edu/python/ Google Introductory Python Notes] * [http://huffman.sourceforge.net/tao/tao-of-programming.html Tao of Programming] Other (possibly useful) materials: * [http://hackersdictionary.com/html/entry/larval-stage.html The Jargon File] * Chapters 7&8 of Modelling and Simulation, Birta and Arbez, Springer 2007 (eBook avail. from USF Library). * Chapters 4-6 of Models and Algorithms for Intelligent Data Analysis, Runkler, Springer 2012 (eBook avail. from USF Library). * Guide to Scientific Computing in C++, Francis and Whiteley, Springer, 2012. (eBook avail. from USF Library) * Extra info. On the basics: ** Chapters 3 and 7 of Mathematics in Computing, Regan, Springer 2013. (eBook avail. from USF Library) ** Instant feedback graphical programming with [https://www.khanacademy.org/cs/programming/ Khan Academy] * [http://www.meetup.com/python-178/ Local PyBulls Meetings] Code: * [http://carsonfarmer.com/2013/07/essential-python-geo-libraries Python Libraries Useful for Geospatial Problems] * [[Code#Python_Libraries|Python Libraries Useful for Computational Chemistry]] (very small list at present) Interactive Interpreters: * [http://www.codewars.com CodeWars] Recommended for building experience with practice problems. * [http://codecombat.com/ CodeCombat] A very visual way to interact with your python code. * [http://exercism.io Exercism] A command-line client with a similar learn-through-challenge philosophy. * [http://repl.it repl.it] A read-eval-print loop for several computer languages. * [http://en.cppreference.com/w/cpp/language CppReference] Documentation with an online evaluator for C++ code. === Notes === * [[Media:Intro.pdf|Introduction Notes]] * [[Media:Week2-2017.pdf|Week 2-3 Notes]] * Week 4: read through function syntax in [[Media:Week2.pdf|2016 Week 2]] and for-loops in [[Media:Week3.pdf|2016 Week 3-4]] * In-Class Examples ** [[Turing Exercise]] ** [https://predictivestatmech.org/code/example.dcd Example DCD File] * [[Media:Week-5.2017.pdf|Week 5 Notes]] * [[Media:PlottingMaps.pdf|Week 6 Notes]] ** [[Code:PyTesting]] * [[Media:NumpyArrays.pdf|Week 7 Notes]] ** [http://www.labri.fr/perso/nrougier/from-python-to-numpy/ all about numpy] * Misc. Notes for Week 8 ** [[Physics:Pairs|Rundown of Pair Interactions]] ** Parameterized surfaces [[Media:param1.jpg|1]] and [[Media:param2.jpg|2]] * Notes for Compilation Lab ** [https://learnpythonthehardway.org/book/appendixa.html Command Line Crash Course] Cheat sheet for bash commands. ** USF's compute cluster documentation at [https://wiki.rc.usf.edu/index.php/Main_Page RC Wiki]. *** See especially the "Connecting to SC" and "Modules" sections ** [[Code:Compiling|Cheat-codes]] for compilation lab. === Homework === * Homework will be assigned through [https://repl.it/classroom/invite/BtxEVLe Repl.IT] ** Homework 1 is due Friday, Jan. 20 ** Homework 2 is due Friday, Jan 27 ** Homework 3 is due Friday, Feb 10 ** Homework 4 is due Friday, Feb 17 ** Homework 5 is due Wednesday, Mar. 8 * Project presentations will be on Wed., Mar 29 ** Homework 6 is due Friday, Mar. 31 ** Homework 7 is due Friday, Apr. 7 ** Homework 8 is due Friday, Apr. 14 ** Homework 9 is due Friday, Apr. 21 ** Homework 10 is due Friday, Apr. 28 * Final Project presentations will be during exam time. Hints for HW 4 <source lang="python"> def translate(nuc): # 1. remove all non-ATGC characters from nuc # str -> str (nuc.translate) # str -> [char], [char] -> str # 2. capitalize all characters : str -> str # 3. translate 3-char blocks # str -> [char] # hint: range(0, len(s), 3) prot = [] for i in range(2): prot += gencode[nuc[i:i+3]] # 4. join characters return "".join(prot) # TODO: fix empty return and string-values! def get_params(sparams): print(sparams) # 1. split sparams on newlines # str -> [str] lines = sparams.split('\n') print(lines) # 2. create an empty dictionary d = {} # 3. for each line, split on ' ' # add key = val to d for line in lines: tok = line.split() print(tok) continue d[tok[0]] = tok[2] return d def newton(x, v, m, k, dt): dxdt = v dvdt = # acceleration (use F = m a), F = (use Hook's law) return (x+dt*dxdt, v+dt*dvdt) </source> 3d plotting example: <source lang="python"> # modified 3d plot from http://matplotlib.org/examples/mplot3d/rotate_axes3d_demo.html from numpy import * import pylab as plt from mpl_toolkits.mplot3d import axes3d def plot_a_list(x): fig = plt.figure() ax = fig.add_subplot(111, projection='3d') x = array(x) X = x[:,0] Y = x[:,1] #[x[0,1], x[1,1], x[2,1], ... Z = x[:,2] # [x[0,2], x[1,2], ... ax.scatter(X, Y, Z) # rotate the axes and update for angle in range(0, 360): ax.view_init(30, angle) plt.draw() plt.pause(.001) x = [ [5,5,0], [6,7,-1], [7, 9, -2], [8, 11, -3], [9, 13, -4]] x.append([10,15,-5]) plot_a_list(x) </source> ba359c5eac136c8162df6480a716a9d3dec131ad 588 586 2017-04-05T16:21:53Z David M. Rogers 2 /* Notes */ wikitext text/x-wiki '''<BIG>Introduction to Scientific Computing</BIG>''' Course Info * Course Numbers CHM 4932-004/6938-010, CRN: 21864/21865 * Credit Hours: 3 * Meeting Dates: January 9 - April 26, 2017 ** No Class Jan. 16 or Mar. 13-17 * Meeting Times: Mon. and Wed., 12:30-13:45 in SCA 222 ** Lab Session & Office Hours: Fri. 12:30-13:45 in IDR 214 (or SCA 222 by announcement) == Overview == Mathematical models in the natural sciences take many shapes and forms. The moment they become more complicated than tracking a few variables over time, we have to put away our Excel spreadsheets and make use of a solid foundation in computational science. The course establishes this foundation by introducing data structures and algorithms used in everyday scientific computing using examples in the python scripting language. By the end of the Semester, students will be able to navigate the Linux command-line to go from a mathematical model to a numerical solution. Best practices for working with computer code and visualizing data will also be covered. == Topics == # Languages #* bash (shell) #* python (scripting) #* stack & register-based machine languages: overview of C and Fortran syntax & compiling with gcc, ‘thread safety’ #* Shared libraries & language inter-operability (FFI) # Algorithms #* Horner’s algorithm for polynomials #* Newton’s root finding algo. #* Overview of general optimization algo-s (example: linear & nonlin. least-squares) #* Numerical integration (scripted, plus gnu ODE) #* Communication (how HTTP get/put works) # Data Structures #* Linked Lists #* Trees (file system hierarchies) #* Graphs #* Arrays (dense & sparse) example: vectors & rotations / transpositions, densities and difference operators # Presentation & visualization #* Flat CSV files (and excel) #* Working with binary data #* Python matplotlib (2D images) #* Binning histograms & weighted averages # Best Practices #* High-level code design (modularity, interface specifications, unit testing, etc.) #* Code audit: open-source libraries, ex. Gnu Scientific Library, qsort in libc, Boost #* Source code versioning (example: git or mercurial) #* gdb & execution profiling #* documentation #* Makefiles == Grading == '''Grading Scale (out of 400 points possible)''' {| class="wikitable" |- ! Grade ! Undergraduate ! Graduate |- | A | 230 | 300 |- | B | 180 | 230 |- | C | 150 | 180 |- | D | 120 | 150 |} * Points Possible: ** 10 homework assignments (20 points per homework) ** 2 projects / competitions (100 points per project) * Homework Rules ** For work done in groups, credit is divided equally among participants - so the max homework grade for a group of 2 is 10 points each. ** For each homework, 1 re-do at full credit can be sent at any time after the due date, but must present a unique solution to previous work from yourself or others. ** All work must cite co-group members (if any) and the source of any code snippets used online. === Grading Rationale === Homework points will only be awarded for correct, working code and correct algorithmic analysis, while the homework problems will become progressively tougher. Undergraduates should be able to pass the course with an A if they have correctly answered most of the homework, and made a strong attempt at one of the projects. Graduate students should both perform well on the homework and successfully complete one or two projects. Essentially, this means you should do your own homework when possible and may do a project in a small group. The re-grading and group options for homework allow making up for missed assignments, and encourage returning to core concepts at a later point in the class. Students who have completed significant portions of the homework have thus demonstrated programming proficiency, and are qualified for at least B/C grades. == Projects == * Midterm Project Description [[Media:Midterm2017.pdf]] ** [[Agile|Agile Development Tips & Tricks]] == Textbooks and Resources == * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-0072-7 Beginning Python, Hetland, 2005] (eBook avail. from USF Library) * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-3238-4 Python Algorithms, Hetland, 2010] (eBook avail. from USF Library) * [http://aosabook.org/en/index.html The Architecture of Open Source Applications] * [http://docs.python.org Python Documentation] * [https://developers.google.com/edu/python/ Google Introductory Python Notes] * [http://huffman.sourceforge.net/tao/tao-of-programming.html Tao of Programming] Other (possibly useful) materials: * [http://hackersdictionary.com/html/entry/larval-stage.html The Jargon File] * Chapters 7&8 of Modelling and Simulation, Birta and Arbez, Springer 2007 (eBook avail. from USF Library). * Chapters 4-6 of Models and Algorithms for Intelligent Data Analysis, Runkler, Springer 2012 (eBook avail. from USF Library). * Guide to Scientific Computing in C++, Francis and Whiteley, Springer, 2012. (eBook avail. from USF Library) * Extra info. On the basics: ** Chapters 3 and 7 of Mathematics in Computing, Regan, Springer 2013. (eBook avail. from USF Library) ** Instant feedback graphical programming with [https://www.khanacademy.org/cs/programming/ Khan Academy] * [http://www.meetup.com/python-178/ Local PyBulls Meetings] Code: * [http://carsonfarmer.com/2013/07/essential-python-geo-libraries Python Libraries Useful for Geospatial Problems] * [[Code#Python_Libraries|Python Libraries Useful for Computational Chemistry]] (very small list at present) Interactive Interpreters: * [http://www.codewars.com CodeWars] Recommended for building experience with practice problems. * [http://codecombat.com/ CodeCombat] A very visual way to interact with your python code. * [http://exercism.io Exercism] A command-line client with a similar learn-through-challenge philosophy. * [http://repl.it repl.it] A read-eval-print loop for several computer languages. * [http://en.cppreference.com/w/cpp/language CppReference] Documentation with an online evaluator for C++ code. === Notes === * [[Media:Intro.pdf|Introduction Notes]] * [[Media:Week2-2017.pdf|Week 2-3 Notes]] * Week 4: read through function syntax in [[Media:Week2.pdf|2016 Week 2]] and for-loops in [[Media:Week3.pdf|2016 Week 3-4]] * In-Class Examples ** [[Turing Exercise]] ** [https://predictivestatmech.org/code/example.dcd Example DCD File] * [[Media:Week-5.2017.pdf|Week 5 Notes]] * [[Media:PlottingMaps.pdf|Week 6 Notes]] ** [[Code:PyTesting]] * [[Media:NumpyArrays.pdf|Week 7 Notes]] ** [http://www.labri.fr/perso/nrougier/from-python-to-numpy/ all about numpy] * Misc. Notes for Week 8 ** [[Physics:Pairs|Rundown of Pair Interactions]] ** Parameterized surfaces [[Media:param1.jpg|1]] and [[Media:param2.jpg|2]] * Notes for Compilation Lab ** [https://learnpythonthehardway.org/book/appendixa.html Command Line Crash Course] Cheat sheet for bash commands. ** USF's compute cluster documentation at [https://wiki.rc.usf.edu/index.php/Main_Page RC Wiki]. *** See especially the "Connecting to SC" and "Modules" sections ** [[Code:Compiling|Cheat-codes]] for compilation lab. * [[Media:jobs.pdf|Research Computing Jobs]] === Homework === * Homework will be assigned through [https://repl.it/classroom/invite/BtxEVLe Repl.IT] ** Homework 1 is due Friday, Jan. 20 ** Homework 2 is due Friday, Jan 27 ** Homework 3 is due Friday, Feb 10 ** Homework 4 is due Friday, Feb 17 ** Homework 5 is due Wednesday, Mar. 8 * Project presentations will be on Wed., Mar 29 ** Homework 6 is due Friday, Mar. 31 ** Homework 7 is due Friday, Apr. 7 ** Homework 8 is due Friday, Apr. 14 ** Homework 9 is due Friday, Apr. 21 ** Homework 10 is due Friday, Apr. 28 * Final Project presentations will be during exam time. Hints for HW 4 <source lang="python"> def translate(nuc): # 1. remove all non-ATGC characters from nuc # str -> str (nuc.translate) # str -> [char], [char] -> str # 2. capitalize all characters : str -> str # 3. translate 3-char blocks # str -> [char] # hint: range(0, len(s), 3) prot = [] for i in range(2): prot += gencode[nuc[i:i+3]] # 4. join characters return "".join(prot) # TODO: fix empty return and string-values! def get_params(sparams): print(sparams) # 1. split sparams on newlines # str -> [str] lines = sparams.split('\n') print(lines) # 2. create an empty dictionary d = {} # 3. for each line, split on ' ' # add key = val to d for line in lines: tok = line.split() print(tok) continue d[tok[0]] = tok[2] return d def newton(x, v, m, k, dt): dxdt = v dvdt = # acceleration (use F = m a), F = (use Hook's law) return (x+dt*dxdt, v+dt*dvdt) </source> 3d plotting example: <source lang="python"> # modified 3d plot from http://matplotlib.org/examples/mplot3d/rotate_axes3d_demo.html from numpy import * import pylab as plt from mpl_toolkits.mplot3d import axes3d def plot_a_list(x): fig = plt.figure() ax = fig.add_subplot(111, projection='3d') x = array(x) X = x[:,0] Y = x[:,1] #[x[0,1], x[1,1], x[2,1], ... Z = x[:,2] # [x[0,2], x[1,2], ... ax.scatter(X, Y, Z) # rotate the axes and update for angle in range(0, 360): ax.view_init(30, angle) plt.draw() plt.pause(.001) x = [ [5,5,0], [6,7,-1], [7, 9, -2], [8, 11, -3], [9, 13, -4]] x.append([10,15,-5]) plot_a_list(x) </source> aef2d8c8e9e6417bc8e217aa155df29d962c7ca9 590 588 2017-04-11T15:10:19Z David M. Rogers 2 wikitext text/x-wiki '''<BIG>Introduction to Scientific Computing</BIG>''' Course Info * Course Numbers CHM 4932-004/6938-010, CRN: 21864/21865 * Credit Hours: 3 * Meeting Dates: January 9 - April 26, 2017 ** No Class Jan. 16 or Mar. 13-17 * Meeting Times: Mon. and Wed., 12:30-13:45 in SCA 222 ** Final Wednesday, May 3, 10:00am – 12:00pm ** Lab Session & Office Hours: Fri. 12:30-13:45 in IDR 214 (or SCA 222 by announcement) == Overview == Mathematical models in the natural sciences take many shapes and forms. The moment they become more complicated than tracking a few variables over time, we have to put away our Excel spreadsheets and make use of a solid foundation in computational science. The course establishes this foundation by introducing data structures and algorithms used in everyday scientific computing using examples in the python scripting language. By the end of the Semester, students will be able to navigate the Linux command-line to go from a mathematical model to a numerical solution. Best practices for working with computer code and visualizing data will also be covered. == Topics == # Languages #* bash (shell) #* python (scripting) #* stack & register-based machine languages: overview of C and Fortran syntax & compiling with gcc, ‘thread safety’ #* Shared libraries & language inter-operability (FFI) # Algorithms #* Horner’s algorithm for polynomials #* Newton’s root finding algo. #* Overview of general optimization algo-s (example: linear & nonlin. least-squares) #* Numerical integration (scripted, plus gnu ODE) #* Communication (how HTTP get/put works) # Data Structures #* Linked Lists #* Trees (file system hierarchies) #* Graphs #* Arrays (dense & sparse) example: vectors & rotations / transpositions, densities and difference operators # Presentation & visualization #* Flat CSV files (and excel) #* Working with binary data #* Python matplotlib (2D images) #* Binning histograms & weighted averages # Best Practices #* High-level code design (modularity, interface specifications, unit testing, etc.) #* Code audit: open-source libraries, ex. Gnu Scientific Library, qsort in libc, Boost #* Source code versioning (example: git or mercurial) #* gdb & execution profiling #* documentation #* Makefiles == Grading == '''Grading Scale (out of 400 points possible)''' {| class="wikitable" |- ! Grade ! Undergraduate ! Graduate |- | A | 230 | 300 |- | B | 180 | 230 |- | C | 150 | 180 |- | D | 120 | 150 |} * Points Possible: ** 10 homework assignments (20 points per homework) ** 2 projects / competitions (100 points per project) * Homework Rules ** For work done in groups, credit is divided equally among participants - so the max homework grade for a group of 2 is 10 points each. ** For each homework, 1 re-do at full credit can be sent at any time after the due date, but must present a unique solution to previous work from yourself or others. ** All work must cite co-group members (if any) and the source of any code snippets used online. === Grading Rationale === Homework points will only be awarded for correct, working code and correct algorithmic analysis, while the homework problems will become progressively tougher. Undergraduates should be able to pass the course with an A if they have correctly answered most of the homework, and made a strong attempt at one of the projects. Graduate students should both perform well on the homework and successfully complete one or two projects. Essentially, this means you should do your own homework when possible and may do a project in a small group. The re-grading and group options for homework allow making up for missed assignments, and encourage returning to core concepts at a later point in the class. Students who have completed significant portions of the homework have thus demonstrated programming proficiency, and are qualified for at least B/C grades. == Projects == * Midterm Project Description [[Media:Midterm2017.pdf]] ** [[Agile|Agile Development Tips & Tricks]] * Final Project Description [[Media:Final2017.pdf]] == Textbooks and Resources == * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-0072-7 Beginning Python, Hetland, 2005] (eBook avail. from USF Library) * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-3238-4 Python Algorithms, Hetland, 2010] (eBook avail. from USF Library) * [http://aosabook.org/en/index.html The Architecture of Open Source Applications] * [http://docs.python.org Python Documentation] * [https://developers.google.com/edu/python/ Google Introductory Python Notes] * [http://huffman.sourceforge.net/tao/tao-of-programming.html Tao of Programming] Other (possibly useful) materials: * [http://hackersdictionary.com/html/entry/larval-stage.html The Jargon File] * Chapters 7&8 of Modelling and Simulation, Birta and Arbez, Springer 2007 (eBook avail. from USF Library). * Chapters 4-6 of Models and Algorithms for Intelligent Data Analysis, Runkler, Springer 2012 (eBook avail. from USF Library). * Guide to Scientific Computing in C++, Francis and Whiteley, Springer, 2012. (eBook avail. from USF Library) * Extra info. On the basics: ** Chapters 3 and 7 of Mathematics in Computing, Regan, Springer 2013. (eBook avail. from USF Library) ** Instant feedback graphical programming with [https://www.khanacademy.org/cs/programming/ Khan Academy] * [http://www.meetup.com/python-178/ Local PyBulls Meetings] Code: * [http://carsonfarmer.com/2013/07/essential-python-geo-libraries Python Libraries Useful for Geospatial Problems] * [[Code#Python_Libraries|Python Libraries Useful for Computational Chemistry]] (very small list at present) Interactive Interpreters: * [http://www.codewars.com CodeWars] Recommended for building experience with practice problems. * [http://codecombat.com/ CodeCombat] A very visual way to interact with your python code. * [http://exercism.io Exercism] A command-line client with a similar learn-through-challenge philosophy. * [http://repl.it repl.it] A read-eval-print loop for several computer languages. * [http://en.cppreference.com/w/cpp/language CppReference] Documentation with an online evaluator for C++ code. === Notes === * [[Media:Intro.pdf|Introduction Notes]] * [[Media:Week2-2017.pdf|Week 2-3 Notes]] * Week 4: read through function syntax in [[Media:Week2.pdf|2016 Week 2]] and for-loops in [[Media:Week3.pdf|2016 Week 3-4]] * In-Class Examples ** [[Turing Exercise]] ** [https://predictivestatmech.org/code/example.dcd Example DCD File] * [[Media:Week-5.2017.pdf|Week 5 Notes]] * [[Media:PlottingMaps.pdf|Week 6 Notes]] ** [[Code:PyTesting]] * [[Media:NumpyArrays.pdf|Week 7 Notes]] ** [http://www.labri.fr/perso/nrougier/from-python-to-numpy/ all about numpy] * Misc. Notes for Week 8 ** [[Physics:Pairs|Rundown of Pair Interactions]] ** Parameterized surfaces [[Media:param1.jpg|1]] and [[Media:param2.jpg|2]] * Notes for Compilation Lab ** [https://learnpythonthehardway.org/book/appendixa.html Command Line Crash Course] Cheat sheet for bash commands. ** USF's compute cluster documentation at [https://wiki.rc.usf.edu/index.php/Main_Page RC Wiki]. *** See especially the "Connecting to SC" and "Modules" sections ** [[Code:Compiling|Cheat-codes]] for compilation lab. * [[Media:jobs.pdf|Research Computing Jobs]] === Homework === * Homework will be assigned through [https://repl.it/classroom/invite/BtxEVLe Repl.IT] ** Homework 1 is due Friday, Jan. 20 ** Homework 2 is due Friday, Jan 27 ** Homework 3 is due Friday, Feb 10 ** Homework 4 is due Friday, Feb 17 ** Homework 5 is due Wednesday, Mar. 8 * Project presentations will be on Wed., Mar 29 ** Homework 6 is due Friday, Mar. 31 ** Homework 7 is due Friday, Apr. 7 ** Homework 8 is due Friday, Apr. 14 ** Homework 9 is due Friday, Apr. 21 ** Homework 10 is due Friday, Apr. 28 * Final Project presentations will be during exam time. Hints for HW 4 <source lang="python"> def translate(nuc): # 1. remove all non-ATGC characters from nuc # str -> str (nuc.translate) # str -> [char], [char] -> str # 2. capitalize all characters : str -> str # 3. translate 3-char blocks # str -> [char] # hint: range(0, len(s), 3) prot = [] for i in range(2): prot += gencode[nuc[i:i+3]] # 4. join characters return "".join(prot) # TODO: fix empty return and string-values! def get_params(sparams): print(sparams) # 1. split sparams on newlines # str -> [str] lines = sparams.split('\n') print(lines) # 2. create an empty dictionary d = {} # 3. for each line, split on ' ' # add key = val to d for line in lines: tok = line.split() print(tok) continue d[tok[0]] = tok[2] return d def newton(x, v, m, k, dt): dxdt = v dvdt = # acceleration (use F = m a), F = (use Hook's law) return (x+dt*dxdt, v+dt*dvdt) </source> 3d plotting example: <source lang="python"> # modified 3d plot from http://matplotlib.org/examples/mplot3d/rotate_axes3d_demo.html from numpy import * import pylab as plt from mpl_toolkits.mplot3d import axes3d def plot_a_list(x): fig = plt.figure() ax = fig.add_subplot(111, projection='3d') x = array(x) X = x[:,0] Y = x[:,1] #[x[0,1], x[1,1], x[2,1], ... Z = x[:,2] # [x[0,2], x[1,2], ... ax.scatter(X, Y, Z) # rotate the axes and update for angle in range(0, 360): ax.view_init(30, angle) plt.draw() plt.pause(.001) x = [ [5,5,0], [6,7,-1], [7, 9, -2], [8, 11, -3], [9, 13, -4]] x.append([10,15,-5]) plot_a_list(x) </source> b8e1f2212572da66d00865b8b371411ad0e5af9b 594 590 2017-04-24T16:20:38Z David M. Rogers 2 /* Notes */ wikitext text/x-wiki '''<BIG>Introduction to Scientific Computing</BIG>''' Course Info * Course Numbers CHM 4932-004/6938-010, CRN: 21864/21865 * Credit Hours: 3 * Meeting Dates: January 9 - April 26, 2017 ** No Class Jan. 16 or Mar. 13-17 * Meeting Times: Mon. and Wed., 12:30-13:45 in SCA 222 ** Final Wednesday, May 3, 10:00am – 12:00pm ** Lab Session & Office Hours: Fri. 12:30-13:45 in IDR 214 (or SCA 222 by announcement) == Overview == Mathematical models in the natural sciences take many shapes and forms. The moment they become more complicated than tracking a few variables over time, we have to put away our Excel spreadsheets and make use of a solid foundation in computational science. The course establishes this foundation by introducing data structures and algorithms used in everyday scientific computing using examples in the python scripting language. By the end of the Semester, students will be able to navigate the Linux command-line to go from a mathematical model to a numerical solution. Best practices for working with computer code and visualizing data will also be covered. == Topics == # Languages #* bash (shell) #* python (scripting) #* stack & register-based machine languages: overview of C and Fortran syntax & compiling with gcc, ‘thread safety’ #* Shared libraries & language inter-operability (FFI) # Algorithms #* Horner’s algorithm for polynomials #* Newton’s root finding algo. #* Overview of general optimization algo-s (example: linear & nonlin. least-squares) #* Numerical integration (scripted, plus gnu ODE) #* Communication (how HTTP get/put works) # Data Structures #* Linked Lists #* Trees (file system hierarchies) #* Graphs #* Arrays (dense & sparse) example: vectors & rotations / transpositions, densities and difference operators # Presentation & visualization #* Flat CSV files (and excel) #* Working with binary data #* Python matplotlib (2D images) #* Binning histograms & weighted averages # Best Practices #* High-level code design (modularity, interface specifications, unit testing, etc.) #* Code audit: open-source libraries, ex. Gnu Scientific Library, qsort in libc, Boost #* Source code versioning (example: git or mercurial) #* gdb & execution profiling #* documentation #* Makefiles == Grading == '''Grading Scale (out of 400 points possible)''' {| class="wikitable" |- ! Grade ! Undergraduate ! Graduate |- | A | 230 | 300 |- | B | 180 | 230 |- | C | 150 | 180 |- | D | 120 | 150 |} * Points Possible: ** 10 homework assignments (20 points per homework) ** 2 projects / competitions (100 points per project) * Homework Rules ** For work done in groups, credit is divided equally among participants - so the max homework grade for a group of 2 is 10 points each. ** For each homework, 1 re-do at full credit can be sent at any time after the due date, but must present a unique solution to previous work from yourself or others. ** All work must cite co-group members (if any) and the source of any code snippets used online. === Grading Rationale === Homework points will only be awarded for correct, working code and correct algorithmic analysis, while the homework problems will become progressively tougher. Undergraduates should be able to pass the course with an A if they have correctly answered most of the homework, and made a strong attempt at one of the projects. Graduate students should both perform well on the homework and successfully complete one or two projects. Essentially, this means you should do your own homework when possible and may do a project in a small group. The re-grading and group options for homework allow making up for missed assignments, and encourage returning to core concepts at a later point in the class. Students who have completed significant portions of the homework have thus demonstrated programming proficiency, and are qualified for at least B/C grades. == Projects == * Midterm Project Description [[Media:Midterm2017.pdf]] ** [[Agile|Agile Development Tips & Tricks]] * Final Project Description [[Media:Final2017.pdf]] == Textbooks and Resources == * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-0072-7 Beginning Python, Hetland, 2005] (eBook avail. from USF Library) * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-3238-4 Python Algorithms, Hetland, 2010] (eBook avail. from USF Library) * [http://aosabook.org/en/index.html The Architecture of Open Source Applications] * [http://docs.python.org Python Documentation] * [https://developers.google.com/edu/python/ Google Introductory Python Notes] * [http://huffman.sourceforge.net/tao/tao-of-programming.html Tao of Programming] Other (possibly useful) materials: * [http://hackersdictionary.com/html/entry/larval-stage.html The Jargon File] * Chapters 7&8 of Modelling and Simulation, Birta and Arbez, Springer 2007 (eBook avail. from USF Library). * Chapters 4-6 of Models and Algorithms for Intelligent Data Analysis, Runkler, Springer 2012 (eBook avail. from USF Library). * Guide to Scientific Computing in C++, Francis and Whiteley, Springer, 2012. (eBook avail. from USF Library) * Extra info. On the basics: ** Chapters 3 and 7 of Mathematics in Computing, Regan, Springer 2013. (eBook avail. from USF Library) ** Instant feedback graphical programming with [https://www.khanacademy.org/cs/programming/ Khan Academy] * [http://www.meetup.com/python-178/ Local PyBulls Meetings] Code: * [http://carsonfarmer.com/2013/07/essential-python-geo-libraries Python Libraries Useful for Geospatial Problems] * [[Code#Python_Libraries|Python Libraries Useful for Computational Chemistry]] (very small list at present) Interactive Interpreters: * [http://www.codewars.com CodeWars] Recommended for building experience with practice problems. * [http://codecombat.com/ CodeCombat] A very visual way to interact with your python code. * [http://exercism.io Exercism] A command-line client with a similar learn-through-challenge philosophy. * [http://repl.it repl.it] A read-eval-print loop for several computer languages. * [http://en.cppreference.com/w/cpp/language CppReference] Documentation with an online evaluator for C++ code. === Notes === * [[Media:Intro.pdf|Introduction Notes]] * [[Media:Week2-2017.pdf|Week 2-3 Notes]] * Week 4: read through function syntax in [[Media:Week2.pdf|2016 Week 2]] and for-loops in [[Media:Week3.pdf|2016 Week 3-4]] * In-Class Examples ** [[Turing Exercise]] ** [https://predictivestatmech.org/code/example.dcd Example DCD File] * [[Media:Week-5.2017.pdf|Week 5 Notes]] * [[Media:PlottingMaps.pdf|Week 6 Notes]] ** [[Code:PyTesting]] * [[Media:NumpyArrays.pdf|Week 7 Notes]] ** [http://www.labri.fr/perso/nrougier/from-python-to-numpy/ all about numpy] * Misc. Notes for Week 8 ** [[Physics:Pairs|Rundown of Pair Interactions]] ** Parameterized surfaces [[Media:param1.jpg|1]] and [[Media:param2.jpg|2]] * Notes for Compilation Lab ** [https://learnpythonthehardway.org/book/appendixa.html Command Line Crash Course] Cheat sheet for bash commands. ** USF's compute cluster documentation at [https://wiki.rc.usf.edu/index.php/Main_Page RC Wiki]. *** See especially the "Connecting to SC" and "Modules" sections ** [[Code:Compiling|Cheat-codes]] for compilation lab. * [[Media:jobs.pdf|Research Computing Batch Queue]] * [[Media:Plug-in.pdf|Plugging Into Libraries]] === Homework === * Homework will be assigned through [https://repl.it/classroom/invite/BtxEVLe Repl.IT] ** Homework 1 is due Friday, Jan. 20 ** Homework 2 is due Friday, Jan 27 ** Homework 3 is due Friday, Feb 10 ** Homework 4 is due Friday, Feb 17 ** Homework 5 is due Wednesday, Mar. 8 * Project presentations will be on Wed., Mar 29 ** Homework 6 is due Friday, Mar. 31 ** Homework 7 is due Friday, Apr. 7 ** Homework 8 is due Friday, Apr. 14 ** Homework 9 is due Friday, Apr. 21 ** Homework 10 is due Friday, Apr. 28 * Final Project presentations will be during exam time. Hints for HW 4 <source lang="python"> def translate(nuc): # 1. remove all non-ATGC characters from nuc # str -> str (nuc.translate) # str -> [char], [char] -> str # 2. capitalize all characters : str -> str # 3. translate 3-char blocks # str -> [char] # hint: range(0, len(s), 3) prot = [] for i in range(2): prot += gencode[nuc[i:i+3]] # 4. join characters return "".join(prot) # TODO: fix empty return and string-values! def get_params(sparams): print(sparams) # 1. split sparams on newlines # str -> [str] lines = sparams.split('\n') print(lines) # 2. create an empty dictionary d = {} # 3. for each line, split on ' ' # add key = val to d for line in lines: tok = line.split() print(tok) continue d[tok[0]] = tok[2] return d def newton(x, v, m, k, dt): dxdt = v dvdt = # acceleration (use F = m a), F = (use Hook's law) return (x+dt*dxdt, v+dt*dvdt) </source> 3d plotting example: <source lang="python"> # modified 3d plot from http://matplotlib.org/examples/mplot3d/rotate_axes3d_demo.html from numpy import * import pylab as plt from mpl_toolkits.mplot3d import axes3d def plot_a_list(x): fig = plt.figure() ax = fig.add_subplot(111, projection='3d') x = array(x) X = x[:,0] Y = x[:,1] #[x[0,1], x[1,1], x[2,1], ... Z = x[:,2] # [x[0,2], x[1,2], ... ax.scatter(X, Y, Z) # rotate the axes and update for angle in range(0, 360): ax.view_init(30, angle) plt.draw() plt.pause(.001) x = [ [5,5,0], [6,7,-1], [7, 9, -2], [8, 11, -3], [9, 13, -4]] x.append([10,15,-5]) plot_a_list(x) </source> e7209ba0f7551cb84e8314a1b76800d2e33566da 596 594 2017-04-26T16:22:04Z David M. Rogers 2 /* Notes */ wikitext text/x-wiki '''<BIG>Introduction to Scientific Computing</BIG>''' Course Info * Course Numbers CHM 4932-004/6938-010, CRN: 21864/21865 * Credit Hours: 3 * Meeting Dates: January 9 - April 26, 2017 ** No Class Jan. 16 or Mar. 13-17 * Meeting Times: Mon. and Wed., 12:30-13:45 in SCA 222 ** Final Wednesday, May 3, 10:00am – 12:00pm ** Lab Session & Office Hours: Fri. 12:30-13:45 in IDR 214 (or SCA 222 by announcement) == Overview == Mathematical models in the natural sciences take many shapes and forms. The moment they become more complicated than tracking a few variables over time, we have to put away our Excel spreadsheets and make use of a solid foundation in computational science. The course establishes this foundation by introducing data structures and algorithms used in everyday scientific computing using examples in the python scripting language. By the end of the Semester, students will be able to navigate the Linux command-line to go from a mathematical model to a numerical solution. Best practices for working with computer code and visualizing data will also be covered. == Topics == # Languages #* bash (shell) #* python (scripting) #* stack & register-based machine languages: overview of C and Fortran syntax & compiling with gcc, ‘thread safety’ #* Shared libraries & language inter-operability (FFI) # Algorithms #* Horner’s algorithm for polynomials #* Newton’s root finding algo. #* Overview of general optimization algo-s (example: linear & nonlin. least-squares) #* Numerical integration (scripted, plus gnu ODE) #* Communication (how HTTP get/put works) # Data Structures #* Linked Lists #* Trees (file system hierarchies) #* Graphs #* Arrays (dense & sparse) example: vectors & rotations / transpositions, densities and difference operators # Presentation & visualization #* Flat CSV files (and excel) #* Working with binary data #* Python matplotlib (2D images) #* Binning histograms & weighted averages # Best Practices #* High-level code design (modularity, interface specifications, unit testing, etc.) #* Code audit: open-source libraries, ex. Gnu Scientific Library, qsort in libc, Boost #* Source code versioning (example: git or mercurial) #* gdb & execution profiling #* documentation #* Makefiles == Grading == '''Grading Scale (out of 400 points possible)''' {| class="wikitable" |- ! Grade ! Undergraduate ! Graduate |- | A | 230 | 300 |- | B | 180 | 230 |- | C | 150 | 180 |- | D | 120 | 150 |} * Points Possible: ** 10 homework assignments (20 points per homework) ** 2 projects / competitions (100 points per project) * Homework Rules ** For work done in groups, credit is divided equally among participants - so the max homework grade for a group of 2 is 10 points each. ** For each homework, 1 re-do at full credit can be sent at any time after the due date, but must present a unique solution to previous work from yourself or others. ** All work must cite co-group members (if any) and the source of any code snippets used online. === Grading Rationale === Homework points will only be awarded for correct, working code and correct algorithmic analysis, while the homework problems will become progressively tougher. Undergraduates should be able to pass the course with an A if they have correctly answered most of the homework, and made a strong attempt at one of the projects. Graduate students should both perform well on the homework and successfully complete one or two projects. Essentially, this means you should do your own homework when possible and may do a project in a small group. The re-grading and group options for homework allow making up for missed assignments, and encourage returning to core concepts at a later point in the class. Students who have completed significant portions of the homework have thus demonstrated programming proficiency, and are qualified for at least B/C grades. == Projects == * Midterm Project Description [[Media:Midterm2017.pdf]] ** [[Agile|Agile Development Tips & Tricks]] * Final Project Description [[Media:Final2017.pdf]] == Textbooks and Resources == * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-0072-7 Beginning Python, Hetland, 2005] (eBook avail. from USF Library) * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-3238-4 Python Algorithms, Hetland, 2010] (eBook avail. from USF Library) * [http://aosabook.org/en/index.html The Architecture of Open Source Applications] * [http://docs.python.org Python Documentation] * [https://developers.google.com/edu/python/ Google Introductory Python Notes] * [http://huffman.sourceforge.net/tao/tao-of-programming.html Tao of Programming] Other (possibly useful) materials: * [http://hackersdictionary.com/html/entry/larval-stage.html The Jargon File] * Chapters 7&8 of Modelling and Simulation, Birta and Arbez, Springer 2007 (eBook avail. from USF Library). * Chapters 4-6 of Models and Algorithms for Intelligent Data Analysis, Runkler, Springer 2012 (eBook avail. from USF Library). * Guide to Scientific Computing in C++, Francis and Whiteley, Springer, 2012. (eBook avail. from USF Library) * Extra info. On the basics: ** Chapters 3 and 7 of Mathematics in Computing, Regan, Springer 2013. (eBook avail. from USF Library) ** Instant feedback graphical programming with [https://www.khanacademy.org/cs/programming/ Khan Academy] * [http://www.meetup.com/python-178/ Local PyBulls Meetings] Code: * [http://carsonfarmer.com/2013/07/essential-python-geo-libraries Python Libraries Useful for Geospatial Problems] * [[Code#Python_Libraries|Python Libraries Useful for Computational Chemistry]] (very small list at present) Interactive Interpreters: * [http://www.codewars.com CodeWars] Recommended for building experience with practice problems. * [http://codecombat.com/ CodeCombat] A very visual way to interact with your python code. * [http://exercism.io Exercism] A command-line client with a similar learn-through-challenge philosophy. * [http://repl.it repl.it] A read-eval-print loop for several computer languages. * [http://en.cppreference.com/w/cpp/language CppReference] Documentation with an online evaluator for C++ code. === Notes === * [[Media:Intro.pdf|Introduction Notes]] * [[Media:Week2-2017.pdf|Week 2-3 Notes]] * Week 4: read through function syntax in [[Media:Week2.pdf|2016 Week 2]] and for-loops in [[Media:Week3.pdf|2016 Week 3-4]] * In-Class Examples ** [[Turing Exercise]] ** [https://predictivestatmech.org/code/example.dcd Example DCD File] * [[Media:Week-5.2017.pdf|Week 5 Notes]] * [[Media:PlottingMaps.pdf|Week 6 Notes]] ** [[Code:PyTesting]] * [[Media:NumpyArrays.pdf|Week 7 Notes]] ** [http://www.labri.fr/perso/nrougier/from-python-to-numpy/ all about numpy] * Misc. Notes for Week 8 ** [[Physics:Pairs|Rundown of Pair Interactions]] ** Parameterized surfaces [[Media:param1.jpg|1]] and [[Media:param2.jpg|2]] * Notes for Compilation Lab ** [https://learnpythonthehardway.org/book/appendixa.html Command Line Crash Course] Cheat sheet for bash commands. ** USF's compute cluster documentation at [https://wiki.rc.usf.edu/index.php/Main_Page RC Wiki]. *** See especially the "Connecting to SC" and "Modules" sections ** [[Code:Compiling|Cheat-codes]] for compilation lab. * [[Media:jobs.pdf|Research Computing Batch Queue]] * [[Media:Plug-in.pdf|Plugging Into Libraries]] * [[Media:Matrix.pdf|Matrix Algorithms]] === Homework === * Homework will be assigned through [https://repl.it/classroom/invite/BtxEVLe Repl.IT] ** Homework 1 is due Friday, Jan. 20 ** Homework 2 is due Friday, Jan 27 ** Homework 3 is due Friday, Feb 10 ** Homework 4 is due Friday, Feb 17 ** Homework 5 is due Wednesday, Mar. 8 * Project presentations will be on Wed., Mar 29 ** Homework 6 is due Friday, Mar. 31 ** Homework 7 is due Friday, Apr. 7 ** Homework 8 is due Friday, Apr. 14 ** Homework 9 is due Friday, Apr. 21 ** Homework 10 is due Friday, Apr. 28 * Final Project presentations will be during exam time. Hints for HW 4 <source lang="python"> def translate(nuc): # 1. remove all non-ATGC characters from nuc # str -> str (nuc.translate) # str -> [char], [char] -> str # 2. capitalize all characters : str -> str # 3. translate 3-char blocks # str -> [char] # hint: range(0, len(s), 3) prot = [] for i in range(2): prot += gencode[nuc[i:i+3]] # 4. join characters return "".join(prot) # TODO: fix empty return and string-values! def get_params(sparams): print(sparams) # 1. split sparams on newlines # str -> [str] lines = sparams.split('\n') print(lines) # 2. create an empty dictionary d = {} # 3. for each line, split on ' ' # add key = val to d for line in lines: tok = line.split() print(tok) continue d[tok[0]] = tok[2] return d def newton(x, v, m, k, dt): dxdt = v dvdt = # acceleration (use F = m a), F = (use Hook's law) return (x+dt*dxdt, v+dt*dvdt) </source> 3d plotting example: <source lang="python"> # modified 3d plot from http://matplotlib.org/examples/mplot3d/rotate_axes3d_demo.html from numpy import * import pylab as plt from mpl_toolkits.mplot3d import axes3d def plot_a_list(x): fig = plt.figure() ax = fig.add_subplot(111, projection='3d') x = array(x) X = x[:,0] Y = x[:,1] #[x[0,1], x[1,1], x[2,1], ... Z = x[:,2] # [x[0,2], x[1,2], ... ax.scatter(X, Y, Z) # rotate the axes and update for angle in range(0, 360): ax.view_init(30, angle) plt.draw() plt.pause(.001) x = [ [5,5,0], [6,7,-1], [7, 9, -2], [8, 11, -3], [9, 13, -4]] x.append([10,15,-5]) plot_a_list(x) </source> 59e2921396b136f855a0922cda9d0880f38a9762 598 596 2017-05-01T16:35:00Z David M. Rogers 2 wikitext text/x-wiki '''<BIG>Introduction to Scientific Computing</BIG>''' Course Info * Course Numbers CHM 4932-004/6938-010, CRN: 21864/21865 * Credit Hours: 3 * Meeting Dates: January 9 - April 26, 2017 ** No Class Jan. 16 or Mar. 13-17 * Meeting Times: Mon. and Wed., 12:30-13:45 in SCA 222 ** Final Wednesday, May 3, 10:00am – 12:00pm ** Lab Session & Office Hours: Fri. 12:30-13:45 in IDR 214 (or SCA 222 by announcement) == Overview == Mathematical models in the natural sciences take many shapes and forms. The moment they become more complicated than tracking a few variables over time, we have to put away our Excel spreadsheets and make use of a solid foundation in computational science. The course establishes this foundation by introducing data structures and algorithms used in everyday scientific computing using examples in the python scripting language. By the end of the Semester, students will be able to navigate the Linux command-line to go from a mathematical model to a numerical solution. Best practices for working with computer code and visualizing data will also be covered. == Topics == # Languages #* bash (shell) #* python (scripting) #* stack & register-based machine languages: overview of C and Fortran syntax & compiling with gcc, ‘thread safety’ #* Shared libraries & language inter-operability (FFI) # Algorithms #* Horner’s algorithm for polynomials #* Newton’s root finding algo. #* Overview of general optimization algo-s (example: linear & nonlin. least-squares) #* Numerical integration (scripted, plus gnu ODE) #* Communication (how HTTP get/put works) # Data Structures #* Linked Lists #* Trees (file system hierarchies) #* Graphs #* Arrays (dense & sparse) example: vectors & rotations / transpositions, densities and difference operators # Presentation & visualization #* Flat CSV files (and excel) #* Working with binary data #* Python matplotlib (2D images) #* Binning histograms & weighted averages # Best Practices #* High-level code design (modularity, interface specifications, unit testing, etc.) #* Code audit: open-source libraries, ex. Gnu Scientific Library, qsort in libc, Boost #* Source code versioning (example: git or mercurial) #* gdb & execution profiling #* documentation #* Makefiles == Grading == '''Grading Scale (out of 400 points possible)''' {| class="wikitable" |- ! Grade ! Undergraduate ! Graduate |- | A | 230 | 280 |- | B | 180 | 230 |- | C | 150 | 180 |- | D | 120 | 150 |} * Points Possible: ** 10 homework assignments (20 points per homework) ** 2 projects / competitions (100 points per project) * Homework Rules ** For work done in groups, credit is divided equally among participants - so the max homework grade for a group of 2 is 10 points each. ** For each homework, 1 re-do at full credit can be sent at any time after the due date, but must present a unique solution to previous work from yourself or others. ** All work must cite co-group members (if any) and the source of any code snippets used online. === Grading Rationale === Homework points will only be awarded for correct, working code and correct algorithmic analysis, while the homework problems will become progressively tougher. Undergraduates should be able to pass the course with an A if they have correctly answered most of the homework, and made a strong attempt at one of the projects. Graduate students should both perform well on the homework and successfully complete one or two projects. Essentially, this means you should do your own homework when possible and may do a project in a small group. The re-grading and group options for homework allow making up for missed assignments, and encourage returning to core concepts at a later point in the class. Students who have completed significant portions of the homework have thus demonstrated programming proficiency, and are qualified for at least B/C grades. == Projects == * Midterm Project Description [[Media:Midterm2017.pdf]] ** [[Agile|Agile Development Tips & Tricks]] * Final Project Description [[Media:Final2017.pdf]] == Textbooks and Resources == * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-0072-7 Beginning Python, Hetland, 2005] (eBook avail. from USF Library) * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-3238-4 Python Algorithms, Hetland, 2010] (eBook avail. from USF Library) * [http://aosabook.org/en/index.html The Architecture of Open Source Applications] * [http://docs.python.org Python Documentation] * [https://developers.google.com/edu/python/ Google Introductory Python Notes] * [http://huffman.sourceforge.net/tao/tao-of-programming.html Tao of Programming] Other (possibly useful) materials: * [http://hackersdictionary.com/html/entry/larval-stage.html The Jargon File] * Chapters 7&8 of Modelling and Simulation, Birta and Arbez, Springer 2007 (eBook avail. from USF Library). * Chapters 4-6 of Models and Algorithms for Intelligent Data Analysis, Runkler, Springer 2012 (eBook avail. from USF Library). * Guide to Scientific Computing in C++, Francis and Whiteley, Springer, 2012. (eBook avail. from USF Library) * Extra info. On the basics: ** Chapters 3 and 7 of Mathematics in Computing, Regan, Springer 2013. (eBook avail. from USF Library) ** Instant feedback graphical programming with [https://www.khanacademy.org/cs/programming/ Khan Academy] * [http://www.meetup.com/python-178/ Local PyBulls Meetings] Code: * [http://carsonfarmer.com/2013/07/essential-python-geo-libraries Python Libraries Useful for Geospatial Problems] * [[Code#Python_Libraries|Python Libraries Useful for Computational Chemistry]] (very small list at present) Interactive Interpreters: * [http://www.codewars.com CodeWars] Recommended for building experience with practice problems. * [http://codecombat.com/ CodeCombat] A very visual way to interact with your python code. * [http://exercism.io Exercism] A command-line client with a similar learn-through-challenge philosophy. * [http://repl.it repl.it] A read-eval-print loop for several computer languages. * [http://en.cppreference.com/w/cpp/language CppReference] Documentation with an online evaluator for C++ code. === Notes === * [[Media:Intro.pdf|Introduction Notes]] * [[Media:Week2-2017.pdf|Week 2-3 Notes]] * Week 4: read through function syntax in [[Media:Week2.pdf|2016 Week 2]] and for-loops in [[Media:Week3.pdf|2016 Week 3-4]] * In-Class Examples ** [[Turing Exercise]] ** [https://predictivestatmech.org/code/example.dcd Example DCD File] * [[Media:Week-5.2017.pdf|Week 5 Notes]] * [[Media:PlottingMaps.pdf|Week 6 Notes]] ** [[Code:PyTesting]] * [[Media:NumpyArrays.pdf|Week 7 Notes]] ** [http://www.labri.fr/perso/nrougier/from-python-to-numpy/ all about numpy] * Misc. Notes for Week 8 ** [[Physics:Pairs|Rundown of Pair Interactions]] ** Parameterized surfaces [[Media:param1.jpg|1]] and [[Media:param2.jpg|2]] * Notes for Compilation Lab ** [https://learnpythonthehardway.org/book/appendixa.html Command Line Crash Course] Cheat sheet for bash commands. ** USF's compute cluster documentation at [https://wiki.rc.usf.edu/index.php/Main_Page RC Wiki]. *** See especially the "Connecting to SC" and "Modules" sections ** [[Code:Compiling|Cheat-codes]] for compilation lab. * [[Media:jobs.pdf|Research Computing Batch Queue]] * [[Media:Plug-in.pdf|Plugging Into Libraries]] * [[Media:Matrix.pdf|Matrix Algorithms]] === Homework === * Homework will be assigned through [https://repl.it/classroom/invite/BtxEVLe Repl.IT] ** Homework 1 is due Friday, Jan. 20 ** Homework 2 is due Friday, Jan 27 ** Homework 3 is due Friday, Feb 10 ** Homework 4 is due Friday, Feb 17 ** Homework 5 is due Wednesday, Mar. 8 * Project presentations will be on Wed., Mar 29 ** Homework 6 is due Friday, Mar. 31 ** Homework 7 is due Friday, Apr. 7 ** Homework 8 is due Friday, Apr. 14 ** Homework 9 is due Friday, Apr. 21 ** Homework 10 is due Friday, Apr. 28 * Final Project presentations will be during exam time. Hints for HW 4 <source lang="python"> def translate(nuc): # 1. remove all non-ATGC characters from nuc # str -> str (nuc.translate) # str -> [char], [char] -> str # 2. capitalize all characters : str -> str # 3. translate 3-char blocks # str -> [char] # hint: range(0, len(s), 3) prot = [] for i in range(2): prot += gencode[nuc[i:i+3]] # 4. join characters return "".join(prot) # TODO: fix empty return and string-values! def get_params(sparams): print(sparams) # 1. split sparams on newlines # str -> [str] lines = sparams.split('\n') print(lines) # 2. create an empty dictionary d = {} # 3. for each line, split on ' ' # add key = val to d for line in lines: tok = line.split() print(tok) continue d[tok[0]] = tok[2] return d def newton(x, v, m, k, dt): dxdt = v dvdt = # acceleration (use F = m a), F = (use Hook's law) return (x+dt*dxdt, v+dt*dvdt) </source> 3d plotting example: <source lang="python"> # modified 3d plot from http://matplotlib.org/examples/mplot3d/rotate_axes3d_demo.html from numpy import * import pylab as plt from mpl_toolkits.mplot3d import axes3d def plot_a_list(x): fig = plt.figure() ax = fig.add_subplot(111, projection='3d') x = array(x) X = x[:,0] Y = x[:,1] #[x[0,1], x[1,1], x[2,1], ... Z = x[:,2] # [x[0,2], x[1,2], ... ax.scatter(X, Y, Z) # rotate the axes and update for angle in range(0, 360): ax.view_init(30, angle) plt.draw() plt.pause(.001) x = [ [5,5,0], [6,7,-1], [7, 9, -2], [8, 11, -3], [9, 13, -4]] x.append([10,15,-5]) plot_a_list(x) </source> 42daa601fb5701542cc0b51615d1328167b384af Code:FPU 0 128 562 2017-02-17T15:47:14Z David M. Rogers 2 Created page with "Fermi-Pasta Ulam System with 32 particles started with sin-wave initial conditions. <HTML5video width="600" height="400" autoplay="true" loop="true">fpu</HTML5video>" wikitext text/x-wiki Fermi-Pasta Ulam System with 32 particles started with sin-wave initial conditions. <HTML5video width="600" height="400" autoplay="true" loop="true">fpu</HTML5video> 374dcae35da70e38aa334d87da3a2b1b4af297e3 File:NumpyArrays.pdf 6 129 564 2017-02-20T17:20:42Z David M. Rogers 2 wikitext text/x-wiki da39a3ee5e6b4b0d3255bfef95601890afd80709 File:Midterm2017.pdf 6 130 567 2017-02-22T17:30:57Z David M. Rogers 2 wikitext text/x-wiki da39a3ee5e6b4b0d3255bfef95601890afd80709 Physics:Pairs 0 131 569 2017-02-27T17:21:36Z David M. Rogers 2 Created page with " = Two-Body Problems = This page explains the numerical simulation of two-body problems suitable for a first numerical simulation. The coordinates of two point particles ca..." wikitext text/x-wiki = Two-Body Problems = This page explains the numerical simulation of two-body problems suitable for a first numerical simulation. The coordinates of two point particles can be represented by two vectors, <math>\vec x_1 \in \mathbb R^3</math> and <math>\vec x_2 \in \mathbb R^3</math>. They have corresponding masses and velocities (<math>m_i,\vec v_i</math>). Because the interaction between the particles is invariant to translations, the energy of interaction can only depend on the difference between coordinates, <math>\vec r = \vec x_2 - \vec x_1</math>. Even better, since the interaction should be invariant to rotation, the potential energy should really only depend on the length of <math>\vec r</math>, which we denote <math>r = |\vec r|</math>. You must memorize the formula for computing the magnitude of a vector, <math>|\vec r|^2 = \sum_i \vec r_i^2 = r_x^2 + r_y^2 + r_z^2</math>. == Common Energy Functions == === Harmonic Oscillator === The most common energy function is undoubtedly the potential energy of the harmonic oscillator, <math>U(r) = \frac{k}{2} (r - r_0)^2</math>. It has two parameters, ''k'', and <math>r_0</math>. Because of its commonly usage to represents the energy of a bond between atoms, <math>r_0</math> is sometimes referred to as the bond length, and ''k'' as the bond stretch constant. === Lennard-Jones === The second most common pair-energy function is arguably the Lennard-Jones form, <math>U(r) = 4 \epsilon\left( \left(\frac{\sigma}{r}\right)^{12} - \left(\frac{\sigma}{r}\right)^6 \right)</math>. This form is used to represent a pair of atoms that are not bonded. It also has two parameters. <math>\epsilon</math> is the `well-depth' and <math>\sigma</math> is the distance where the energy crosses from positive to negative. There is an alternate way to write this energy by re-defining <math>R = \sigma 2^{1/6}</math> and re-factoring the 4 inside the parentheses. === Other Forms === There are many other forms that try to represent the actual physical interaction energy between pairs of atoms more realistically than the primitive approximations above. You should look these up on your own * [[Wikipedia:Morse potential]] * [[Wikipedia:Buckingham potential]] * [[Wikipedia:Coulomb potential]] * [[Wikipedia:Gravitational potential]] * FENE (finitely extensible nonlinear elastic) Potential For the FENE potential (and the others as well) an excellent reference is the [http://manual.gromacs.org/documentation/ Gromacs User Manual] and high-level summaries of these functions are also present in the [http://lammps.sandia.gov/doc/pairs.html LAMMPS Documentation]. == Derivatives of the Energy == According to Newton's law, we must compute the force as, <math>\vec F = -\vec \nabla U</math>, where <math>U</math> is the potential energy function. In component form, <math>\vec \nabla_i = \frac{\partial}{\partial x_i}</math> is the derivative with respect to the <math> i^\mathrm{th}</math> component. To find the derivative of <math>U(r)</math> with respect to <math>\vec x_i</math>, the chain rule has to be used at least twice. The first one is easy, and can be summarized in vector form, <math>\vec \nabla_{x_2} = -\vec \nabla_{x_2} = \nabla_r</math> In English, <math>\vec x_2</math> increases as much as <math>\vec r</math> does, and <math>x_1</math> decreases as much as <math>\vec r</math> increases. The second part is harder, since it requires going from <math>\vec r</math> dependence to <math>\vec r</math> dependence. It is written in vector form as, <math> \vec \nabla_r U(r) = \frac{\vec r}{r} \frac{dU(r)}{dr}</math> b491cf128cd6ac2104000274b76bcea0b117f692 576 569 2017-03-06T18:51:45Z David M. Rogers 2 wikitext text/x-wiki = Two-Body Problems = This page explains the numerical simulation of two-body problems suitable for a first numerical simulation. The coordinates of two point particles can be represented by two vectors, <math>\vec x_1 \in \mathbb R^3</math> and <math>\vec x_2 \in \mathbb R^3</math>. They have corresponding masses and velocities (<math>m_i,\vec v_i</math>). Because the interaction between the particles is invariant to translations, the energy of interaction can only depend on the difference between coordinates, <math>\vec r = \vec x_2 - \vec x_1</math>. Even better, since the interaction should be invariant to rotation, the potential energy should really only depend on the length of <math>\vec r</math>, which we denote <math>r = |\vec r|</math>. You must memorize the formula for computing the magnitude of a vector, <math>|\vec r|^2 = \sum_i \vec r_i^2 = r_x^2 + r_y^2 + r_z^2</math>. == Common Energy Functions == === Harmonic Oscillator === The most common energy function is undoubtedly the potential energy of the harmonic oscillator, <math>U(r) = \frac{k}{2} (r - r_0)^2</math>. It has two parameters, ''k'', and <math>r_0</math>. Because of its commonly usage to represents the energy of a bond between atoms, <math>r_0</math> is sometimes referred to as the bond length, and ''k'' as the bond stretch constant. === Lennard-Jones === The second most common pair-energy function is arguably the Lennard-Jones form, <math>U(r) = 4 \epsilon\left( \left(\frac{\sigma}{r}\right)^{12} - \left(\frac{\sigma}{r}\right)^6 \right)</math>. This form is used to represent a pair of atoms that are not bonded. It also has two parameters. <math>\epsilon</math> is the `well-depth' and <math>\sigma</math> is the distance where the energy crosses from positive to negative. There is an alternate way to write this energy by re-defining <math>R = \sigma 2^{1/6}</math> and re-factoring the 4 inside the parentheses. === Other Forms === There are many other forms that try to represent the actual physical interaction energy between pairs of atoms more realistically than the primitive approximations above. You should look these up on your own * [[Wikipedia:Morse potential]] * [[Wikipedia:Buckingham potential]] * [[Wikipedia:Coulomb potential]] * [[Wikipedia:Gravitational potential]] * FENE (finitely extensible nonlinear elastic) Potential For the FENE potential (and the others as well) an excellent reference is the [http://manual.gromacs.org/documentation/ Gromacs User Manual] and high-level summaries of these functions are also present in the [http://lammps.sandia.gov/doc/pairs.html LAMMPS Documentation]. == Derivatives of the Energy == According to Newton's law, we must compute the force as, <math>\vec F = -\vec \nabla U</math>, where <math>U</math> is the potential energy function. In component form, <math>\vec \nabla_i = \frac{\partial}{\partial x_i}</math> is the derivative with respect to the <math> i^\mathrm{th}</math> component. To find the derivative of <math>U(r)</math> with respect to <math>\vec x_i</math>, the chain rule has to be used at least twice. The first one is easy, and can be summarized in vector form, <math>\vec \nabla_{x_2} = -\vec \nabla_{x_2} = \nabla_r</math> In English, <math>\vec x_2</math> increases as much as <math>\vec r</math> does, and <math>x_1</math> decreases as much as <math>\vec r</math> increases. The second part is harder, since it requires going from <math>\vec r</math> dependence to <math>\vec r</math> dependence. It is written in vector form as, <math> \vec \nabla_r U(r) = \frac{\vec r}{r} \frac{dU(r)}{dr}</math> = Example Implemenentation = This example shows the steps needed to run a 2-particle simulation in outline form. It is not complete, since the functions are not yet implemented. <source lang="python"> from numpy import * import pylab as plt # Understand system. def plot_atoms(x): # Make a plot of all atoms. #plt.plot([x0[0], x1[0]], [x0[1], x1[1]], 'o') plt.plot([x[0,0]], [x[0,1]], 'o') plt.plot([x[1,0]], [x[1,1]], 'o') # cruft plt.gca().set_xlim([0,10]) plt.gca().set_ylim([0,10]) plt.show() def mag(r): return sqrt(r[0]*r[0]+r[1]*r[1]+r[2]*r[2]) # Use physics. def calc_energy(x): # coords -> distance vectors r = x[1] - x[0] # distance vectors -> lengths print(mag(r)) print(r) # lengths -> energies def main(): # Define starting locations # x has 2 indices: # index 0 - atom number # index 1 - x,y, or z x = array([ [5,5,-1], [7,8,0] ]) plot_atoms(x) calc_energy(x) main() </source> b7d26b3581cd1a85034147a05061e7cf44afcd90 Predictive Chemistry:Current events 4 10 572 416 2017-03-01T19:13:27Z David M. Rogers 2 wikitext text/x-wiki * Feb. 17, 2017: David M. Rogers presents "Demystifying Nonequilibrium Statistical Mechanics" at the USF Physics Colloquium. * July 12-16, 2016: David M. Rogers presents "A Molecular Approach to Dispersion Energy" at the TSRC Workshop on Ions in Solution: Biology, Energy, and Environment. * July 7-8, 2016: David M. Rogers presents "The quantum mechanics of Jaynes" at the LANL Quantum Lunch. * Mar. 13-17, 2016: David M. Rogers presents "The Quantum Andersen Thermostat," at the 2016 ACS Spring Meeting. * Friday, Feb. 12, 2016: David M. Rogers presents "Angle-free methods for boundary element problems on the sphere: The quadrature basis for spherical harmonics," at the USF Mathematics Department Analysis Lecture Series. * Monday, Jan 11, 2016: USF Spring 2016 semester classes begin. * Tuesday, December 15, 2015: David M. Rogers presents "Maximum Transition Entropy - A Causal, Canonical Model for Nonequilibrium Statistical Mechanics," at the 114th Statistical Mechanics Conference at Rutgers, New Brunswick New Jersey. * Monday, September 14, 2015, Invited Presentation, "Understanding the origins of irreversibility: electrical driving and the second law.," Tulane Department of Chemistry. * July 27-30, 2015 Travel to DOE Comp. Sci. Graduate Fellowship Program Review in Arlington, VA. * June, 2015: JCTC Publishes our [http://pubs.acs.org/doi/abs/10.1021/acs.jctc.5b00357 article] on "Dispersion- and Exchange-Corrected Density Functional Theory for Sodium Ion Hydration" * Wednesday, May 13, 2015: David M. Rogers presented "Spatiotemporal Concentration-Polarization Induced pH Changes at Ion-Selective Membranes." at the [https://www.cbdstconference.com/agenda Chemical and Biological Defense Sci. & Tech. conference] in St. Louis, MO. * Friday, May 8, 2015: David M. Rogers presented "Where do Quanta Come From?" at the Florida ACS Meeting and Exhibition ([http://fame2015.fl-acs.org/ataglance.html FAME]). * April, 2015: [http://scitation.aip.org/content/aip/journal/jcp/142/7/10.1063/1.4907404 Real-Space Quadrature paper] was published as a cover article by JCP. * Wednesday, Mar. 4, 2015: David M. Rogers presented "[http://meetings.aps.org/Meeting/MAR15/Session/M44.9 Thermodynamics of Maximum Transition Entropy for Quantum Assemblies]." at the APS March Meeting in San Antonio, TX. * Saturday, Nov. 22 2014: USF and neighboring universities are hosting a [http://predictivestatmech.org/papers/MRI-flyer.pdf Scientific Computing Workshop] for undergraduates. Follow the instructions in the flyer to sign up by Nov. 11! * Thursday, Oct. 16: David M. Rogers presented "[http://predictivestatmech.org/papers/real-poles.pdf Real-space quadrature: A convenient, universal representation for multipole expansions]." at the Southeast Regional Meeting of the ACS in Nashville, TN. * Friday, Aug. 29 2014: Felipe Zapata joins the group * Monday, Aug. 25 2014: USF Autumn Semester First Day of Classes - don't forget to sign up for [[CompSciFall2014|Introduction to Scientific Computing]]! * Monday, Aug. 18 2014: David M. Rogers presented an invited talk "pH Dynamics During Concentration Polarization," to the [http://www.pnnl.gov/computing/cm4/ CM4 Mathematics for Mesoscopic Materials Modeling Group]. * Tuesday, July 8 2014: David M. Rogers presented "What’s Holding Up Multiscale modeling?" at the Telluride, CO workshop for [http://www.telluridescience.org/meetings/workshop-details?wid=404 Ions in Aqueous Solutions and Molecular Biology]. * Friday, May 9 2014: David M. Rogers presented "Jumping from atomistic to continuum simulation of electrochemical driving at interfaces," at the 2014 Florida FAME Conference.[http://www.fame.chem.ufl.edu/computational.html] * January 29th, 2014: David M. Rogers presented "Simulating at the molecular / continuum interface," at the USF Research Computing User's Group Forum [http://www.usf.edu/it/research-computing/featured-researchers/rogersgroup.aspx]. * Monday, Aug. 26 2013: USF Autumn Semester First Day of Classes * Friday, July 12, 2013: Argonne Center for Nanoscale Materials [http://nano.anl.gov/users/call_for_proposals.html Proposal Deadline] * Thursday, July 4, 2013: Independence Day - celebrate by supporting [https://www.eff.org/ EFF] * Thursday, April 11 2013: David M. Rogers presented "Solute Partitioning and Transport through Natural and Biomimetic Membranes," at the 2013 ACS National Meeting. == Calendars == * [http://www.registrar.usf.edu/enroll/regist/calendt.php USF Calendar] 70c4359bb8374f1360216c3ddf6dd276441f1388 573 572 2017-03-01T19:20:12Z David M. Rogers 2 wikitext text/x-wiki * Feb. 17, 2017: David M. Rogers presents "Demystifying Nonequilibrium Statistical Mechanics" at the USF Physics Colloquium. * September 14, 2016: David M. Rogers presents "A moment generating function for flows in open quantum systems" at the [http://www.df.unipi.it/~elze/DICE2016.html International Conference for Spacetime, Matter, and Quantum Mechanics]. * July 12-16, 2016: David M. Rogers presents "A Molecular Approach to Dispersion Energy" at the TSRC Workshop on Ions in Solution: Biology, Energy, and Environment. * July 7-8, 2016: David M. Rogers presents "The quantum mechanics of Jaynes" at the LANL Quantum Lunch. * Mar. 13-17, 2016: David M. Rogers presents "The Quantum Andersen Thermostat," at the 2016 ACS Spring Meeting. * Friday, Feb. 12, 2016: David M. Rogers presents "Angle-free methods for boundary element problems on the sphere: The quadrature basis for spherical harmonics," at the USF Mathematics Department Analysis Lecture Series. * Monday, Jan 11, 2016: USF Spring 2016 semester classes begin. * Tuesday, December 15, 2015: David M. Rogers presents "Maximum Transition Entropy - A Causal, Canonical Model for Nonequilibrium Statistical Mechanics," at the 114th Statistical Mechanics Conference at Rutgers, New Brunswick New Jersey. * Monday, September 14, 2015, Invited Presentation, "Understanding the origins of irreversibility: electrical driving and the second law.," Tulane Department of Chemistry. * July 27-30, 2015 Travel to DOE Comp. Sci. Graduate Fellowship Program Review in Arlington, VA. * June, 2015: JCTC Publishes our [http://pubs.acs.org/doi/abs/10.1021/acs.jctc.5b00357 article] on "Dispersion- and Exchange-Corrected Density Functional Theory for Sodium Ion Hydration" * Wednesday, May 13, 2015: David M. Rogers presented "Spatiotemporal Concentration-Polarization Induced pH Changes at Ion-Selective Membranes." at the [https://www.cbdstconference.com/agenda Chemical and Biological Defense Sci. & Tech. conference] in St. Louis, MO. * Friday, May 8, 2015: David M. Rogers presented "Where do Quanta Come From?" at the Florida ACS Meeting and Exhibition ([http://fame2015.fl-acs.org/ataglance.html FAME]). * April, 2015: [http://scitation.aip.org/content/aip/journal/jcp/142/7/10.1063/1.4907404 Real-Space Quadrature paper] was published as a cover article by JCP. * Wednesday, Mar. 4, 2015: David M. Rogers presented "[http://meetings.aps.org/Meeting/MAR15/Session/M44.9 Thermodynamics of Maximum Transition Entropy for Quantum Assemblies]." at the APS March Meeting in San Antonio, TX. * Saturday, Nov. 22 2014: USF and neighboring universities are hosting a [http://predictivestatmech.org/papers/MRI-flyer.pdf Scientific Computing Workshop] for undergraduates. Follow the instructions in the flyer to sign up by Nov. 11! * Thursday, Oct. 16: David M. Rogers presented "[http://predictivestatmech.org/papers/real-poles.pdf Real-space quadrature: A convenient, universal representation for multipole expansions]." at the Southeast Regional Meeting of the ACS in Nashville, TN. * Friday, Aug. 29 2014: Felipe Zapata joins the group * Monday, Aug. 25 2014: USF Autumn Semester First Day of Classes - don't forget to sign up for [[CompSciFall2014|Introduction to Scientific Computing]]! * Monday, Aug. 18 2014: David M. Rogers presented an invited talk "pH Dynamics During Concentration Polarization," to the [http://www.pnnl.gov/computing/cm4/ CM4 Mathematics for Mesoscopic Materials Modeling Group]. * Tuesday, July 8 2014: David M. Rogers presented "What’s Holding Up Multiscale modeling?" at the Telluride, CO workshop for [http://www.telluridescience.org/meetings/workshop-details?wid=404 Ions in Aqueous Solutions and Molecular Biology]. * Friday, May 9 2014: David M. Rogers presented "Jumping from atomistic to continuum simulation of electrochemical driving at interfaces," at the 2014 Florida FAME Conference.[http://www.fame.chem.ufl.edu/computational.html] * January 29th, 2014: David M. Rogers presented "Simulating at the molecular / continuum interface," at the USF Research Computing User's Group Forum [http://www.usf.edu/it/research-computing/featured-researchers/rogersgroup.aspx]. * Monday, Aug. 26 2013: USF Autumn Semester First Day of Classes * Friday, July 12, 2013: Argonne Center for Nanoscale Materials [http://nano.anl.gov/users/call_for_proposals.html Proposal Deadline] * Thursday, July 4, 2013: Independence Day - celebrate by supporting [https://www.eff.org/ EFF] * Thursday, April 11 2013: David M. Rogers presented "Solute Partitioning and Transport through Natural and Biomimetic Membranes," at the 2013 ACS National Meeting. == Calendars == * [http://www.registrar.usf.edu/enroll/regist/calendt.php USF Calendar] 4d4d9c35f8f1bf3fbf9a1a0e27bb1e52adabbab7 600 573 2017-07-03T17:15:56Z David M. Rogers 2 wikitext text/x-wiki * Wednesday, Sept. 27: Family Science Night (more info. soon)! * Thursday, August 31: David M. Rogers presents "Demystifying Nonequilibrium Statistical Mechanics" at the U. Pittsburgh Chemistry Seminar Series. * May 6, 2017: David M. Rogers presents "Quantum Thermodynamics by Repeated Measurement" at the Florida ACS Meeting & Exposition (FAME2017) and Guy W. Dayhoff II presents "Driving Forces in MD Simulations of Transition and `Free' Flows". * Feb. 17, 2017: David M. Rogers presents "Demystifying Nonequilibrium Statistical Mechanics" at the USF Physics Colloquium. * September 14, 2016: David M. Rogers presents "A moment generating function for flows in open quantum systems" at the [http://www.df.unipi.it/~elze/DICE2016.html International Conference for Spacetime, Matter, and Quantum Mechanics]. * July 12-16, 2016: David M. Rogers presents "A Molecular Approach to Dispersion Energy" at the TSRC Workshop on Ions in Solution: Biology, Energy, and Environment. * July 7-8, 2016: David M. Rogers presents "The quantum mechanics of Jaynes" at the LANL Quantum Lunch. * March 13-17, 2016: David M. Rogers presents "The Quantum Andersen Thermostat," at the 2016 ACS Spring Meeting. * Friday, Feb. 12, 2016: David M. Rogers presents "Angle-free methods for boundary element problems on the sphere: The quadrature basis for spherical harmonics," at the USF Mathematics Department Analysis Lecture Series. * Monday, Jan 11, 2016: USF Spring 2016 semester classes begin. * Tuesday, December 15, 2015: David M. Rogers presents "Maximum Transition Entropy - A Causal, Canonical Model for Nonequilibrium Statistical Mechanics," at the 114th Statistical Mechanics Conference at Rutgers, New Brunswick New Jersey. * Monday, September 14, 2015, Invited Presentation, "Understanding the origins of irreversibility: electrical driving and the second law.," Tulane Department of Chemistry. * July 27-30, 2015 Travel to DOE Comp. Sci. Graduate Fellowship Program Review in Arlington, VA. * June, 2015: JCTC Publishes our [http://pubs.acs.org/doi/abs/10.1021/acs.jctc.5b00357 article] on "Dispersion- and Exchange-Corrected Density Functional Theory for Sodium Ion Hydration" * Wednesday, May 13, 2015: David M. Rogers presented "Spatiotemporal Concentration-Polarization Induced pH Changes at Ion-Selective Membranes." at the [https://www.cbdstconference.com/agenda Chemical and Biological Defense Sci. & Tech. conference] in St. Louis, MO. * Friday, May 8, 2015: David M. Rogers presented "Where do Quanta Come From?" at the Florida ACS Meeting and Exhibition ([http://fame2015.fl-acs.org/ataglance.html FAME]). * April, 2015: [http://scitation.aip.org/content/aip/journal/jcp/142/7/10.1063/1.4907404 Real-Space Quadrature paper] was published as a cover article by JCP. * Wednesday, Mar. 4, 2015: David M. Rogers presented "[http://meetings.aps.org/Meeting/MAR15/Session/M44.9 Thermodynamics of Maximum Transition Entropy for Quantum Assemblies]." at the APS March Meeting in San Antonio, TX. * Saturday, Nov. 22 2014: USF and neighboring universities are hosting a [http://predictivestatmech.org/papers/MRI-flyer.pdf Scientific Computing Workshop] for undergraduates. Follow the instructions in the flyer to sign up by Nov. 11! * Thursday, Oct. 16: David M. Rogers presented "[http://predictivestatmech.org/papers/real-poles.pdf Real-space quadrature: A convenient, universal representation for multipole expansions]." at the Southeast Regional Meeting of the ACS in Nashville, TN. * Friday, Aug. 29 2014: Felipe Zapata joins the group * Monday, Aug. 25 2014: USF Autumn Semester First Day of Classes - don't forget to sign up for [[CompSciFall2014|Introduction to Scientific Computing]]! * Monday, Aug. 18 2014: David M. Rogers presented an invited talk "pH Dynamics During Concentration Polarization," to the [http://www.pnnl.gov/computing/cm4/ CM4 Mathematics for Mesoscopic Materials Modeling Group]. * Tuesday, July 8 2014: David M. Rogers presented "What’s Holding Up Multiscale modeling?" at the Telluride, CO workshop for [http://www.telluridescience.org/meetings/workshop-details?wid=404 Ions in Aqueous Solutions and Molecular Biology]. * Friday, May 9 2014: David M. Rogers presented "Jumping from atomistic to continuum simulation of electrochemical driving at interfaces," at the 2014 Florida FAME Conference.[http://www.fame.chem.ufl.edu/computational.html] * January 29th, 2014: David M. Rogers presented "Simulating at the molecular / continuum interface," at the USF Research Computing User's Group Forum [http://www.usf.edu/it/research-computing/featured-researchers/rogersgroup.aspx]. * Monday, Aug. 26 2013: USF Autumn Semester First Day of Classes * Friday, July 12, 2013: Argonne Center for Nanoscale Materials [http://nano.anl.gov/users/call_for_proposals.html Proposal Deadline] * Thursday, July 4, 2013: Independence Day - celebrate by supporting [https://www.eff.org/ EFF] * Thursday, April 11 2013: David M. Rogers presented "Solute Partitioning and Transport through Natural and Biomimetic Membranes," at the 2013 ACS National Meeting. == Calendars == * [http://www.registrar.usf.edu/enroll/regist/calendt.php USF Calendar] c823f8c7dc4b29270b3540bf031e324525558725 601 600 2017-07-03T17:16:35Z David M. Rogers 2 wikitext text/x-wiki * Wednesday, Sept. 27, 2017: Family Science Night (more info. soon)! * Thursday, August 31, 2017: David M. Rogers presents "Demystifying Nonequilibrium Statistical Mechanics" at the U. Pittsburgh Chemistry Seminar Series. * May 6, 2017: David M. Rogers presents "Quantum Thermodynamics by Repeated Measurement" at the Florida ACS Meeting & Exposition (FAME2017) and Guy W. Dayhoff II presents "Driving Forces in MD Simulations of Transition and `Free' Flows". * Feb. 17, 2017: David M. Rogers presents "Demystifying Nonequilibrium Statistical Mechanics" at the USF Physics Colloquium. * September 14, 2016: David M. Rogers presents "A moment generating function for flows in open quantum systems" at the [http://www.df.unipi.it/~elze/DICE2016.html International Conference for Spacetime, Matter, and Quantum Mechanics]. * July 12-16, 2016: David M. Rogers presents "A Molecular Approach to Dispersion Energy" at the TSRC Workshop on Ions in Solution: Biology, Energy, and Environment. * July 7-8, 2016: David M. Rogers presents "The quantum mechanics of Jaynes" at the LANL Quantum Lunch. * March 13-17, 2016: David M. Rogers presents "The Quantum Andersen Thermostat," at the 2016 ACS Spring Meeting. * Friday, Feb. 12, 2016: David M. Rogers presents "Angle-free methods for boundary element problems on the sphere: The quadrature basis for spherical harmonics," at the USF Mathematics Department Analysis Lecture Series. * Monday, Jan 11, 2016: USF Spring 2016 semester classes begin. * Tuesday, December 15, 2015: David M. Rogers presents "Maximum Transition Entropy - A Causal, Canonical Model for Nonequilibrium Statistical Mechanics," at the 114th Statistical Mechanics Conference at Rutgers, New Brunswick New Jersey. * Monday, September 14, 2015, Invited Presentation, "Understanding the origins of irreversibility: electrical driving and the second law.," Tulane Department of Chemistry. * July 27-30, 2015 Travel to DOE Comp. Sci. Graduate Fellowship Program Review in Arlington, VA. * June, 2015: JCTC Publishes our [http://pubs.acs.org/doi/abs/10.1021/acs.jctc.5b00357 article] on "Dispersion- and Exchange-Corrected Density Functional Theory for Sodium Ion Hydration" * Wednesday, May 13, 2015: David M. Rogers presented "Spatiotemporal Concentration-Polarization Induced pH Changes at Ion-Selective Membranes." at the [https://www.cbdstconference.com/agenda Chemical and Biological Defense Sci. & Tech. conference] in St. Louis, MO. * Friday, May 8, 2015: David M. Rogers presented "Where do Quanta Come From?" at the Florida ACS Meeting and Exhibition ([http://fame2015.fl-acs.org/ataglance.html FAME]). * April, 2015: [http://scitation.aip.org/content/aip/journal/jcp/142/7/10.1063/1.4907404 Real-Space Quadrature paper] was published as a cover article by JCP. * Wednesday, Mar. 4, 2015: David M. Rogers presented "[http://meetings.aps.org/Meeting/MAR15/Session/M44.9 Thermodynamics of Maximum Transition Entropy for Quantum Assemblies]." at the APS March Meeting in San Antonio, TX. * Saturday, Nov. 22 2014: USF and neighboring universities are hosting a [http://predictivestatmech.org/papers/MRI-flyer.pdf Scientific Computing Workshop] for undergraduates. Follow the instructions in the flyer to sign up by Nov. 11! * Thursday, Oct. 16: David M. Rogers presented "[http://predictivestatmech.org/papers/real-poles.pdf Real-space quadrature: A convenient, universal representation for multipole expansions]." at the Southeast Regional Meeting of the ACS in Nashville, TN. * Friday, Aug. 29 2014: Felipe Zapata joins the group * Monday, Aug. 25 2014: USF Autumn Semester First Day of Classes - don't forget to sign up for [[CompSciFall2014|Introduction to Scientific Computing]]! * Monday, Aug. 18 2014: David M. Rogers presented an invited talk "pH Dynamics During Concentration Polarization," to the [http://www.pnnl.gov/computing/cm4/ CM4 Mathematics for Mesoscopic Materials Modeling Group]. * Tuesday, July 8 2014: David M. Rogers presented "What’s Holding Up Multiscale modeling?" at the Telluride, CO workshop for [http://www.telluridescience.org/meetings/workshop-details?wid=404 Ions in Aqueous Solutions and Molecular Biology]. * Friday, May 9 2014: David M. Rogers presented "Jumping from atomistic to continuum simulation of electrochemical driving at interfaces," at the 2014 Florida FAME Conference.[http://www.fame.chem.ufl.edu/computational.html] * January 29th, 2014: David M. Rogers presented "Simulating at the molecular / continuum interface," at the USF Research Computing User's Group Forum [http://www.usf.edu/it/research-computing/featured-researchers/rogersgroup.aspx]. * Monday, Aug. 26 2013: USF Autumn Semester First Day of Classes * Friday, July 12, 2013: Argonne Center for Nanoscale Materials [http://nano.anl.gov/users/call_for_proposals.html Proposal Deadline] * Thursday, July 4, 2013: Independence Day - celebrate by supporting [https://www.eff.org/ EFF] * Thursday, April 11 2013: David M. Rogers presented "Solute Partitioning and Transport through Natural and Biomimetic Membranes," at the 2013 ACS National Meeting. == Calendars == * [http://www.registrar.usf.edu/enroll/regist/calendt.php USF Calendar] 7d1fef65ed472f90083831e1e3ca858e0c4763ca 602 601 2017-07-03T17:47:18Z David M. Rogers 2 wikitext text/x-wiki * Wednesday, Sept. 27, 2017: Family Science Night (more info. soon)! * Thursday, August 31, 2017: David M. Rogers presents "Demystifying Nonequilibrium Statistical Mechanics" at the U. Pittsburgh Chemistry Seminar Series. * May 6, 2017: David M. Rogers presents "Quantum Thermodynamics by Repeated Measurement" at the Florida ACS Meeting & Exposition (FAME2017) and Guy W. Dayhoff II presents "Driving Forces in MD Simulations of Transition and `Free' Flows". * March, 2017: David M. Rogers was honored with [http://dx.doi.org/10.1063/1.4978399 JCP's top reviewer award] for 2016! * Feb. 17, 2017: David M. Rogers presents "Demystifying Nonequilibrium Statistical Mechanics" at the USF Physics Colloquium. * September 14, 2016: David M. Rogers presents "A moment generating function for flows in open quantum systems" at the [http://www.df.unipi.it/~elze/DICE2016.html International Conference for Spacetime, Matter, and Quantum Mechanics]. * July 12-16, 2016: David M. Rogers presents "A Molecular Approach to Dispersion Energy" at the TSRC Workshop on Ions in Solution: Biology, Energy, and Environment. * July 7-8, 2016: David M. Rogers presents "The quantum mechanics of Jaynes" at the LANL Quantum Lunch. * March 13-17, 2016: David M. Rogers presents "The Quantum Andersen Thermostat," at the 2016 ACS Spring Meeting. * Friday, Feb. 12, 2016: David M. Rogers presents "Angle-free methods for boundary element problems on the sphere: The quadrature basis for spherical harmonics," at the USF Mathematics Department Analysis Lecture Series. * Monday, Jan 11, 2016: USF Spring 2016 semester classes begin. * Tuesday, December 15, 2015: David M. Rogers presents "Maximum Transition Entropy - A Causal, Canonical Model for Nonequilibrium Statistical Mechanics," at the 114th Statistical Mechanics Conference at Rutgers, New Brunswick New Jersey. * Monday, September 14, 2015, Invited Presentation, "Understanding the origins of irreversibility: electrical driving and the second law.," Tulane Department of Chemistry. * July 27-30, 2015 Travel to DOE Comp. Sci. Graduate Fellowship Program Review in Arlington, VA. * June, 2015: JCTC Publishes our [http://pubs.acs.org/doi/abs/10.1021/acs.jctc.5b00357 article] on "Dispersion- and Exchange-Corrected Density Functional Theory for Sodium Ion Hydration" * Wednesday, May 13, 2015: David M. Rogers presented "Spatiotemporal Concentration-Polarization Induced pH Changes at Ion-Selective Membranes." at the [https://www.cbdstconference.com/agenda Chemical and Biological Defense Sci. & Tech. conference] in St. Louis, MO. * Friday, May 8, 2015: David M. Rogers presented "Where do Quanta Come From?" at the Florida ACS Meeting and Exhibition ([http://fame2015.fl-acs.org/ataglance.html FAME]). * April, 2015: [http://scitation.aip.org/content/aip/journal/jcp/142/7/10.1063/1.4907404 Real-Space Quadrature paper] was published as a cover article by JCP. * Wednesday, Mar. 4, 2015: David M. Rogers presented "[http://meetings.aps.org/Meeting/MAR15/Session/M44.9 Thermodynamics of Maximum Transition Entropy for Quantum Assemblies]." at the APS March Meeting in San Antonio, TX. * Saturday, Nov. 22 2014: USF and neighboring universities are hosting a [http://predictivestatmech.org/papers/MRI-flyer.pdf Scientific Computing Workshop] for undergraduates. Follow the instructions in the flyer to sign up by Nov. 11! * Thursday, Oct. 16: David M. Rogers presented "[http://predictivestatmech.org/papers/real-poles.pdf Real-space quadrature: A convenient, universal representation for multipole expansions]." at the Southeast Regional Meeting of the ACS in Nashville, TN. * Friday, Aug. 29 2014: Felipe Zapata joins the group * Monday, Aug. 25 2014: USF Autumn Semester First Day of Classes - don't forget to sign up for [[CompSciFall2014|Introduction to Scientific Computing]]! * Monday, Aug. 18 2014: David M. Rogers presented an invited talk "pH Dynamics During Concentration Polarization," to the [http://www.pnnl.gov/computing/cm4/ CM4 Mathematics for Mesoscopic Materials Modeling Group]. * Tuesday, July 8 2014: David M. Rogers presented "What’s Holding Up Multiscale modeling?" at the Telluride, CO workshop for [http://www.telluridescience.org/meetings/workshop-details?wid=404 Ions in Aqueous Solutions and Molecular Biology]. * Friday, May 9 2014: David M. Rogers presented "Jumping from atomistic to continuum simulation of electrochemical driving at interfaces," at the 2014 Florida FAME Conference.[http://www.fame.chem.ufl.edu/computational.html] * January 29th, 2014: David M. Rogers presented "Simulating at the molecular / continuum interface," at the USF Research Computing User's Group Forum [http://www.usf.edu/it/research-computing/featured-researchers/rogersgroup.aspx]. * Monday, Aug. 26 2013: USF Autumn Semester First Day of Classes * Friday, July 12, 2013: Argonne Center for Nanoscale Materials [http://nano.anl.gov/users/call_for_proposals.html Proposal Deadline] * Thursday, July 4, 2013: Independence Day - celebrate by supporting [https://www.eff.org/ EFF] * Thursday, April 11 2013: David M. Rogers presented "Solute Partitioning and Transport through Natural and Biomimetic Membranes," at the 2013 ACS National Meeting. == Calendars == * [http://www.registrar.usf.edu/enroll/regist/calendt.php USF Calendar] bf3c29ea215c7c4b9f50cc0eef2f65270d9bca29 Publications 0 8 574 524 2017-03-02T16:34:12Z David M. Rogers 2 wikitext text/x-wiki {| cellpadding="4" style="border: 1px solid darkgray;" |- style="border: 1px solid darkgray;" || David M. Rogers, "Einstein-Podolsky-Rosen paradox implies a minimum achievable temperature." [http://journals.aps.org/pre/abstract/10.1103/PhysRevE.95.012149 Phys. Rev. E 95, 012149, 2017.] This paper provides measurement-based definitions of heat and work that can be realized in current laboratory setups. The first and second laws are proved despite the fact that temperature is treated completely as as a property of the interacting reservoir. Measurements of the work are subject to the famous EPR paradox because the work exchanged between two quantum systems is not defined until a measurement is performed. Based on this, we show that even an environment at absolute zero cannot lower a system's temperature below a minimum characteristic of the way the environment is coupled to the system. |- style="border: 1px solid darkgray;" || Guy W. Dayhoff II and David M. Rogers, "Driving forces in MD simulations of transition and ‘Free’ flows." [http://dx.doi.org/10.1080/08927022.2016.1273524 Mol. Sim. 43(5-6), pp. 467-477, 2017.] (special issue on Surface Chemistry) We set out to test the Joule-Thomson analysis of thermodynamics of porous flow for gasses through a nanopore and found that while local equilibrium is established in the steady-state, finite-size effects cause heat flow opposite the flow direction that violates the assumption of an adiabatic porous plug. |- style="border: 1px solid darkgray;" || David M. Rogers, "Efficient Primitives for Standard Tensor Linear Algebra." [https://doi.org/10.1145/2949550.2949580 Proc. XSEDE16 Conference on Diversity, Big Data, and Science at Scale, no. 14, 2016.] This paper introduces 3 basic functions that generalize BLAS to tensors and presents a code generation strategy for their efficient execution on GPUs that achieves peak performance on the same order of magnitude as for traditional, vendor-optimized matrix-multiplications. |- style="border: 1px solid darkgray;" || David M. Rogers, "Overcoming the Minimum Image Constraint Using the Closest Point Search." [http://dx.doi.org/10.1016/j.jmgm.2016.07.004 J. Mol. Graph. Model 68, pp. 197–205, 2016.] An elegant solution to the problem of finding periodic images in non-rectangular lattices is provided based on the closest vector problem. Related code is here: [https://github.com/frobnitzem/pbctools] |- style="border: 1px solid darkgray;" || Elisa La Bauve, Briana C. Vernon, Dongmei Ye, David M. Rogers, Cathryn M. Siegrist, Bryan Carson. Susan L. Rempe, Aihua Zheng, Margaret C. Kielian, Andrew P. Shreve, and Michael S. Kent. "Method for measuring the unbinding energy of strongly-bound membrane-associated proteins." [http://dx.doi.org/10.1016/j.bbamem.2016.07.004 BBA Biomembranes in press, 2016.] This paper gives multiple experimental measurements of binding energy between the Dengue virus envelope protein and host membranes that largely confirm our computational predictions from 2015. I contributed all the theory for terminal velocity during sedimentation, along with a novel kinetic analysis providing the free energy and enthalpy of the dissociation barrier (all the details are at the end of the appendix). |- style="border: 1px solid darkgray;" || David M. Rogers. "Thermodynamics of Maximum Transition Entropy for Quantum Assemblies." [http://arxiv.org/abs/1503.01232 arXiv:1503.01232 submitted, 2016]. The work presents a new, general, theoretical foundation for the dynamics of open quantum systems modeled on the maximum entropy derivation of equilibrium statistical mechanics. Computational results are presented for three detailed systems to validate and reinforce the theory. It represents a significant advancement for the field, as it lucidly connects the dynamics of a single wavefunction plus environmental noise to the Caldeira-Leggett model for density matrices. |- style="border: 1px solid darkgray;" || Andriy Anishkin, Juan M. Vanegas, David M. Rogers, Philip L. Lorenzi, Wai Kin Chan, Preeti Purwaha, John N. Weinstein, Sergei Sukharev, and Susan B. Rempe. "Catalytic Role of the Substrate Defines Specificity of Therapeutic L-Asparaginase." [http://dx.doi.org/10.1016/j.jmb.2015.06.017 J. Mol. Biol. 427:2867-2885, 2015]. We present an explanation for the (until now controversial) catalytic mechanism of type 2 bacterial L-asparaginase enzymes. By using the carboxylic acid of the substrate (asparagine) as the proton acceptor, this enzyme is able to preferentially carry out deamidation on asparagine more quickly than for the competing substrate, glutamine. The hypothesis, re-discovered from our MD simulations, was first put forward years ago in contested experimental studies, and now finds additional support from our MD and QM calculations. |- style="border: 1px solid darkgray;" || David M. Rogers. "Towards a Direct, By-Need Evaluator for Dependently Typed Languages." [http://arxiv.org/abs/1509.07036 arXiv:1509.07036 submitted, 2015]. This paper describes the implementation of a new interpreted language for distributed parallel computing. It achieves its goal by maintaining pure functional semantics, allowing all terms in the language to be partially evaluated and serialized to network storage at any point during computation. |- style="border: 1px solid darkgray;" || Marielle Soniat, David M. Rogers, and Susan Rempe. "Dispersion- and Exchange-Corrected Density Functional Theory for Sodium Ion Hydration." [http://pubs.acs.org/doi/abs/10.1021/acs.jctc.5b00357 J. Chem. Theory. Comput. 142:074101, 2015]. We studied the influence of dispersion energy corrections on the free energy of formation for sodium-water clusters computed with DFT and wound up discovering that dispersion and split-range exchange functionals can somewhat counter-balance each other. The charged sodium ion pulls on the water's electrons, clearly showing which density functionals over-polarize compared to CCSD. Split-range exchange can reduce this over-polarization, but results in reduced electrostatic interaction. Dispersion can lower the binding energy again to counter-balance. So, functionals fit to experimental formation energies need both effects to avoid lowering energies by over-polarizing. |- style="border: 1px solid darkgray;" || David M. Rogers. "Real-space quadrature: a convenient, efficient representation for multipole expansions." [http://dx.doi.org/10.1063/1.4907404 J. Chem. Phys. 142:074101, 2015]. ([http://predictivestatmech.org/papers/real-poles.pdf Presentation]) I introduce sets of point charges that are able to simultaneously reproduce all multipole (spherical harmonic) expansions up to arbitrary order. The number of points is space-optimal. Translations are described from the usual harmonics and from Cartesian moments (dipole, quadrupole, etc.) on supersymmetric tensors to directional moments using the point weight distribution. Many applications are possible, including trivial implementation of multipoles in molecular mechanics and representing probability distributions over rotation space. |- style="border: 1px solid darkgray;" || David M. Rogers, Michael S. Kent, and Susan B. Rempe, "Molecular basis of endosomal-membrane association for the dengue virus envelope protein." [http://dx.doi.org/10.1016/j.bbamem.2014.12.018 BBA Biomembranes 1848(4):1041-52, 2015.] A fully atomistic potential of mean force for association of the viral envelope protein from Dengue virus was compared to a Poisson-Boltzmann electrostatic plus dispersion model. The results are consistent, showing hope for this type of combined scale simulation. |- style="border: 1px solid darkgray;" || Yaqin Fu, Binsong Li, Ying-Bing Jiang, Darren R. Dunphy, Andy Tsai, Siu-Yue Tam, Hongyou Fan, Hongxia Zhan, David Rogers, Susan Rempe, Plamen Atanassov, Joseph L. Cecchi, and C. Jeffrey Brinker "Atomic Layer Deposition of L-Alanine Polypeptide." [http://pubs.acs.org/doi/abs/10.1021/ja5043403 JACS 136(45):15821–4, 2014.] This paper with our experimental collaborators carried out blocked peptide synthesis by vapor-depositing Boc-L-alanine to create a uniform thin film of polypeptides grown on a silica substrate activated by aminopropyltrimethoxysilane. |- style="border: 1px solid darkgray;" || David M. Rogers. "Silmaril, A Functional Language for Distributed Parallel Evaluation." [http://predictivestatmech.org/sil/papers/sil.pdf Submitted version] |- style="border: 1px solid darkgray;" || Mathias B. Andersen, David M. Rogers, Junyu Mai, Benjamin Schudel, Anson V. Hatch, Susan B. Rempe and Ali Mani. "Spatiotemporal pH dynamics in concentration polarization near ion-selective membranes." [http://dx.doi.org/10.1021/la5014297 Langmuir, 30(26):7902–7912, 2014] |- style="border: 1px solid darkgray;" || W. K. Chan, P. L. Lorenzi, A. Anishkin, P. Purwaha, D. M. Rogers, S. Sukharev, S.B. Rempe, and J. N. Weinstein. "The glutaminase activity of l-asparaginase is not required for anticancer activity against ASNS-negative cells." [http://dx.doi.org/10.1182/blood-2013-10-535112 Blood. 123(23):3596-606, 2014]. |- style="border: 1px solid darkgray;" || David M. Rogers, Dian Jiao, Lawrence Pratt, and Susan B. Rempe. "Structural Models and Molecular Thermodynamics of Hydration of Ions and Small Molecules" [http://dx.doi.org/10.1016/B978-0-444-59440-2.00004-1 Annu. Rep. Comp. Chem. 8:71–127, 2012.] |- style="border: 1px solid darkgray;" || David M. Rogers and Susan B. Rempe. "Irreversible Thermodynamics." [http://dx.doi.org/10.1088/1742-6596/402/1/012014 J. Phys.: Conf. Ser. 402:012014, 2012]. |- style="border: 1px solid darkgray;" || David M. Rogers, Thomas L. Beck, and Susan B. Rempe. [[Media:Dmroge_InfoNonequ2011.pdf|"An Information Theory Approach to Nonlinear, Nonequilibrium Thermodynamics."]] [http://dx.doi.org/10.1007/s10955-011-0358-9 J. Stat. Phys. 145(2):385-409, 2011] We show how the interpretation of thermodynamic states as representing system information leads naturally to thermodynamic cycles and the first and second laws of thermodynamics as well as similar formulations for nontrivial nonequilibrium problems. The logical development of the theory also leads naturally to correct indistinguishability factors in the partition function. |- style="border: 1px solid darkgray;" || Sameer Varma, David M. Rogers, Lawrence R. Pratt, and Susan B. Rempe. "Perspectives on Ion Selectivity: Design Principles for K+ Selectivity in Membrane Transport." [http://jgp.rupress.org/content/137/6/479.full J. Gen. Physiol., 137(6):479-488, 2011.] We review the development of models for understanding the physical basis of selectivity for K+ ions over Na+, its sibling only one row behind, in membrane channels and transporters. Although the problem is subtle because of the morass of competing effects, we emphasize work analyzing the systematic influence of the environment on tipping local binding site structure toward selective configurations. |- style="border: 1px solid darkgray;" || David M. Rogers and Susan B. Rempe. [http://www.ncbi.nlm.nih.gov/pmc/articles/PMC3443978/ “Probing the Thermodynamics of Competitive Ion Binding Using Minimum Energy Structures.”] [http://dx.doi.org/10.1021/jp2012864 J. Phys. Chem. B, 115(29):9116-29, 2011]. We presented an extension of the Quasi-Chemical theory for quantifying the impact of local structure on ion complexation thermodynamics. The theory can be simply represented using a set of thermodynamic cycles involving binding site structural and compositional states as reaction intermediates. |- style="border: 1px solid darkgray;" || Susan B. Rempe and David M. Rogers; et. al. “Computational and experimental platform for understanding and optimizing water flux and salt rejection in nanoporous membranes.” [http://prod.sandia.gov/techlib/access-control.cgi/2010/106735.pdf Sandia Technical Report, SAND2010-6735, 2010.] We summarize work on designing polymer coatings for salt exclusion in water transporting nanopores. In this work, I collected available molecular dynamics results for these systems and performed a novel energy efficiency analysis able to relate atomistic and experimental scales as well as identify important design goals and chemical principles for material performance. |- style="border: 1px solid darkgray;" || David M. Rogers, [http://rave.ohiolink.edu/etdc/view?acc_num=ucin1251832030 ''''Using Bayes' Theorem for Free Energy Calculations''''], 2009. We investigated the central quantity of free energies in a Bayesian context and provide estimators for solvation free energies as well as optimal potential of mean force approximations to model polymer coarse-grained dynamics from atomistic simulations. |- style="border: 1px solid darkgray;" || Zhen Zhao, David M. Rogers and Thomas L. Beck. "Polarization and Charge Transfer in the Hydration of Chloride Ions." [http://link.aip.org/link/?JCP/132/014502/1 J. Chem. Phys., 132:014502, 2010.] Dr. Zhao's ab-initio analysis of the charge distribution in water-ion clusters highlighted the importance of many-body water-water interactions and charge transfer effects in determining cluster structural and energetic properties. These are still challenging to represent in modern polarizable forcefields and have implications for anion properties at interfaces. |- style="border: 1px solid darkgray;" || David M. Rogers and Thomas L. Beck. "Quasi-Chemical and Structural Analysis of Polarizable Anion Hydration." [http://link.aip.org/link/?JCP/132/014505/1 J. Chem. Phys., 132:014505, 2010.] The role of polarizability in forcefield-based models of ions and water was examined. Utilizing some of our recent developments on quasi-chemical theory, we have been able to quantify the tightened, asymmetric nature of the ion's local solvation waters induced by increased polarizability as well as the exact effects of polarization on the solvation free energy. The results suggest some potential problems and diagnostics for such models. |- style="border: 1px solid darkgray;" || David M. Rogers and Thomas L. Beck. [http://forcesolve.sourceforge.net/ Force Solve] (Sourceforge, Chicago IL, 2008). This force matching software implements and tests coarse-graining for general molecular systems in a mere 4000 lines of code. It is able to parametrize coarse Hamiltonians from atomic trajectory data given arbitrary definitions of coarse united-atom type models as well as carry out short Langevin Dynamics simulations on the coarse scale. The program's main drawbacks are its slow speed and high memory usage due to its simplistic design, attributable to the interpreted nature of python. |- style="border: 1px solid darkgray;" || David M. Rogers and Thomas L. Beck. "Resolution and Scale Independent Nonparametric Function Matching Using a String Energy Penalized Spline Prior." 2008. [http://arxiv.org/abs/1003.4741 arXiv:1003.4741v1] (stat.ML). Fresh insight is provided into long-standing mathematical issues surrounding computational modeling of continuous functions from a few sampled data points. The present research lays the groundwork for predicting the behavior of complicated many-body systems using advanced regression techniques. |} 98e0ae40db9695597a56784e9c4df7b79e13374d 575 574 2017-03-02T16:35:36Z David M. Rogers 2 wikitext text/x-wiki {| cellpadding="4" style="border: 1px solid darkgray;" |- style="border: 1px solid darkgray;" || David M. Rogers, "Einstein-Podolsky-Rosen paradox implies a minimum achievable temperature." [http://journals.aps.org/pre/abstract/10.1103/PhysRevE.95.012149 Phys. Rev. E 95, 012149, 2017.] This paper provides measurement-based definitions of heat and work that can be realized in current laboratory setups. The first and second laws are proved despite the fact that temperature is treated completely as as a property of the interacting reservoir. Measurements of the work are subject to the famous EPR paradox because the work exchanged between two quantum systems is not defined until a measurement is performed. Based on this, we show that even an environment at absolute zero cannot lower a system's temperature below a minimum characteristic of the way the environment is coupled to the system. |- style="border: 1px solid darkgray;" || Guy W. Dayhoff II and David M. Rogers, "Driving forces in MD simulations of transition and ‘Free’ flows." [http://dx.doi.org/10.1080/08927022.2016.1273524 Mol. Sim. 43(5-6), pp. 467-477, 2017.] (special issue on Surface Chemistry) We set out to test the Joule-Thomson analysis of thermodynamics of porous flow for gasses through a nanopore and found that while local equilibrium is established in the steady-state, finite-size effects cause heat flow opposite the flow direction that violates the assumption of an adiabatic porous plug. |- style="border: 1px solid darkgray;" || David M. Rogers, "Efficient Primitives for Standard Tensor Linear Algebra." [https://doi.org/10.1145/2949550.2949580 Proc. XSEDE16 Conference on Diversity, Big Data, and Science at Scale, no. 14, 2016.] This paper introduces 3 basic functions that generalize BLAS to tensors and presents a code generation strategy for their efficient execution on GPUs that achieves peak performance on the same order of magnitude as for traditional, vendor-optimized matrix-multiplications. |- style="border: 1px solid darkgray;" || David M. Rogers, "Overcoming the Minimum Image Constraint Using the Closest Point Search." [http://dx.doi.org/10.1016/j.jmgm.2016.07.004 J. Mol. Graph. Model 68, pp. 197–205, 2016.] An elegant solution to the problem of finding periodic images in non-rectangular lattices is provided based on the closest vector problem. Related code is here: [https://github.com/frobnitzem/pbctools] |- style="border: 1px solid darkgray;" || Elisa La Bauve, Briana C. Vernon, Dongmei Ye, David M. Rogers, Cathryn M. Siegrist, Bryan Carson. Susan L. Rempe, Aihua Zheng, Margaret C. Kielian, Andrew P. Shreve, and Michael S. Kent. "Method for measuring the unbinding energy of strongly-bound membrane-associated proteins." [http://dx.doi.org/10.1016/j.bbamem.2016.07.004 BBA Biomembranes 1858(11): 2753–62, 2016.] This paper gives multiple experimental measurements of binding energy between the Dengue virus envelope protein and host membranes that largely confirm our computational predictions from 2015. I contributed all the theory for terminal velocity during sedimentation, along with a novel kinetic analysis providing the free energy and enthalpy of the dissociation barrier (all the details are at the end of the appendix). |- style="border: 1px solid darkgray;" || David M. Rogers. "Thermodynamics of Maximum Transition Entropy for Quantum Assemblies." [http://arxiv.org/abs/1503.01232 arXiv:1503.01232 submitted, 2016]. The work presents a new, general, theoretical foundation for the dynamics of open quantum systems modeled on the maximum entropy derivation of equilibrium statistical mechanics. Computational results are presented for three detailed systems to validate and reinforce the theory. It represents a significant advancement for the field, as it lucidly connects the dynamics of a single wavefunction plus environmental noise to the Caldeira-Leggett model for density matrices. |- style="border: 1px solid darkgray;" || Andriy Anishkin, Juan M. Vanegas, David M. Rogers, Philip L. Lorenzi, Wai Kin Chan, Preeti Purwaha, John N. Weinstein, Sergei Sukharev, and Susan B. Rempe. "Catalytic Role of the Substrate Defines Specificity of Therapeutic L-Asparaginase." [http://dx.doi.org/10.1016/j.jmb.2015.06.017 J. Mol. Biol. 427:2867-2885, 2015]. We present an explanation for the (until now controversial) catalytic mechanism of type 2 bacterial L-asparaginase enzymes. By using the carboxylic acid of the substrate (asparagine) as the proton acceptor, this enzyme is able to preferentially carry out deamidation on asparagine more quickly than for the competing substrate, glutamine. The hypothesis, re-discovered from our MD simulations, was first put forward years ago in contested experimental studies, and now finds additional support from our MD and QM calculations. |- style="border: 1px solid darkgray;" || David M. Rogers. "Towards a Direct, By-Need Evaluator for Dependently Typed Languages." [http://arxiv.org/abs/1509.07036 arXiv:1509.07036 submitted, 2015]. This paper describes the implementation of a new interpreted language for distributed parallel computing. It achieves its goal by maintaining pure functional semantics, allowing all terms in the language to be partially evaluated and serialized to network storage at any point during computation. |- style="border: 1px solid darkgray;" || Marielle Soniat, David M. Rogers, and Susan Rempe. "Dispersion- and Exchange-Corrected Density Functional Theory for Sodium Ion Hydration." [http://pubs.acs.org/doi/abs/10.1021/acs.jctc.5b00357 J. Chem. Theory. Comput. 142:074101, 2015]. We studied the influence of dispersion energy corrections on the free energy of formation for sodium-water clusters computed with DFT and wound up discovering that dispersion and split-range exchange functionals can somewhat counter-balance each other. The charged sodium ion pulls on the water's electrons, clearly showing which density functionals over-polarize compared to CCSD. Split-range exchange can reduce this over-polarization, but results in reduced electrostatic interaction. Dispersion can lower the binding energy again to counter-balance. So, functionals fit to experimental formation energies need both effects to avoid lowering energies by over-polarizing. |- style="border: 1px solid darkgray;" || David M. Rogers. "Real-space quadrature: a convenient, efficient representation for multipole expansions." [http://dx.doi.org/10.1063/1.4907404 J. Chem. Phys. 142:074101, 2015]. ([http://predictivestatmech.org/papers/real-poles.pdf Presentation]) I introduce sets of point charges that are able to simultaneously reproduce all multipole (spherical harmonic) expansions up to arbitrary order. The number of points is space-optimal. Translations are described from the usual harmonics and from Cartesian moments (dipole, quadrupole, etc.) on supersymmetric tensors to directional moments using the point weight distribution. Many applications are possible, including trivial implementation of multipoles in molecular mechanics and representing probability distributions over rotation space. |- style="border: 1px solid darkgray;" || David M. Rogers, Michael S. Kent, and Susan B. Rempe, "Molecular basis of endosomal-membrane association for the dengue virus envelope protein." [http://dx.doi.org/10.1016/j.bbamem.2014.12.018 BBA Biomembranes 1848(4):1041-52, 2015.] A fully atomistic potential of mean force for association of the viral envelope protein from Dengue virus was compared to a Poisson-Boltzmann electrostatic plus dispersion model. The results are consistent, showing hope for this type of combined scale simulation. |- style="border: 1px solid darkgray;" || Yaqin Fu, Binsong Li, Ying-Bing Jiang, Darren R. Dunphy, Andy Tsai, Siu-Yue Tam, Hongyou Fan, Hongxia Zhan, David Rogers, Susan Rempe, Plamen Atanassov, Joseph L. Cecchi, and C. Jeffrey Brinker "Atomic Layer Deposition of L-Alanine Polypeptide." [http://pubs.acs.org/doi/abs/10.1021/ja5043403 JACS 136(45):15821–4, 2014.] This paper with our experimental collaborators carried out blocked peptide synthesis by vapor-depositing Boc-L-alanine to create a uniform thin film of polypeptides grown on a silica substrate activated by aminopropyltrimethoxysilane. |- style="border: 1px solid darkgray;" || David M. Rogers. "Silmaril, A Functional Language for Distributed Parallel Evaluation." [http://predictivestatmech.org/sil/papers/sil.pdf Submitted version] |- style="border: 1px solid darkgray;" || Mathias B. Andersen, David M. Rogers, Junyu Mai, Benjamin Schudel, Anson V. Hatch, Susan B. Rempe and Ali Mani. "Spatiotemporal pH dynamics in concentration polarization near ion-selective membranes." [http://dx.doi.org/10.1021/la5014297 Langmuir, 30(26):7902–7912, 2014] |- style="border: 1px solid darkgray;" || W. K. Chan, P. L. Lorenzi, A. Anishkin, P. Purwaha, D. M. Rogers, S. Sukharev, S.B. Rempe, and J. N. Weinstein. "The glutaminase activity of l-asparaginase is not required for anticancer activity against ASNS-negative cells." [http://dx.doi.org/10.1182/blood-2013-10-535112 Blood. 123(23):3596-606, 2014]. |- style="border: 1px solid darkgray;" || David M. Rogers, Dian Jiao, Lawrence Pratt, and Susan B. Rempe. "Structural Models and Molecular Thermodynamics of Hydration of Ions and Small Molecules" [http://dx.doi.org/10.1016/B978-0-444-59440-2.00004-1 Annu. Rep. Comp. Chem. 8:71–127, 2012.] |- style="border: 1px solid darkgray;" || David M. Rogers and Susan B. Rempe. "Irreversible Thermodynamics." [http://dx.doi.org/10.1088/1742-6596/402/1/012014 J. Phys.: Conf. Ser. 402:012014, 2012]. |- style="border: 1px solid darkgray;" || David M. Rogers, Thomas L. Beck, and Susan B. Rempe. [[Media:Dmroge_InfoNonequ2011.pdf|"An Information Theory Approach to Nonlinear, Nonequilibrium Thermodynamics."]] [http://dx.doi.org/10.1007/s10955-011-0358-9 J. Stat. Phys. 145(2):385-409, 2011] We show how the interpretation of thermodynamic states as representing system information leads naturally to thermodynamic cycles and the first and second laws of thermodynamics as well as similar formulations for nontrivial nonequilibrium problems. The logical development of the theory also leads naturally to correct indistinguishability factors in the partition function. |- style="border: 1px solid darkgray;" || Sameer Varma, David M. Rogers, Lawrence R. Pratt, and Susan B. Rempe. "Perspectives on Ion Selectivity: Design Principles for K+ Selectivity in Membrane Transport." [http://jgp.rupress.org/content/137/6/479.full J. Gen. Physiol., 137(6):479-488, 2011.] We review the development of models for understanding the physical basis of selectivity for K+ ions over Na+, its sibling only one row behind, in membrane channels and transporters. Although the problem is subtle because of the morass of competing effects, we emphasize work analyzing the systematic influence of the environment on tipping local binding site structure toward selective configurations. |- style="border: 1px solid darkgray;" || David M. Rogers and Susan B. Rempe. [http://www.ncbi.nlm.nih.gov/pmc/articles/PMC3443978/ “Probing the Thermodynamics of Competitive Ion Binding Using Minimum Energy Structures.”] [http://dx.doi.org/10.1021/jp2012864 J. Phys. Chem. B, 115(29):9116-29, 2011]. We presented an extension of the Quasi-Chemical theory for quantifying the impact of local structure on ion complexation thermodynamics. The theory can be simply represented using a set of thermodynamic cycles involving binding site structural and compositional states as reaction intermediates. |- style="border: 1px solid darkgray;" || Susan B. Rempe and David M. Rogers; et. al. “Computational and experimental platform for understanding and optimizing water flux and salt rejection in nanoporous membranes.” [http://prod.sandia.gov/techlib/access-control.cgi/2010/106735.pdf Sandia Technical Report, SAND2010-6735, 2010.] We summarize work on designing polymer coatings for salt exclusion in water transporting nanopores. In this work, I collected available molecular dynamics results for these systems and performed a novel energy efficiency analysis able to relate atomistic and experimental scales as well as identify important design goals and chemical principles for material performance. |- style="border: 1px solid darkgray;" || David M. Rogers, [http://rave.ohiolink.edu/etdc/view?acc_num=ucin1251832030 ''''Using Bayes' Theorem for Free Energy Calculations''''], 2009. We investigated the central quantity of free energies in a Bayesian context and provide estimators for solvation free energies as well as optimal potential of mean force approximations to model polymer coarse-grained dynamics from atomistic simulations. |- style="border: 1px solid darkgray;" || Zhen Zhao, David M. Rogers and Thomas L. Beck. "Polarization and Charge Transfer in the Hydration of Chloride Ions." [http://link.aip.org/link/?JCP/132/014502/1 J. Chem. Phys., 132:014502, 2010.] Dr. Zhao's ab-initio analysis of the charge distribution in water-ion clusters highlighted the importance of many-body water-water interactions and charge transfer effects in determining cluster structural and energetic properties. These are still challenging to represent in modern polarizable forcefields and have implications for anion properties at interfaces. |- style="border: 1px solid darkgray;" || David M. Rogers and Thomas L. Beck. "Quasi-Chemical and Structural Analysis of Polarizable Anion Hydration." [http://link.aip.org/link/?JCP/132/014505/1 J. Chem. Phys., 132:014505, 2010.] The role of polarizability in forcefield-based models of ions and water was examined. Utilizing some of our recent developments on quasi-chemical theory, we have been able to quantify the tightened, asymmetric nature of the ion's local solvation waters induced by increased polarizability as well as the exact effects of polarization on the solvation free energy. The results suggest some potential problems and diagnostics for such models. |- style="border: 1px solid darkgray;" || David M. Rogers and Thomas L. Beck. [http://forcesolve.sourceforge.net/ Force Solve] (Sourceforge, Chicago IL, 2008). This force matching software implements and tests coarse-graining for general molecular systems in a mere 4000 lines of code. It is able to parametrize coarse Hamiltonians from atomic trajectory data given arbitrary definitions of coarse united-atom type models as well as carry out short Langevin Dynamics simulations on the coarse scale. The program's main drawbacks are its slow speed and high memory usage due to its simplistic design, attributable to the interpreted nature of python. |- style="border: 1px solid darkgray;" || David M. Rogers and Thomas L. Beck. "Resolution and Scale Independent Nonparametric Function Matching Using a String Energy Penalized Spline Prior." 2008. [http://arxiv.org/abs/1003.4741 arXiv:1003.4741v1] (stat.ML). Fresh insight is provided into long-standing mathematical issues surrounding computational modeling of continuous functions from a few sampled data points. The present research lays the groundwork for predicting the behavior of complicated many-body systems using advanced regression techniques. |} 1f9773412bcd56841a03e81fed4663b5c0bba022 599 575 2017-06-09T20:08:02Z David M. Rogers 2 wikitext text/x-wiki {| cellpadding="4" style="border: 1px solid darkgray;" |- style="border: 1px solid darkgray;" || David M. Rogers, "An information theory model for dissipation in open quantum systems." J. Phys., Conference Series, 2017 in press. This paper presents a new, simple ansatz for adding dissipation to arbitrary stochastic forcing of a quantum dynamical system. For Gaussian random forces, it predicts a Lindblad equation identical to the Caldeira-Leggett model up to order <math>\beta^2</math>, where the same term is present with a different prefactor. The system-centric, phase space picture here shows that the <math>\beta^2</math> term represents a quantum confinement effect. |- style="border: 1px solid darkgray;" || David M. Rogers, "Einstein-Podolsky-Rosen paradox implies a minimum achievable temperature." [http://journals.aps.org/pre/abstract/10.1103/PhysRevE.95.012149 Phys. Rev. E 95, 012149, 2017.] This paper provides measurement-based definitions of heat and work that can be realized in current laboratory setups. The first and second laws are proved despite the fact that temperature is treated completely as as a property of the interacting reservoir. Measurements of the work are subject to the famous EPR paradox because the work exchanged between two quantum systems is not defined until a measurement is performed. Based on this, we show that even an environment at absolute zero cannot lower a system's temperature below a minimum characteristic of the way the environment is coupled to the system. |- style="border: 1px solid darkgray;" || Guy W. Dayhoff II and David M. Rogers, "Driving forces in MD simulations of transition and ‘Free’ flows." [http://dx.doi.org/10.1080/08927022.2016.1273524 Mol. Sim. 43(5-6), pp. 467-477, 2017.] (special issue on Surface Chemistry) We set out to test the Joule-Thomson analysis of thermodynamics of porous flow for gasses through a nanopore and found that while local equilibrium is established in the steady-state, finite-size effects cause heat flow opposite the flow direction that violates the assumption of an adiabatic porous plug. |- style="border: 1px solid darkgray;" || David M. Rogers, "Efficient Primitives for Standard Tensor Linear Algebra." [https://doi.org/10.1145/2949550.2949580 Proc. XSEDE16 Conference on Diversity, Big Data, and Science at Scale, no. 14, 2016.] This paper introduces 3 basic functions that generalize BLAS to tensors and presents a code generation strategy for their efficient execution on GPUs that achieves peak performance on the same order of magnitude as for traditional, vendor-optimized matrix-multiplications. |- style="border: 1px solid darkgray;" || David M. Rogers, "Overcoming the Minimum Image Constraint Using the Closest Point Search." [http://dx.doi.org/10.1016/j.jmgm.2016.07.004 J. Mol. Graph. Model 68, pp. 197–205, 2016.] An elegant solution to the problem of finding periodic images in non-rectangular lattices is provided based on the closest vector problem. Related code is here: [https://github.com/frobnitzem/pbctools] |- style="border: 1px solid darkgray;" || Elisa La Bauve, Briana C. Vernon, Dongmei Ye, David M. Rogers, Cathryn M. Siegrist, Bryan Carson. Susan L. Rempe, Aihua Zheng, Margaret C. Kielian, Andrew P. Shreve, and Michael S. Kent. "Method for measuring the unbinding energy of strongly-bound membrane-associated proteins." [http://dx.doi.org/10.1016/j.bbamem.2016.07.004 BBA Biomembranes 1858(11): 2753–62, 2016.] This paper gives multiple experimental measurements of binding energy between the Dengue virus envelope protein and host membranes that largely confirm our computational predictions from 2015. I contributed all the theory for terminal velocity during sedimentation, along with a novel kinetic analysis providing the free energy and enthalpy of the dissociation barrier (all the details are at the end of the appendix). |- style="border: 1px solid darkgray;" || David M. Rogers. "Thermodynamics of Maximum Transition Entropy for Quantum Assemblies." [http://arxiv.org/abs/1503.01232 arXiv:1503.01232 submitted, 2016]. The work presents a new, general, theoretical foundation for the dynamics of open quantum systems modeled on the maximum entropy derivation of equilibrium statistical mechanics. Computational results are presented for three detailed systems to validate and reinforce the theory. It represents a significant advancement for the field, as it lucidly connects the dynamics of a single wavefunction plus environmental noise to the Caldeira-Leggett model for density matrices. |- style="border: 1px solid darkgray;" || Andriy Anishkin, Juan M. Vanegas, David M. Rogers, Philip L. Lorenzi, Wai Kin Chan, Preeti Purwaha, John N. Weinstein, Sergei Sukharev, and Susan B. Rempe. "Catalytic Role of the Substrate Defines Specificity of Therapeutic L-Asparaginase." [http://dx.doi.org/10.1016/j.jmb.2015.06.017 J. Mol. Biol. 427:2867-2885, 2015]. We present an explanation for the (until now controversial) catalytic mechanism of type 2 bacterial L-asparaginase enzymes. By using the carboxylic acid of the substrate (asparagine) as the proton acceptor, this enzyme is able to preferentially carry out deamidation on asparagine more quickly than for the competing substrate, glutamine. The hypothesis, re-discovered from our MD simulations, was first put forward years ago in contested experimental studies, and now finds additional support from our MD and QM calculations. |- style="border: 1px solid darkgray;" || David M. Rogers. "Towards a Direct, By-Need Evaluator for Dependently Typed Languages." [http://arxiv.org/abs/1509.07036 arXiv:1509.07036 submitted, 2015]. This paper describes the implementation of a new interpreted language for distributed parallel computing. It achieves its goal by maintaining pure functional semantics, allowing all terms in the language to be partially evaluated and serialized to network storage at any point during computation. |- style="border: 1px solid darkgray;" || Marielle Soniat, David M. Rogers, and Susan Rempe. "Dispersion- and Exchange-Corrected Density Functional Theory for Sodium Ion Hydration." [http://pubs.acs.org/doi/abs/10.1021/acs.jctc.5b00357 J. Chem. Theory. Comput. 142:074101, 2015]. We studied the influence of dispersion energy corrections on the free energy of formation for sodium-water clusters computed with DFT and wound up discovering that dispersion and split-range exchange functionals can somewhat counter-balance each other. The charged sodium ion pulls on the water's electrons, clearly showing which density functionals over-polarize compared to CCSD. Split-range exchange can reduce this over-polarization, but results in reduced electrostatic interaction. Dispersion can lower the binding energy again to counter-balance. So, functionals fit to experimental formation energies need both effects to avoid lowering energies by over-polarizing. |- style="border: 1px solid darkgray;" || David M. Rogers. "Real-space quadrature: a convenient, efficient representation for multipole expansions." [http://dx.doi.org/10.1063/1.4907404 J. Chem. Phys. 142:074101, 2015]. ([http://predictivestatmech.org/papers/real-poles.pdf Presentation]) I introduce sets of point charges that are able to simultaneously reproduce all multipole (spherical harmonic) expansions up to arbitrary order. The number of points is space-optimal. Translations are described from the usual harmonics and from Cartesian moments (dipole, quadrupole, etc.) on supersymmetric tensors to directional moments using the point weight distribution. Many applications are possible, including trivial implementation of multipoles in molecular mechanics and representing probability distributions over rotation space. |- style="border: 1px solid darkgray;" || David M. Rogers, Michael S. Kent, and Susan B. Rempe, "Molecular basis of endosomal-membrane association for the dengue virus envelope protein." [http://dx.doi.org/10.1016/j.bbamem.2014.12.018 BBA Biomembranes 1848(4):1041-52, 2015.] A fully atomistic potential of mean force for association of the viral envelope protein from Dengue virus was compared to a Poisson-Boltzmann electrostatic plus dispersion model. The results are consistent, showing hope for this type of combined scale simulation. |- style="border: 1px solid darkgray;" || Yaqin Fu, Binsong Li, Ying-Bing Jiang, Darren R. Dunphy, Andy Tsai, Siu-Yue Tam, Hongyou Fan, Hongxia Zhan, David Rogers, Susan Rempe, Plamen Atanassov, Joseph L. Cecchi, and C. Jeffrey Brinker "Atomic Layer Deposition of L-Alanine Polypeptide." [http://pubs.acs.org/doi/abs/10.1021/ja5043403 JACS 136(45):15821–4, 2014.] This paper with our experimental collaborators carried out blocked peptide synthesis by vapor-depositing Boc-L-alanine to create a uniform thin film of polypeptides grown on a silica substrate activated by aminopropyltrimethoxysilane. |- style="border: 1px solid darkgray;" || David M. Rogers. "Silmaril, A Functional Language for Distributed Parallel Evaluation." [http://predictivestatmech.org/sil/papers/sil.pdf Submitted version] |- style="border: 1px solid darkgray;" || Mathias B. Andersen, David M. Rogers, Junyu Mai, Benjamin Schudel, Anson V. Hatch, Susan B. Rempe and Ali Mani. "Spatiotemporal pH dynamics in concentration polarization near ion-selective membranes." [http://dx.doi.org/10.1021/la5014297 Langmuir, 30(26):7902–7912, 2014] |- style="border: 1px solid darkgray;" || W. K. Chan, P. L. Lorenzi, A. Anishkin, P. Purwaha, D. M. Rogers, S. Sukharev, S.B. Rempe, and J. N. Weinstein. "The glutaminase activity of l-asparaginase is not required for anticancer activity against ASNS-negative cells." [http://dx.doi.org/10.1182/blood-2013-10-535112 Blood. 123(23):3596-606, 2014]. |- style="border: 1px solid darkgray;" || David M. Rogers, Dian Jiao, Lawrence Pratt, and Susan B. Rempe. "Structural Models and Molecular Thermodynamics of Hydration of Ions and Small Molecules" [http://dx.doi.org/10.1016/B978-0-444-59440-2.00004-1 Annu. Rep. Comp. Chem. 8:71–127, 2012.] |- style="border: 1px solid darkgray;" || David M. Rogers and Susan B. Rempe. "Irreversible Thermodynamics." [http://dx.doi.org/10.1088/1742-6596/402/1/012014 J. Phys.: Conf. Ser. 402:012014, 2012]. |- style="border: 1px solid darkgray;" || David M. Rogers, Thomas L. Beck, and Susan B. Rempe. [[Media:Dmroge_InfoNonequ2011.pdf|"An Information Theory Approach to Nonlinear, Nonequilibrium Thermodynamics."]] [http://dx.doi.org/10.1007/s10955-011-0358-9 J. Stat. Phys. 145(2):385-409, 2011] We show how the interpretation of thermodynamic states as representing system information leads naturally to thermodynamic cycles and the first and second laws of thermodynamics as well as similar formulations for nontrivial nonequilibrium problems. The logical development of the theory also leads naturally to correct indistinguishability factors in the partition function. |- style="border: 1px solid darkgray;" || Sameer Varma, David M. Rogers, Lawrence R. Pratt, and Susan B. Rempe. "Perspectives on Ion Selectivity: Design Principles for K+ Selectivity in Membrane Transport." [http://jgp.rupress.org/content/137/6/479.full J. Gen. Physiol., 137(6):479-488, 2011.] We review the development of models for understanding the physical basis of selectivity for K+ ions over Na+, its sibling only one row behind, in membrane channels and transporters. Although the problem is subtle because of the morass of competing effects, we emphasize work analyzing the systematic influence of the environment on tipping local binding site structure toward selective configurations. |- style="border: 1px solid darkgray;" || David M. Rogers and Susan B. Rempe. [http://www.ncbi.nlm.nih.gov/pmc/articles/PMC3443978/ “Probing the Thermodynamics of Competitive Ion Binding Using Minimum Energy Structures.”] [http://dx.doi.org/10.1021/jp2012864 J. Phys. Chem. B, 115(29):9116-29, 2011]. We presented an extension of the Quasi-Chemical theory for quantifying the impact of local structure on ion complexation thermodynamics. The theory can be simply represented using a set of thermodynamic cycles involving binding site structural and compositional states as reaction intermediates. |- style="border: 1px solid darkgray;" || Susan B. Rempe and David M. Rogers; et. al. “Computational and experimental platform for understanding and optimizing water flux and salt rejection in nanoporous membranes.” [http://prod.sandia.gov/techlib/access-control.cgi/2010/106735.pdf Sandia Technical Report, SAND2010-6735, 2010.] We summarize work on designing polymer coatings for salt exclusion in water transporting nanopores. In this work, I collected available molecular dynamics results for these systems and performed a novel energy efficiency analysis able to relate atomistic and experimental scales as well as identify important design goals and chemical principles for material performance. |- style="border: 1px solid darkgray;" || David M. Rogers, [http://rave.ohiolink.edu/etdc/view?acc_num=ucin1251832030 ''''Using Bayes' Theorem for Free Energy Calculations''''], 2009. We investigated the central quantity of free energies in a Bayesian context and provide estimators for solvation free energies as well as optimal potential of mean force approximations to model polymer coarse-grained dynamics from atomistic simulations. |- style="border: 1px solid darkgray;" || Zhen Zhao, David M. Rogers and Thomas L. Beck. "Polarization and Charge Transfer in the Hydration of Chloride Ions." [http://link.aip.org/link/?JCP/132/014502/1 J. Chem. Phys., 132:014502, 2010.] Dr. Zhao's ab-initio analysis of the charge distribution in water-ion clusters highlighted the importance of many-body water-water interactions and charge transfer effects in determining cluster structural and energetic properties. These are still challenging to represent in modern polarizable forcefields and have implications for anion properties at interfaces. |- style="border: 1px solid darkgray;" || David M. Rogers and Thomas L. Beck. "Quasi-Chemical and Structural Analysis of Polarizable Anion Hydration." [http://link.aip.org/link/?JCP/132/014505/1 J. Chem. Phys., 132:014505, 2010.] The role of polarizability in forcefield-based models of ions and water was examined. Utilizing some of our recent developments on quasi-chemical theory, we have been able to quantify the tightened, asymmetric nature of the ion's local solvation waters induced by increased polarizability as well as the exact effects of polarization on the solvation free energy. The results suggest some potential problems and diagnostics for such models. |- style="border: 1px solid darkgray;" || David M. Rogers and Thomas L. Beck. [http://forcesolve.sourceforge.net/ Force Solve] (Sourceforge, Chicago IL, 2008). This force matching software implements and tests coarse-graining for general molecular systems in a mere 4000 lines of code. It is able to parametrize coarse Hamiltonians from atomic trajectory data given arbitrary definitions of coarse united-atom type models as well as carry out short Langevin Dynamics simulations on the coarse scale. The program's main drawbacks are its slow speed and high memory usage due to its simplistic design, attributable to the interpreted nature of python. |- style="border: 1px solid darkgray;" || David M. Rogers and Thomas L. Beck. "Resolution and Scale Independent Nonparametric Function Matching Using a String Energy Penalized Spline Prior." 2008. [http://arxiv.org/abs/1003.4741 arXiv:1003.4741v1] (stat.ML). Fresh insight is provided into long-standing mathematical issues surrounding computational modeling of continuous functions from a few sampled data points. The present research lays the groundwork for predicting the behavior of complicated many-body systems using advanced regression techniques. |} cc3fe5efa3688c61d68900ca62d9f8b3832be263 File:Param1.jpg 6 132 578 2017-03-08T17:31:44Z David M. Rogers 2 wikitext text/x-wiki da39a3ee5e6b4b0d3255bfef95601890afd80709 File:Param2.jpg 6 133 579 2017-03-08T17:32:06Z David M. Rogers 2 wikitext text/x-wiki da39a3ee5e6b4b0d3255bfef95601890afd80709 Agile 0 134 583 2017-03-20T16:24:12Z David M. Rogers 2 Created page with "= Agile Development Methods = To complete your project efficiently in the short time-frame of the course, agile development principles provide a few, very helpful, ideas. Al..." wikitext text/x-wiki = Agile Development Methods = To complete your project efficiently in the short time-frame of the course, agile development principles provide a few, very helpful, ideas. Although you can read online articles for yourself, here are the basic guiding principles: # Code in close collaboration with other developers. #* This includes techniques like pair programming, where two people sit together and take turns coding one at a time. It's more helpful than it sounds because there are a lot of things to keep track of while programming. # Early prototyping and frequent delivery #* Don't consider it done until the code is working and tested. # Customer collaboration #* Don't ``just follow the contract'' # Plan and re-plan to respond to change. == Scrum == More specific guidelines for handling a project can be found in [http://www.scrumguides.org/scrum-guide.html The Scrum Guide(TM)]. It outlines a development cycle consisting of the following steps: # Sprints: group meetings where everyone collaborates to identify "next step" objectives. #* It's important that these objectives be measurable and achievable within a short time-frame. #* Of course, the steps should align with and work toward long-term needs. # Prototyping and testing #* The goals are worked on and completed by building '''working''' code and then testing it. New code and features emerge during this phase, and should be built incrementally and in small, easy to group chunks (i.e. functions). This way, it's easy to adapt, add or remove these from the final project as needed. #* If you do not code in pairs, each person should still regularly report what they did to make progress, what they plan on doing, and (importantly) what issues are in the way. # Sprint Retrospective: look at the goals that were achieved and those that were not ## How long did each take? ## Use this summary to double-check the timeline for delivery of the final project (here the final presentation). Building code is like the process of gardening. New growth continues to emerge, and must be carefully evaluated in context to decide where to put effort and where to pruned back. == Kanban == This is not a process, but rather a documentation technique. [http://kanbanblog.com/explained/ Kanban] is just the name for a project board that lists goals in columns. As progress is made toward completing each goal, it moves to the right. Although it's unlikely an actual board will be needed for the group projects in this class, it's a helpful tool for mentally `visualizing' your progress and online versions exist which may be helpful. For goals in your projects, you probably need stages like: # Create pseudocode # Implement # Test # Merge into project aa61cc9e8b46d838a5de85712355bdc41c024beb Code:Compiling 0 135 585 2017-04-03T16:21:08Z David M. Rogers 2 Created page with "<source lang="bash"> # Building FFTW3 # note you could "just use" the versions already available in /apps/lib/fftw-3.2.2 build_fftw3() { wget ftp://ftp.fftw.org/pub/fftw/fft..." wikitext text/x-wiki <source lang="bash"> # Building FFTW3 # note you could "just use" the versions already available in /apps/lib/fftw-3.2.2 build_fftw3() { wget ftp://ftp.fftw.org/pub/fftw/fftw-3.3.6-pl2.tar.gz # or curl -LO ftp://ftp.fftw.org/pub/fftw/fftw-3.3.6-pl2.tar.gz git clone https://github.com/FFTW/fftw3 tar xzf fftw-3.3.6-pl2.tar.gz cd fftw-3.3.6-pl2 ./configure --prefix=$HOME make make install ls $HOME make uninstall } # Building a cmake project # apps/cmake/3.7.1 build_gromacs() { curl -O ftp://ftp.gromacs.org/pub/gromacs/gromacs-2016.3.tar.gz tar xzf gromacs-2016.3.tar.gz mkdir build cd buid cmake ../gromacs-2016.3 } # Install a python package: # (see docs https://docs.python.org/2/install/index.html) # http://docs.sympy.org/latest/install.html install_sympy() { curl -LO http://mpmath.org/files/mpmath-0.19.tar.gz python setup.py install --user # run python, then import mpmath to check # continue to install sympy } # Using modules: load_some_modules() { module avail 2>&1 | grep compiler module avail 2>&1 | grep cmake module avail 2>&1 | grep gromacs } </source> ba1b87eda3e8dd6b3951e0c6adcedf82d8323b01 Code:gmxliquid 0 65 587 531 2017-04-05T16:20:21Z David M. Rogers 2 wikitext text/x-wiki In this tutorial, I'm assuming you already have the gromacs commands (grompp, mdrun, etc.) loaded. I'm also assuming you have gromacs 5, which made significant changes to the way command-line tools are used. You'll also need the starting files [[Media:liq_files.tgz|here]]. Or, on circe, just run cp -R /shares/mri_workshop/Liquids . cd Liquids = Create an input system = First, we do some size calculations in the python prompt. >>> # Compute number of EtOH molecules >>> # 8 nm^3 = 8e-21 cc >>> # 0.4 % By vol. >>> # rho_EtOH = 0.78924 g / cc >>> # FW = 46 g/mol >>> >>> 8e-21*0.4*0.78924/46.0*6.022e23 33 Next, we need to generate an 8 nm<math>^3</math> box with 33 EtOH molecules gmx insert-molecules -box 2 2 2 -ci etoh.pdb -o box.pdb -nmol 33 nano topol.top # check for line "ETH 33" (no changes required) If the topology file and forcefields are 'there', we can create a test simulation using just these molecules. We'll do this just to check that grompp works gmx grompp -c box.pdb -f equ.mdp -o equ.tpr If this completes without errors, we know that we ''could'' simulate the ETH molecules we have now. That would give a high-density gas, rather than the liquid we want. Next, the complete water+EtOH mixture can be made by filling the voids with water. We'll use TIP4P here. gmx solvate -cs tip4p -cp box.pdb -o sys.pdb Since this last command added waters, you have to update the topology file, adding "SOL 130" (or your number of waters) nano topol.top = run minimization = Molecular structures can be touchy, since contacting atoms causes large forces and 'blows up' a system. The risk of this can be reduced by minimizing the energy of initial starting systems. First, we have to create a file describing how gromacs should do the minimization. gmx grompp -p topol.top -f min.mdp -c sys.pdb -o min A lot of backup files (starting with '#') accumulate, and we remove them like so: rm -f \#* mdout.mdp Now we're ready to run minimization. Since the system is small, minimization is cheap and fast - so we do it on the head node. For larger systems, this command would be put in a job-script. gmx mdrun -deffnm min The latest gromacs has a bug of some sort or can't work with OPLS-AA for EtOH, since I get a segfault here. Hopefully this will be fixed soon. Otherwise, you can manually delete the EtOH from sys.pdb and topol.top and then re-run the grompp and mdrun steps. Now we're ready to take the minimized structure and run dynamics. This first round is called equilibration, since we intend to let the system settle into a thermal equilibrium state. gmx grompp -c min.gro -f equ.mdp -o equ.tpr To run this one, we'll use the cluster by writing down the command in a script file. That script gets sent to the cluster. No changes to equ.sh should be required. nano equ.sh sbatch equ.sh squeue -u `whoami` As the job is running you can read through the log file. less equ.log tail -f equ.log # enter Ctl-C to stop tailing Note that the energy is output at every time-step. Why is the total energy changing with time? What about the total volume? = run dynamics = Running dynamics uses the same procedure as before, but now we need to worry about how much and which output to produce. nano run.mdp # no changes required gmx grompp -c equ.gro -f run.mdp -o run.tpr Check and start the job (no changes required). nano run.sh sbatch run.sh squeue -u `whoami` Read through run.log less run.log tail -f run.log # enter Ctl-C to stop tailing Notice that the total energy remains relatively constant now, but the individual energies are still very noisy. What does this say about the shape of the molecules? = analyze dynamic data = Let's first check what happened during equilibration. Since the volume was allowed to change, we should be able to plot it vs. time: gmx energy -f equ.edr -o equ.en.xvg # Select: Potential Kinetic-En. Total-Energy Volume * At what time does the potential energy stabilize? * What is the density? ** answer: (33*46 + 18*133)/Avogadro / 7.0333834916722191e-21 = 0.9236 g/mL ** These two quantities inform on the heat and volume change of mixing. ** Pure H2O (TIP4P): rho = 1.001, H ~ 11.6 kcal/mol, D = 3.9e-5 cm^2/s, eps = 52 ** Pure H2O (expt): rho = 0.9971, H = 10.5 kcal/mol, D = 2.3e-5 cm^2/s, eps = 78.4 ** Gas-phase TIP4P energy = 0 (no self interactions in the model) ** Gas-phase OPLSAA-EtOH energy = 25 kJ/mol (<math>\pm</math>1) ** (J. Chem. Phys. 123, 234505, 2005) ** Pure EtOH: rho = 0.7873, H = 10.0 kcal/mol, D = 1.0e-5 cm^2/s, eps(expt) = 23 ** (J. Phys. Chem. B 1997, 101, 78-86, J. Phys. Chem. B, 2014, 118 (34), 10156-66) Gnuplot can make this plot with plot 'equ.en.xvg' u 1:2 w l, 'equ.en.xvg' u 1:5 axis x1y2 w l The radial distribution function is a classical measure of the structuring of liquid water. The one we calculate here shows the density of molecules within spherical shells around the central molecule. gmx rdf -rdf mol_com -ng 2 -s run -f run.trr -o run.w-rdf.xvg # select Water as "reference group", select "Water", then "ETH" # re-run for ETH-ETH rdf gmx rdf -rdf mol_com -ng 1 -s run -f run.trr -o run.e-rdf.xvg gnuplot can plot these together with: plot 'run.w-rdf.xvg' u 1:2 w l, 'run.w-rdf.xvg' u 1:3 w l, 'run.e-rdf.xvg' u 1:2 w l Notice how waters stack much more closely together than EtOH? How is this related to their liquid densities? The dielectric of a liquid measures its ability to be polarized by an applied field. High dielectric materials make good capacitors. gmx dipoles -f run.trr -s run.tpr -c dipcorr.xvg -corr total -P 1 <pre><nowiki> Dipole moment (Debye) --------------------- Average = 2.2234 Std. Dev. = 0.1095 Error = 0.0001 The following averages for the complete trajectory have been calculated: Total < M_x > = 7.79882 Debye Total < M_y > = -1.11977 Debye Total < M_z > = 9.49511 Debye Total < M_x^2 > = 882.516 Debye^2 Total < M_y^2 > = 1239.78 Debye^2 Total < M_z^2 > = 925.457 Debye^2 Total < |M|^2 > = 3047.75 Debye^2 Total |< M >|^2 = 152.233 Debye^2 < |M|^2 > - |< M >|^2 = 2895.52 Debye^2 Finite system Kirkwood g factor G_k = 3.52836 Infinite system Kirkwood g factor g_k = 2.37948 Epsilon = 43.1739 </nowiki></pre> Water and EtOH are constantly undergoing random collisions in solution. The net effect of this is diffusion of the two molecules. Einstein showed that this can be tracked by watching the mean squared displacement of the molecules over time. Since the distance traveled over a random walk with diffusion constant <math>D</math> has a Gaussian distribution with variance <math>2D\Delta t</math>, where <math>\Delta t</math> is the elapsed time, the mean squared displacement vs time should be a straight line with slope <math>2D</math>. Of course, over short times, this picture is only approximate, but it usually holds over longer times. gmx msd -f run.trr -ngroup 2 -o run.msd.xvg <pre><nowiki> Fitting from 100 to 900 ps D[ Water] 1.4336 (+/- 0.0850) 1e-5 cm^2/s D[ ETH] 0.7312 (+/- 0.1279) 1e-5 cm^2/s </nowiki></pre> How do these compare with the literature values (above) for the pure liquids? More detail on velocity correlation: gmx velacc -mol -s run -f run.trr -o run.w-acf.xvg # Choose group 3 (Water) gmx velacc -mol -s run -f run.trr -o run.e-acf.xvg # Choose group 2 (ETH) you can compare these to some of the above references. == Appendix == Here are cut and paste versions of the 3 most important files for running this tutorial. TITLE An empty 20 Ang. cube simulation box (box.pdb) CRYST1 20.000 20.000 20.000 90.00 90.00 90.00 P 1 1 MODEL 1 ENDMDL A topology using the opls-aa forcefield (topol.top). #include "oplsaa.ff/forcefield.itp" #include "oplsaa.ff/ethanol.itp" #include "oplsaa.ff/tip4p.itp" [ system ] 80 Proof Water [ molecules ] ETH 33 An ethanol molecule from the gromacs shares directory (etoh.pdb): HETATM 1 C ETH 1 -0.000 -0.000 0.000 0.00 0.00 C HETATM 2 H ETH 1 -0.785 0.244 -0.653 0.00 0.00 H HETATM 3 H ETH 1 0.322 -0.981 -0.190 0.00 0.00 H HETATM 4 H ETH 1 -0.335 0.073 0.993 0.00 0.00 H HETATM 5 C ETH 1 1.171 0.975 -0.220 0.00 0.00 C HETATM 6 H ETH 1 2.014 0.675 0.402 0.00 0.00 H HETATM 7 H ETH 1 1.468 0.957 -1.268 0.00 0.00 H HETATM 8 OA ETH 1 0.763 2.299 0.138 0.00 0.00 O HETATM 9 HO ETH 1 0.490 2.313 1.058 0.00 0.00 H An mdp file for a short equilibration run (equ.mdp): constraints = none continuation = no gen_vel = yes gen_temp = 300 gen_seed = 9875945 integrator = md tinit = 0 dt = 0.001 nsteps = 100000 ; 100 ps nstcomm = 500 nstlog = 5000 nstenergy = 500 nstcalcenergy = 500 nstxout = 5000 nstvout = 5000 nstfout = 5000 comm-mode = Linear emtol = 100 emstep = 0.001 nstlist = 10 ns_type = grid pbc = xyz rlist = 0.9 coulombtype = pme rcoulomb = 0.9 vdw-type = Cut-Off rvdw = 0.9 DispCorr = EnerPres fourierspacing = 0.1 pme_order = 4 ewald_rtol = 1e-5 ewald_geometry = 3d optimize_fft = yes Tcoupl = v-rescale tc-grps = System tau_t = 1.0 ref_t = 300 Pcoupl = Berendsen ; Pcoupl = Parrinello-Rahman Pcoupltype = isotropic tau_p = 1.8 compressibility = 4.5e-5 ref_p = 1.01325 15c9dab12a1acead8ad37b38f07f2557195868c5 593 587 2017-04-17T17:51:05Z David M. Rogers 2 wikitext text/x-wiki In this tutorial, I'm assuming you already have the gromacs commands (grompp, mdrun, etc.) loaded. I'm also assuming you have gromacs 5, which made significant changes to the way command-line tools are used. You'll also need the starting files [[Media:liq_files.tgz|here]]. Or, on circe, just run cp -R /shares/mri_workshop/Liquids . cd Liquids = Create an input system = First, we do some size calculations in the python prompt. >>> # Compute number of EtOH molecules >>> # 8 nm^3 = 8e-21 cc >>> # 0.4 % By vol. >>> # rho_EtOH = 0.78924 g / cc >>> # FW = 46 g/mol >>> >>> 8e-21*0.4*0.78924/46.0*6.022e23 33 Next, we need to generate an 8 nm<math>^3</math> box with 33 EtOH molecules gmx insert-molecules -box 2 2 2 -ci etoh.pdb -o box.pdb -nmol 33 nano topol.top # check for line "ETH 33" (no changes required) If the topology file and forcefields are 'there', we can create a test simulation using just these molecules. We'll do this just to check that grompp works gmx grompp -c box.pdb -f equ.mdp -o equ.tpr If this completes without errors, we know that we ''could'' simulate the ETH molecules we have now. That would give a high-density gas, rather than the liquid we want. Next, the complete water+EtOH mixture can be made by filling the voids with water. We'll use TIP4P here. gmx solvate -cs tip4p -cp box.pdb -o sys.pdb Since this last command added waters, you have to update the topology file, adding "SOL 130" (or your number of waters) nano topol.top = run minimization = Molecular structures can be touchy, since contacting atoms causes large forces and 'blows up' a system. The risk of this can be reduced by minimizing the energy of initial starting systems. First, we have to create a file describing how gromacs should do the minimization. gmx grompp -p topol.top -f min.mdp -c sys.pdb -o min A lot of backup files (starting with '#') accumulate, and we remove them like so: rm -f \#* mdout.mdp Now we're ready to run minimization. Since the system is small, minimization is cheap and fast - so we do it on the head node. For larger systems, this command would be put in a job-script. gmx mdrun -deffnm min The latest gromacs has a bug of some sort or can't work with OPLS-AA for EtOH, since I get a segfault here. Hopefully this will be fixed soon. Otherwise, you can manually delete the EtOH from sys.pdb and topol.top and then re-run the grompp and mdrun steps. Now we're ready to take the minimized structure and run dynamics. This first round is called equilibration, since we intend to let the system settle into a thermal equilibrium state. gmx grompp -c min.gro -f equ.mdp -o equ.tpr To run this one, we'll use the cluster by writing down the command in a script file. That script gets sent to the cluster. No changes to equ.sh should be required. nano equ.sh sbatch equ.sh squeue -u `whoami` As the job is running you can read through the log file. less equ.log tail -f equ.log # enter Ctl-C to stop tailing Note that the energy is output at every time-step. Why is the total energy changing with time? What about the total volume? = run dynamics = Running dynamics uses the same procedure as before, but now we need to worry about how much and which output to produce. nano run.mdp # no changes required gmx grompp -c equ.gro -f run.mdp -o run.tpr Check and start the job (no changes required). nano run.sh sbatch run.sh squeue -u `whoami` Read through run.log less run.log tail -f run.log # enter Ctl-C to stop tailing Notice that the total energy remains relatively constant now, but the individual energies are still very noisy. What does this say about the shape of the molecules? = analyze dynamic data = Let's first check what happened during equilibration. Since the volume was allowed to change, we should be able to plot it vs. time: gmx energy -f equ.edr -o equ.en.xvg # Select: Potential Kinetic-En. Total-Energy Volume * At what time does the potential energy stabilize? * What is the density? ** answer: (33*46 + 18*133)/Avogadro / 7.0333834916722191e-21 = 0.9236 g/mL ** These two quantities inform on the heat and volume change of mixing. ** Pure H2O (TIP4P): rho = 1.001, H ~ 11.6 kcal/mol, D = 3.9e-5 cm^2/s, eps = 52 ** Pure H2O (expt): rho = 0.9971, H = 10.5 kcal/mol, D = 2.3e-5 cm^2/s, eps = 78.4 ** Gas-phase TIP4P energy = 0 (no self interactions in the model) ** Gas-phase OPLSAA-EtOH energy = 25 kJ/mol (<math>\pm</math>1) ** (J. Chem. Phys. 123, 234505, 2005) ** Pure EtOH: rho = 0.7873, H = 10.0 kcal/mol, D = 1.0e-5 cm^2/s, eps(expt) = 23 ** (J. Phys. Chem. B 1997, 101, 78-86, J. Phys. Chem. B, 2014, 118 (34), 10156-66) Gnuplot can make this plot with plot 'equ.en.xvg' u 1:2 w l, 'equ.en.xvg' u 1:5 axis x1y2 w l The radial distribution function is a classical measure of the structuring of liquid water. The one we calculate here shows the density of molecules within spherical shells around the central molecule. gmx rdf -rdf mol_com -ng 2 -s run -f run.trr -o run.w-rdf.xvg # select Water as "reference group", select "Water", then "ETH" # re-run for ETH-ETH rdf gmx rdf -rdf mol_com -ng 1 -s run -f run.trr -o run.e-rdf.xvg gnuplot can plot these together with: plot 'run.w-rdf.xvg' u 1:2 w l, 'run.w-rdf.xvg' u 1:3 w l, 'run.e-rdf.xvg' u 1:2 w l Notice how waters stack much more closely together than EtOH? How is this related to their liquid densities? The dielectric of a liquid measures its ability to be polarized by an applied field. High dielectric materials make good capacitors. gmx dipoles -f run.trr -s run.tpr -c dipcorr.xvg -corr total -P 1 <pre><nowiki> Dipole moment (Debye) --------------------- Average = 2.2234 Std. Dev. = 0.1095 Error = 0.0001 The following averages for the complete trajectory have been calculated: Total < M_x > = 7.79882 Debye Total < M_y > = -1.11977 Debye Total < M_z > = 9.49511 Debye Total < M_x^2 > = 882.516 Debye^2 Total < M_y^2 > = 1239.78 Debye^2 Total < M_z^2 > = 925.457 Debye^2 Total < |M|^2 > = 3047.75 Debye^2 Total |< M >|^2 = 152.233 Debye^2 < |M|^2 > - |< M >|^2 = 2895.52 Debye^2 Finite system Kirkwood g factor G_k = 3.52836 Infinite system Kirkwood g factor g_k = 2.37948 Epsilon = 43.1739 </nowiki></pre> Water and EtOH are constantly undergoing random collisions in solution. The net effect of this is diffusion of the two molecules. Einstein showed that this can be tracked by watching the mean squared displacement of the molecules over time. Since the distance traveled over a random walk with diffusion constant <math>D</math> has a Gaussian distribution with variance <math>2D\Delta t</math>, where <math>\Delta t</math> is the elapsed time, the mean squared displacement vs time should be a straight line with slope <math>2D</math>. Of course, over short times, this picture is only approximate, but it usually holds over longer times. gmx msd -f run.trr -ngroup 2 -o run.msd.xvg <pre><nowiki> Fitting from 100 to 900 ps D[ Water] 1.4336 (+/- 0.0850) 1e-5 cm^2/s D[ ETH] 0.7312 (+/- 0.1279) 1e-5 cm^2/s </nowiki></pre> How do these compare with the literature values (above) for the pure liquids? More detail on velocity correlation: gmx velacc -mol -s run -f run.trr -o run.w-acf.xvg # Choose group 3 (Water) gmx velacc -mol -s run -f run.trr -o run.e-acf.xvg # Choose group 2 (ETH) you can compare these to some of the above references. == Appendix == Here are cut and paste versions of the 3 most important files for running this tutorial. TITLE An empty 20 Ang. cube simulation box (box.pdb) CRYST1 20.000 20.000 20.000 90.00 90.00 90.00 P 1 1 MODEL 1 ENDMDL A topology using the opls-aa forcefield (topol.top). #include "oplsaa.ff/forcefield.itp" #include "oplsaa.ff/ethanol.itp" #include "oplsaa.ff/tip4p.itp" [ system ] 80 Proof Water [ molecules ] ETH 33 An ethanol molecule from the gromacs shares directory (etoh.pdb): HETATM 1 C ETH 1 -0.000 -0.000 0.000 0.00 0.00 C HETATM 2 H ETH 1 -0.785 0.244 -0.653 0.00 0.00 H HETATM 3 H ETH 1 0.322 -0.981 -0.190 0.00 0.00 H HETATM 4 H ETH 1 -0.335 0.073 0.993 0.00 0.00 H HETATM 5 C ETH 1 1.171 0.975 -0.220 0.00 0.00 C HETATM 6 H ETH 1 2.014 0.675 0.402 0.00 0.00 H HETATM 7 H ETH 1 1.468 0.957 -1.268 0.00 0.00 H HETATM 8 OA ETH 1 0.763 2.299 0.138 0.00 0.00 O HETATM 9 HO ETH 1 0.490 2.313 1.058 0.00 0.00 H An mdp file for a short equilibration run (equ.mdp): constraints = none continuation = no gen_vel = yes gen_temp = 300 gen_seed = 9875945 integrator = md tinit = 0 dt = 0.001 nsteps = 100000 ; 100 ps nstcomm = 500 nstlog = 5000 nstenergy = 500 nstcalcenergy = 500 nstxout = 5000 nstvout = 5000 nstfout = 5000 comm-mode = Linear emtol = 100 emstep = 0.001 nstlist = 10 ns_type = grid pbc = xyz rlist = 0.9 coulombtype = pme rcoulomb = 0.9 vdw-type = Cut-Off rvdw = 0.9 DispCorr = EnerPres fourierspacing = 0.1 pme_order = 4 ewald_rtol = 1e-5 ewald_geometry = 3d optimize_fft = yes Tcoupl = v-rescale tc-grps = System tau_t = 1.0 ref_t = 300 Pcoupl = Berendsen ; Pcoupl = Parrinello-Rahman Pcoupltype = isotropic tau_p = 1.8 compressibility = 4.5e-5 ref_p = 1.01325 * Install instructions for [[Code:libxdrfile]] 5551769d84e6c65b29e86faf2aa615714efef55e File:Jobs.pdf 6 136 589 2017-04-05T16:22:15Z David M. Rogers 2 wikitext text/x-wiki da39a3ee5e6b4b0d3255bfef95601890afd80709 File:Final2017.pdf 6 137 591 2017-04-11T15:10:37Z David M. Rogers 2 wikitext text/x-wiki da39a3ee5e6b4b0d3255bfef95601890afd80709 Code:libxdrfile 0 138 592 2017-04-17T17:50:02Z David M. Rogers 2 Created page with "Compiling [http://www.gromacs.org/Developer_Zone/Programming_Guide/XTC_Library libxdr] The following sequence will work. It's complicated because the m4 macros that came wit..." wikitext text/x-wiki Compiling [http://www.gromacs.org/Developer_Zone/Programming_Guide/XTC_Library libxdr] The following sequence will work. It's complicated because the m4 macros that came with the program are old. <source lang="bash"> #!/bin/sh tar xzf xdrfile-1.1.4.tar.gz cd xdrfile-1.1.4 rm -f *.m4 autoreconf -f -i ./configure --prefix=$HOME --enable-shared make install </source> 32bffc876756bf464840bc37b3202498821566d6 File:Plug-in.pdf 6 139 595 2017-04-24T16:22:06Z David M. Rogers 2 wikitext text/x-wiki da39a3ee5e6b4b0d3255bfef95601890afd80709 File:Matrix.pdf 6 140 597 2017-04-26T16:22:51Z David M. Rogers 2 wikitext text/x-wiki da39a3ee5e6b4b0d3255bfef95601890afd80709 Silmaril 0 51 603 535 2017-07-28T14:39:24Z David M. Rogers 2 wikitext text/x-wiki The Silmaril programming language is built from the ground up for bleeding edge HPC. It has the following, fully automatic, killer features: * Git-like source code versioning * Cryptographically secure, distributed filesystem storage * First-class objects ** functions ** types ** modules (aka. tables / record types / directories / structs / ML "Functors") * Extensible primitive operations (JIT C-compilation) * Extensible binary object types (i.e. opaque pointers) This documentation explains how to get up and running with the latest distribution. To interact with the server, you'll need an rsa key. The process for creating one is easy: <source lang="bash"> mkdir ~/.sil chmod 0700 ~/.sil sil generate "Your Name" "email@example.com" >~/.sil/config </source> This will set up your sil environment with a new identity and server. Next, send your name and public key (from that file) to me by email. Now, you are ready to create a new sil project! From a new directory, run <source lang="bash"> git init git remote add --track master origin git@github.com:<username>/<project name>.git echo '"Hello world!"' >hello.sil git commit -am "Initial project." git push </source> This has created a new project with a simple hello world file. Next, you can create a home for the project within the hierarchy at https://www.parallelscience.com/projects. You can either ask parallelscience to fetch the code from your github account or compile the project directly from the command-line using: <source lang="bash"> sil compile test.hello/initial </source> This will parse the entire commit into sil object code, and sent it to the server. With setup out of the way, it's time to write some sil code! You can get started by reading the docs and examples: ([http://predictivestatmech.org/sil/docs/html/]). <!-- and following along with the [http://predictivestatmech.org/sil/tour.html tutorial].--> 4411fc04e7bd7d05e43e4bee53db84a0ffcefe35 604 603 2017-07-28T14:41:04Z David M. Rogers 2 wikitext text/x-wiki The Silmaril programming language is built from the ground up for bleeding edge HPC. It has the following, fully automatic, killer features: * Git-like source code versioning * Cryptographically secure, distributed filesystem storage * First-class objects ** functions ** types ** modules (aka. tables / record types / directories / structs / ML "Functors") * Extensible primitive operations (JIT C-compilation) * Extensible binary object types (i.e. opaque pointers) This documentation explains how to get up and running with the latest distribution. To interact with the server, you'll need an rsa key. The process for creating one is easy: <source lang="bash"> mkdir ~/.sil chmod 0700 ~/.sil sil generate "Your Name" "email@example.com" >~/.sil/config </source> This will set up your sil environment with a new identity and server. Next, send your name and public key (from that file) to me by email. Now, you are ready to create a new sil project! From a new directory, run <source lang="bash"> echo '"Hello world!"' >hello.sil git init git add hello.sil git commit -am "Initial project." git remote add --track master origin git@github.com:<username>/<project name>.git git push </source> This has created a new project with a simple hello world file. Next, you can create a home for the project within the hierarchy at https://www.parallelscience.com/projects. You can either ask parallelscience to fetch the code from your github repo or compile the project directly from the command-line using: <source lang="bash"> sil compile test.hello/initial </source> This will parse the entire commit into sil object code, and sent it to the server. With setup out of the way, it's time to write some sil code! You can get started by reading the docs and examples: ([http://predictivestatmech.org/sil/docs/html/]). <!-- and following along with the [http://predictivestatmech.org/sil/tour.html tutorial].--> c9d2069265b807e9edb8bd0f62204723635c8eb7 PChemFall2017 0 141 605 2017-08-16T17:44:14Z David M. Rogers 2 Created page with "'''<BIG>Physical Chemistry I</BIG>''' Course Info * Course Numbers CHM 4410-001 * Credit Hours: 4 * Meeting Dates: Aug. 22 - Dec. 1, 2017 ** No Class Nov. 10 or Nov. 21-24 * ..." wikitext text/x-wiki '''<BIG>Physical Chemistry I</BIG>''' Course Info * Course Numbers CHM 4410-001 * Credit Hours: 4 * Meeting Dates: Aug. 22 - Dec. 1, 2017 ** No Class Nov. 10 or Nov. 21-24 * Meeting Times: Tues. and Thurs., 3:30-4:45 pm in CIS 3064 ** Problem Session: Fri., 9:30-10:20 am in CIS 3064 ** Office Hours: Tues. and Thurs., 2:30-3:20 pm in SCA 433 * Grading: ** Quiz (40%) *** To succeed in the quiz, study the topics covered in the previous week! ** Midterm (30%) Thurs., Oct. 12 3:30-4:45 pm (CIS 3064) ** Final (30%) Thurs., Dec. 7 12:30-2:30 pm (CIS 3064) == Overview == This is the first part of a 2-semester course in thermodynamics. This course will cover the mathematical theory of chemical equilibrium, heat, and work. These are the driving forces behind the operation of Le Châtelier's principle, and are routinely used to understand and control chemical reactions, states of matter, and amount and efficiency of energy production. == Textbooks == * McQuarrie and Simon, Physical Chemistry: A Molecular Approach, University Science Books, 1997. ISBN: 0935702997. == Resources == * [http://hyperphysics.phy-astr.gsu.edu/hbase/kinetic/ktcon.html Kinetic Theory] at HyperPhysics * [http://hyperphysics.phy-astr.gsu.edu/hbase/heacon.html Heat Concepts] at HyperPhysics ** Note: McQuarrie says dU = dQ + dW, while Nave says dU = dQ - dW. There is no contradiction, since McQuarrie's dW = -P dV (work done on the system), while Nave's dW = P dV (work done by the system). I prefer the first definition. * News from the frontlines of exploring entropy: [http://scitation.aip.org/content/aip/magazine/physicstoday/article/68/9/10.1063/PT.3.2912 Information: From Maxwell’s demon to Landauer’s eraser] * [[Media:Transforms.pdf|Notes]] on transformations of variables. == Topics == # Moving Freely in P-V-T space (Chapter H, with examples from Ch. 16-[2,3,5,6,7], 17-[4,5], and 19-1) #* Isobaric, isothermal, and isochoric processes #* State functions #* Implicit, partial, and total derivatives #* Integration along a path #* Relations between partial derivatives #** Transformations using substitution #** Transformations using the chain rule #* Visualizing isosurfaces #* Using P(V,T) / V(P,T) / T(P,V) # First Law of Thermodynamics – conserved quantities (Ch. 19-[2 to 9]) #* Mechanisms of energy flow: work, heat, mass/chemical #* Integrating work and heat for common processes #* Energy of a molecule vs. a collection – translation, rotation, intermolecular, etc. #* Extensive and intensive quantities #* Using energy balance for fun and profit. # Standard States and Energies (Ch. 19-[10,11,12], Ch 26-[3,6,7,8,9]) #* Connecting to analytical chemistry. #* Spontaneous, irreversible, processes vs. quasistatic processes. #* Experimentally measuring reaction constants and heats. (Ch. 21-5) # The Second Law of Thermodynamics: Energy, Enthalpy, Entropy, and Free Energy (Ch. 20) #* The absolute temperature scale. (Ch. 16-1) #* Inequalities followed by each path type. (Ch. 22-[1,2]) #* Heat, measurement, information, Maxwell’s demon and Landauer’s principle. # Basic Probability #* Simple counting (Ch. J) #* Velocity distribution function (Ch 27-[1,2,3,4]) #* Boltzmann distributions (Ch. 17-[1,2,3,6 to 8]) # Applications: #* Quantitative Prediction of Reaction Equilibria (Ch. 26) #* Liquid solutions: osmotic pressure, vapor pressure, Henry’s and Raoult’s Laws (Ch. 24) #* Phase Equilibria and Basic Phase Diagrams (Ch. 23) #* Thermodynamic Cycles, Examples with Refrigeration and Galvanic Cell (Ch. 20-7) ce68307fec40be3ad68569648fa8c1ee7ec252e5 606 605 2017-08-16T17:46:44Z David M. Rogers 2 wikitext text/x-wiki '''<BIG>Physical Chemistry I</BIG>''' Course Info * Course Numbers CHM 4410-001 * Credit Hours: 4 * Meeting Dates: Aug. 22 - Dec. 1, 2017 ** No Class Nov. 10 or Nov. 21-24 * Meeting Times: Tues. and Thurs., 3:30-4:45 pm in CIS 3064 ** Problem Sessions: Fri., 2-2:50 pm in CIS 3064 ** Office Hours: Tues. and Thurs., 2:30-3:20 pm in IDR 200 * Grading: ** Quiz (40%) *** To succeed in the quiz, study the topics covered in the previous week! ** Midterm (30%) Thurs., Oct. 12 3:30-4:45 pm (CIS 3064) ** Final (30%) Thurs., Dec. 7 12:30-2:30 pm (CIS 3064) == Overview == This is the first part of a 2-semester course in thermodynamics. This course will cover the mathematical theory of chemical equilibrium, heat, and work. These are the driving forces behind the operation of Le Châtelier's principle, and are routinely used to understand and control chemical reactions, states of matter, and amount and efficiency of energy production. == Textbooks == * McQuarrie and Simon, Physical Chemistry: A Molecular Approach, University Science Books, 1997. ISBN: 0935702997. == Resources == * [http://hyperphysics.phy-astr.gsu.edu/hbase/kinetic/ktcon.html Kinetic Theory] at HyperPhysics * [http://hyperphysics.phy-astr.gsu.edu/hbase/heacon.html Heat Concepts] at HyperPhysics ** Note: McQuarrie says dU = dQ + dW, while Nave says dU = dQ - dW. There is no contradiction, since McQuarrie's dW = -P dV (work done on the system), while Nave's dW = P dV (work done by the system). I prefer the first definition. * News from the frontlines of exploring entropy: [http://scitation.aip.org/content/aip/magazine/physicstoday/article/68/9/10.1063/PT.3.2912 Information: From Maxwell’s demon to Landauer’s eraser] * [[Media:Transforms.pdf|Notes]] on transformations of variables. == Topics == # Moving Freely in P-V-T space (Chapter H, with examples from Ch. 16-[2,3,5,6,7], 17-[4,5], and 19-1) #* Isobaric, isothermal, and isochoric processes #* State functions #* Implicit, partial, and total derivatives #* Integration along a path #* Relations between partial derivatives #** Transformations using substitution #** Transformations using the chain rule #* Visualizing isosurfaces #* Using P(V,T) / V(P,T) / T(P,V) # First Law of Thermodynamics – conserved quantities (Ch. 19-[2 to 9]) #* Mechanisms of energy flow: work, heat, mass/chemical #* Integrating work and heat for common processes #* Energy of a molecule vs. a collection – translation, rotation, intermolecular, etc. #* Extensive and intensive quantities #* Using energy balance for fun and profit. # Standard States and Energies (Ch. 19-[10,11,12], Ch 26-[3,6,7,8,9]) #* Connecting to analytical chemistry. #* Spontaneous, irreversible, processes vs. quasistatic processes. #* Experimentally measuring reaction constants and heats. (Ch. 21-5) # The Second Law of Thermodynamics: Energy, Enthalpy, Entropy, and Free Energy (Ch. 20) #* The absolute temperature scale. (Ch. 16-1) #* Inequalities followed by each path type. (Ch. 22-[1,2]) #* Heat, measurement, information, Maxwell’s demon and Landauer’s principle. # Basic Probability #* Simple counting (Ch. J) #* Velocity distribution function (Ch 27-[1,2,3,4]) #* Boltzmann distributions (Ch. 17-[1,2,3,6 to 8]) # Applications: #* Quantitative Prediction of Reaction Equilibria (Ch. 26) #* Liquid solutions: osmotic pressure, vapor pressure, Henry’s and Raoult’s Laws (Ch. 24) #* Phase Equilibria and Basic Phase Diagrams (Ch. 23) #* Thermodynamic Cycles, Examples with Refrigeration and Galvanic Cell (Ch. 20-7) c93b1dbf2e1c80988486abd261bce6ecdb537e24 608 606 2017-08-22T17:04:50Z David M. Rogers 2 wikitext text/x-wiki '''<BIG>Physical Chemistry I</BIG>''' Course Info * Course Numbers CHM 4410-001 * Credit Hours: 4 * Meeting Dates: Aug. 22 - Dec. 1, 2017 ** No Class Nov. 10 or Nov. 21-24 * Meeting Times: Tues. and Thurs., 3:30-4:45 pm in CIS 3064 ** Problem Sessions: Fri., 2-2:50 pm in CIS 3064 ** Office Hours: Tues. and Thurs., 2:30-3:20 pm in IDR 200 * Grading: ** Quiz (40%) *** To succeed in the quiz, study the topics covered in the previous week! ** Midterm (30%) Thurs., Oct. 12 3:30-4:45 pm (CIS 3064) ** Final (30%) Thurs., Dec. 7 12:30-2:30 pm (CIS 3064) == Overview == This is the first part of a 2-semester course in thermodynamics. This course will cover the mathematical theory of chemical equilibrium, heat, and work. These are the driving forces behind the operation of Le Châtelier's principle, and are routinely used to understand and control chemical reactions, states of matter, and amount and efficiency of energy production. == Textbooks == * McQuarrie and Simon, Physical Chemistry: A Molecular Approach, University Science Books, 1997. ISBN: 0935702997. == Resources == * [http://hyperphysics.phy-astr.gsu.edu/hbase/kinetic/ktcon.html Kinetic Theory] at HyperPhysics * [http://hyperphysics.phy-astr.gsu.edu/hbase/heacon.html Heat Concepts] at HyperPhysics ** Note: McQuarrie says dU = dQ + dW, while Nave says dU = dQ - dW. There is no contradiction, since McQuarrie's dW = -P dV (work done on the system), while Nave's dW = P dV (work done by the system). I prefer the first definition. * News from the frontlines of exploring entropy: [http://scitation.aip.org/content/aip/magazine/physicstoday/article/68/9/10.1063/PT.3.2912 Information: From Maxwell’s demon to Landauer’s eraser] * [[Media:Transforms.pdf|Notes]] on transformations of variables. * [[PChemFall2016 | Course Page from 2016]] == Topics == # Moving Freely in P-V-T space (Chapter H, with examples from Ch. 16-[2,3,5,6,7], 17-[4,5], and 19-1) #* Isobaric, isothermal, and isochoric processes #* State functions #* Implicit, partial, and total derivatives #* Integration along a path #* Relations between partial derivatives #** Transformations using substitution #** Transformations using the chain rule #* Visualizing isosurfaces #* Using P(V,T) / V(P,T) / T(P,V) # First Law of Thermodynamics – conserved quantities (Ch. 19-[2 to 9]) #* Mechanisms of energy flow: work, heat, mass/chemical #* Integrating work and heat for common processes #* Energy of a molecule vs. a collection – translation, rotation, intermolecular, etc. #* Extensive and intensive quantities #* Using energy balance for fun and profit. # Standard States and Energies (Ch. 19-[10,11,12], Ch 26-[3,6,7,8,9]) #* Connecting to analytical chemistry. #* Spontaneous, irreversible, processes vs. quasistatic processes. #* Experimentally measuring reaction constants and heats. (Ch. 21-5) # The Second Law of Thermodynamics: Energy, Enthalpy, Entropy, and Free Energy (Ch. 20) #* The absolute temperature scale. (Ch. 16-1) #* Inequalities followed by each path type. (Ch. 22-[1,2]) #* Heat, measurement, information, Maxwell’s demon and Landauer’s principle. # Basic Probability #* Simple counting (Ch. J) #* Velocity distribution function (Ch 27-[1,2,3,4]) #* Boltzmann distributions (Ch. 17-[1,2,3,6 to 8]) # Applications: #* Quantitative Prediction of Reaction Equilibria (Ch. 26) #* Liquid solutions: osmotic pressure, vapor pressure, Henry’s and Raoult’s Laws (Ch. 24) #* Phase Equilibria and Basic Phase Diagrams (Ch. 23) #* Thermodynamic Cycles, Examples with Refrigeration and Galvanic Cell (Ch. 20-7) == Online Tutorials == There are some excellent introductory videos on Khan Academy that are useful if you need a refresher or extra practice with some of the topics in the course. # Moving Freely in P-V-T space #* Isobars & Work [https://www.khanacademy.org/test-prep/mcat/chemical-processes/thermodynamics-mcat/v/pv-diagrams-part-1-work-and-isobaric-processes] #* Isotherms, Isochors, Adiabats [https://www.khanacademy.org/test-prep/mcat/chemical-processes/thermodynamics-mcat/v/pv-diagrams-part-2-isothermal-isometric-adiabatic-processes] #* Implicit Derivatives (explained with practice problems) [https://www.khanacademy.org/math/ap-calculus-ab/ab-derivatives-advanced/ab-implicit-diff/v/implicit-differentiation-1] #* Partial Derivatives (explained with practice problems) [https://www.khanacademy.org/math/multivariable-calculus/multivariable-derivatives/partial-derivatives/v/partial-derivatives-introduction] #* State Functions (Macrostates vs Microstates) [https://www.khanacademy.org/science/chemistry/thermodynamics-chemistry/internal-energy-sal/v/macrostates-and-microstates] #* Quasistatic and Reversible Processes [https://www.khanacademy.org/science/chemistry/thermodynamics-chemistry/internal-energy-sal/v/quasistatic-and-reversible-processes] #* Integration along a path (using PV-diagrams and expansion/compression Work) [https://www.khanacademy.org/science/chemistry/thermodynamics-chemistry/internal-energy-sal/v/pv-diagrams-and-expansion-work] # First Law of Thermodynamics – conserved quantities (Ch. 19-[2 to 9]) #* PV work [https://www.khanacademy.org/science/chemistry/thermodynamics-chemistry/internal-energy-sal/a/pressure-volume-work] 39d7bc1cdf12620d93f53765150a9c5f703fbd3b 610 608 2017-09-28T15:40:35Z David M. Rogers 2 wikitext text/x-wiki '''<BIG>Physical Chemistry I</BIG>''' Course Info * Course Numbers CHM 4410-001 * Credit Hours: 4 * Meeting Dates: Aug. 22 - Dec. 1, 2017 ** No Class Nov. 10 or Nov. 21-24 * Meeting Times: Tues. and Thurs., 3:30-4:45 pm in CIS 3064 ** Problem Sessions: Fri., 2-2:50 pm in CIS 3064 ** Office Hours: Tues. and Thurs., 2:30-3:20 pm in IDR 200 * Grading: ** Quiz (40%) *** To succeed in the quiz, study the topics covered in the previous week! ** Midterm (30%) <s>Thurs., Oct. 12 3:30-4:45 pm</s> <u>Thurs., Oct. 26 3:30-4:45 pm</u> (CIS 3064) ** Final (30%) Thurs., Dec. 7 12:30-2:30 pm (CIS 3064) == Overview == This is the first part of a 2-semester course in thermodynamics. This course will cover the mathematical theory of chemical equilibrium, heat, and work. These are the driving forces behind the operation of Le Châtelier's principle, and are routinely used to understand and control chemical reactions, states of matter, and amount and efficiency of energy production. == Textbooks == * McQuarrie and Simon, Physical Chemistry: A Molecular Approach, University Science Books, 1997. ISBN: 0935702997. == Resources == * [http://hyperphysics.phy-astr.gsu.edu/hbase/kinetic/ktcon.html Kinetic Theory] at HyperPhysics * [http://hyperphysics.phy-astr.gsu.edu/hbase/heacon.html Heat Concepts] at HyperPhysics ** Note: McQuarrie says dU = dQ + dW, while Nave says dU = dQ - dW. There is no contradiction, since McQuarrie's dW = -P dV (work done on the system), while Nave's dW = P dV (work done by the system). I prefer the first definition. * News from the frontlines of exploring entropy: [http://scitation.aip.org/content/aip/magazine/physicstoday/article/68/9/10.1063/PT.3.2912 Information: From Maxwell’s demon to Landauer’s eraser] * [[Media:Transforms.pdf|Notes]] on transformations of variables. * [[PChemFall2016 | Course Page from 2016]] * [[PChemFall2015 | Course Page from 2015]] -- contains previous quizzes and keys. == Topics == # Moving Freely in P-V-T space (Chapter H, with examples from Ch. 16-[2,3,5,6,7], 17-[4,5], and 19-1) #* Isobaric, isothermal, and isochoric processes #* State functions #* Implicit, partial, and total derivatives #* Integration along a path #* Relations between partial derivatives #** Transformations using substitution #** Transformations using the chain rule #* Visualizing isosurfaces #* Using P(V,T) / V(P,T) / T(P,V) # First Law of Thermodynamics – conserved quantities (Ch. 19-[2 to 9]) #* Mechanisms of energy flow: work, heat, mass/chemical #* Integrating work and heat for common processes #* Energy of a molecule vs. a collection – translation, rotation, intermolecular, etc. #* Extensive and intensive quantities #* Using energy balance for fun and profit. # Standard States and Energies (Ch. 19-[10,11,12], Ch 26-[3,6,7,8,9]) #* Connecting to analytical chemistry. #* Spontaneous, irreversible, processes vs. quasistatic processes. #* Experimentally measuring reaction constants and heats. (Ch. 21-5) # The Second Law of Thermodynamics: Energy, Enthalpy, Entropy, and Free Energy (Ch. 20) #* The absolute temperature scale. (Ch. 16-1) #* Inequalities followed by each path type. (Ch. 22-[1,2]) #* Heat, measurement, information, Maxwell’s demon and Landauer’s principle. # Basic Probability #* Simple counting (Ch. J) #* Velocity distribution function (Ch 27-[1,2,3,4]) #* Boltzmann distributions (Ch. 17-[1,2,3,6 to 8]) # Applications: #* Quantitative Prediction of Reaction Equilibria (Ch. 26) #* Liquid solutions: osmotic pressure, vapor pressure, Henry’s and Raoult’s Laws (Ch. 24) #* Phase Equilibria and Basic Phase Diagrams (Ch. 23) #* Thermodynamic Cycles, Examples with Refrigeration and Galvanic Cell (Ch. 20-7) == Online Tutorials == There are some excellent introductory videos on Khan Academy that are useful if you need a refresher or extra practice with some of the topics in the course. # Moving Freely in P-V-T space #* Isobars & Work [https://www.khanacademy.org/test-prep/mcat/chemical-processes/thermodynamics-mcat/v/pv-diagrams-part-1-work-and-isobaric-processes] #* Isotherms, Isochors, Adiabats [https://www.khanacademy.org/test-prep/mcat/chemical-processes/thermodynamics-mcat/v/pv-diagrams-part-2-isothermal-isometric-adiabatic-processes] #* Implicit Derivatives (explained with practice problems) [https://www.khanacademy.org/math/ap-calculus-ab/ab-derivatives-advanced/ab-implicit-diff/v/implicit-differentiation-1] #* Partial Derivatives (explained with practice problems) [https://www.khanacademy.org/math/multivariable-calculus/multivariable-derivatives/partial-derivatives/v/partial-derivatives-introduction] #* State Functions (Macrostates vs Microstates) [https://www.khanacademy.org/science/chemistry/thermodynamics-chemistry/internal-energy-sal/v/macrostates-and-microstates] #* Quasistatic and Reversible Processes [https://www.khanacademy.org/science/chemistry/thermodynamics-chemistry/internal-energy-sal/v/quasistatic-and-reversible-processes] #* Integration along a path (using PV-diagrams and expansion/compression Work) [https://www.khanacademy.org/science/chemistry/thermodynamics-chemistry/internal-energy-sal/v/pv-diagrams-and-expansion-work] # First Law of Thermodynamics – conserved quantities (Ch. 19-[2 to 9]) #* PV work [https://www.khanacademy.org/science/chemistry/thermodynamics-chemistry/internal-energy-sal/a/pressure-volume-work] 2feb5a3ccbfa5846c8d7a35359f2c3ac813ac4f9 PChemFall2016 0 120 607 530 2017-08-22T17:02:45Z David M. Rogers 2 wikitext text/x-wiki '''<BIG>Physical Chemistry I</BIG>''' Course Info * Course Numbers CHM 4410-001 * Credit Hours: 4 * Meeting Dates: Aug. 23 - Nov. 29, 2016 ** No Class Nov. 11, 24 or 25 * Meeting Times: Tues. and Thurs., 3:30-4:45 pm in CIS 3064 ** Problem Session: Fri., 9:30-10:20 am in CIS 3064 ** Office Hours: Tues. and Thurs., 2:30-3:20 pm in SCA 433 * Grading: ** Quiz (40%) *** To succeed in the quiz, study the topics covered in the previous week! ** Midterm (30%) Thurs., Oct. 13, 3:30-4:45 pm (CIS 3064) ** Final (30%) Thurs., Dec. 8, 12:30-2:30 pm (CIS 3064) == Overview == This is the first part of a 2-semester course in thermodynamics. This course will cover the mathematical theory of chemical equilibrium, heat, and work. These are the driving forces behind the operation of Le Châtelier's principle, and are routinely used to understand and control chemical reactions, states of matter, and amount and efficiency of energy production. == Textbooks == * McQuarrie and Simon, Physical Chemistry: A Molecular Approach, University Science Books, 1997. ISBN: 0935702997. == Resources == * [http://hyperphysics.phy-astr.gsu.edu/hbase/kinetic/ktcon.html Kinetic Theory] at HyperPhysics * [http://hyperphysics.phy-astr.gsu.edu/hbase/heacon.html Heat Concepts] at HyperPhysics ** Note: McQuarrie says dU = dQ + dW, while Nave says dU = dQ - dW. There is no contradiction, since McQuarrie's dW = -P dV (work done on the system), while Nave's dW = P dV (work done by the system). I prefer the first definition. * News from the frontlines of exploring entropy: [http://scitation.aip.org/content/aip/magazine/physicstoday/article/68/9/10.1063/PT.3.2912 Information: From Maxwell’s demon to Landauer’s eraser] * [[Media:Transforms.pdf|Notes]] on transformations of variables. == Topics == # Moving Freely in P-V-T space (Chapter H, with examples from Ch. 16-[2,3,5,6,7], 17-[4,5], and 19-1) #* Isobaric, isothermal, and isochoric processes #* State functions #* Implicit, partial, and total derivatives #* Integration along a path #* Relations between partial derivatives #** Transformations using substitution #** Transformations using the chain rule #* Visualizing isosurfaces #* Using P(V,T) / V(P,T) / T(P,V) # First Law of Thermodynamics – conserved quantities (Ch. 19-[2 to 9]) #* Mechanisms of energy flow: work, heat, mass/chemical #* Integrating work and heat for common processes #* Energy of a molecule vs. a collection – translation, rotation, intermolecular, etc. #* Extensive and intensive quantities #* Using energy balance for fun and profit. # Standard States and Energies (Ch. 19-[10,11,12], Ch 26-[3,6,7,8,9]) #* Connecting to analytical chemistry. #* Spontaneous, irreversible, processes vs. quasistatic processes. #* Experimentally measuring reaction constants and heats. (Ch. 21-5) # The Second Law of Thermodynamics: Energy, Enthalpy, Entropy, and Free Energy (Ch. 20) #* The absolute temperature scale. (Ch. 16-1) #* Inequalities followed by each path type. (Ch. 22-[1,2]) #* Heat, measurement, information, Maxwell’s demon and Landauer’s principle. # Basic Probability #* Simple counting (Ch. J) #* Velocity distribution function (Ch 27-[1,2,3,4]) #* Boltzmann distributions (Ch. 17-[1,2,3,6 to 8]) # Applications: #* Quantitative Prediction of Reaction Equilibria (Ch. 26) #* Liquid solutions: osmotic pressure, vapor pressure, Henry’s and Raoult’s Laws (Ch. 24) #* Phase Equilibria and Basic Phase Diagrams (Ch. 23) #* Thermodynamic Cycles, Examples with Refrigeration and Galvanic Cell (Ch. 20-7) == Online Tutorials == There are some excellent introductory videos on Khan Academy that are useful if you need a refresher or extra practice with some of the topics in the course. # Moving Freely in P-V-T space #* Isobars & Work [https://www.khanacademy.org/test-prep/mcat/chemical-processes/thermodynamics-mcat/v/pv-diagrams-part-1-work-and-isobaric-processes] #* Isotherms, Isochors, Adiabats [https://www.khanacademy.org/test-prep/mcat/chemical-processes/thermodynamics-mcat/v/pv-diagrams-part-2-isothermal-isometric-adiabatic-processes] #* Implicit Derivatives (explained with practice problems) [https://www.khanacademy.org/math/ap-calculus-ab/ab-derivatives-advanced/ab-implicit-diff/v/implicit-differentiation-1] #* Partial Derivatives (explained with practice problems) [https://www.khanacademy.org/math/multivariable-calculus/multivariable-derivatives/partial-derivatives/v/partial-derivatives-introduction] #* State Functions (Macrostates vs Microstates) [https://www.khanacademy.org/science/chemistry/thermodynamics-chemistry/internal-energy-sal/v/macrostates-and-microstates] #* Quasistatic and Reversible Processes [https://www.khanacademy.org/science/chemistry/thermodynamics-chemistry/internal-energy-sal/v/quasistatic-and-reversible-processes] #* Integration along a path (using PV-diagrams and expansion/compression Work) [https://www.khanacademy.org/science/chemistry/thermodynamics-chemistry/internal-energy-sal/v/pv-diagrams-and-expansion-work] # First Law of Thermodynamics – conserved quantities (Ch. 19-[2 to 9]) #* PV work [https://www.khanacademy.org/science/chemistry/thermodynamics-chemistry/internal-energy-sal/a/pressure-volume-work] 4e58dc1d7d303e72a2f3b3ee266c5402892875ea Courses 0 16 609 538 2017-08-22T17:05:28Z David M. Rogers 2 /* Courses */ wikitext text/x-wiki Here's a list of courses with useful online materials: == Courses == * [[PChemFall2017| USF Physical Chemistry I (2017)]] * [[PChemFall2016| USF Physical Chemistry I (2016)]] * [[GradQuantumFall2013| USF Graduate Quantum Mechanics I]] * [[GradQuantumSpring2014| USF Graduate Quantum Mechanics II]] * [[CompSciSpring2017|Introduction to Scientific Computing (2017)]] * [[CompSciSpring2016|Introduction to Scientific Computing (2016)]] * [[CompSciFall2014|Introduction to Scientific Computing (2014)]] * [http://lambda-the-ultimate.org/classic/Courses.html Functional Programming] == Lecture Series == * [http://www.esqc.org/lectures European Summer School in Quantum Chemistry] == Tutorials == * [[HowTo:Fourier|Fourier transforms]] * [http://www.mathematica-journal.com/2012/02/evaluation-of-gaussian-molecular-integrals Evaluating Matrix Elements] * [http://www.haskell.org/tutorial/ Haskell] * [http://monads.haskell.cz/html/index.html Monads] * [http://www.yosefk.com/blog/my-history-with-forth-stack-machines.html The Forth Language] == Reference Material == * [http://dft.sandia.gov/Quest/DFT_codes.html List of DFT Codes] * [http://docs.python.org/3/tutorial/ Python Tutorial] * [http://www.nwchem-sw.org/index.php/Release62:NWChem_Documentation NWChem Documentation] * [http://www.ebi.ac.uk/pdbe-srv/pdbechem/ PDB Ligand Structures] 74bdf6bd4d15a361eaa6edd99b94984c02a18a10 CompSciSpring2017 0 122 611 598 2018-01-08T14:26:12Z David M. Rogers 2 /* Homework */ wikitext text/x-wiki '''<BIG>Introduction to Scientific Computing</BIG>''' Course Info * Course Numbers CHM 4932-004/6938-010, CRN: 21864/21865 * Credit Hours: 3 * Meeting Dates: January 9 - April 26, 2017 ** No Class Jan. 16 or Mar. 13-17 * Meeting Times: Mon. and Wed., 12:30-13:45 in SCA 222 ** Final Wednesday, May 3, 10:00am – 12:00pm ** Lab Session & Office Hours: Fri. 12:30-13:45 in IDR 214 (or SCA 222 by announcement) == Overview == Mathematical models in the natural sciences take many shapes and forms. The moment they become more complicated than tracking a few variables over time, we have to put away our Excel spreadsheets and make use of a solid foundation in computational science. The course establishes this foundation by introducing data structures and algorithms used in everyday scientific computing using examples in the python scripting language. By the end of the Semester, students will be able to navigate the Linux command-line to go from a mathematical model to a numerical solution. Best practices for working with computer code and visualizing data will also be covered. == Topics == # Languages #* bash (shell) #* python (scripting) #* stack & register-based machine languages: overview of C and Fortran syntax & compiling with gcc, ‘thread safety’ #* Shared libraries & language inter-operability (FFI) # Algorithms #* Horner’s algorithm for polynomials #* Newton’s root finding algo. #* Overview of general optimization algo-s (example: linear & nonlin. least-squares) #* Numerical integration (scripted, plus gnu ODE) #* Communication (how HTTP get/put works) # Data Structures #* Linked Lists #* Trees (file system hierarchies) #* Graphs #* Arrays (dense & sparse) example: vectors & rotations / transpositions, densities and difference operators # Presentation & visualization #* Flat CSV files (and excel) #* Working with binary data #* Python matplotlib (2D images) #* Binning histograms & weighted averages # Best Practices #* High-level code design (modularity, interface specifications, unit testing, etc.) #* Code audit: open-source libraries, ex. Gnu Scientific Library, qsort in libc, Boost #* Source code versioning (example: git or mercurial) #* gdb & execution profiling #* documentation #* Makefiles == Grading == '''Grading Scale (out of 400 points possible)''' {| class="wikitable" |- ! Grade ! Undergraduate ! Graduate |- | A | 230 | 280 |- | B | 180 | 230 |- | C | 150 | 180 |- | D | 120 | 150 |} * Points Possible: ** 10 homework assignments (20 points per homework) ** 2 projects / competitions (100 points per project) * Homework Rules ** For work done in groups, credit is divided equally among participants - so the max homework grade for a group of 2 is 10 points each. ** For each homework, 1 re-do at full credit can be sent at any time after the due date, but must present a unique solution to previous work from yourself or others. ** All work must cite co-group members (if any) and the source of any code snippets used online. === Grading Rationale === Homework points will only be awarded for correct, working code and correct algorithmic analysis, while the homework problems will become progressively tougher. Undergraduates should be able to pass the course with an A if they have correctly answered most of the homework, and made a strong attempt at one of the projects. Graduate students should both perform well on the homework and successfully complete one or two projects. Essentially, this means you should do your own homework when possible and may do a project in a small group. The re-grading and group options for homework allow making up for missed assignments, and encourage returning to core concepts at a later point in the class. Students who have completed significant portions of the homework have thus demonstrated programming proficiency, and are qualified for at least B/C grades. == Projects == * Midterm Project Description [[Media:Midterm2017.pdf]] ** [[Agile|Agile Development Tips & Tricks]] * Final Project Description [[Media:Final2017.pdf]] == Textbooks and Resources == * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-0072-7 Beginning Python, Hetland, 2005] (eBook avail. from USF Library) * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-3238-4 Python Algorithms, Hetland, 2010] (eBook avail. from USF Library) * [http://aosabook.org/en/index.html The Architecture of Open Source Applications] * [http://docs.python.org Python Documentation] * [https://developers.google.com/edu/python/ Google Introductory Python Notes] * [http://huffman.sourceforge.net/tao/tao-of-programming.html Tao of Programming] Other (possibly useful) materials: * [http://hackersdictionary.com/html/entry/larval-stage.html The Jargon File] * Chapters 7&8 of Modelling and Simulation, Birta and Arbez, Springer 2007 (eBook avail. from USF Library). * Chapters 4-6 of Models and Algorithms for Intelligent Data Analysis, Runkler, Springer 2012 (eBook avail. from USF Library). * Guide to Scientific Computing in C++, Francis and Whiteley, Springer, 2012. (eBook avail. from USF Library) * Extra info. On the basics: ** Chapters 3 and 7 of Mathematics in Computing, Regan, Springer 2013. (eBook avail. from USF Library) ** Instant feedback graphical programming with [https://www.khanacademy.org/cs/programming/ Khan Academy] * [http://www.meetup.com/python-178/ Local PyBulls Meetings] Code: * [http://carsonfarmer.com/2013/07/essential-python-geo-libraries Python Libraries Useful for Geospatial Problems] * [[Code#Python_Libraries|Python Libraries Useful for Computational Chemistry]] (very small list at present) Interactive Interpreters: * [http://www.codewars.com CodeWars] Recommended for building experience with practice problems. * [http://codecombat.com/ CodeCombat] A very visual way to interact with your python code. * [http://exercism.io Exercism] A command-line client with a similar learn-through-challenge philosophy. * [http://repl.it repl.it] A read-eval-print loop for several computer languages. * [http://en.cppreference.com/w/cpp/language CppReference] Documentation with an online evaluator for C++ code. === Notes === * [[Media:Intro.pdf|Introduction Notes]] * [[Media:Week2-2017.pdf|Week 2-3 Notes]] * Week 4: read through function syntax in [[Media:Week2.pdf|2016 Week 2]] and for-loops in [[Media:Week3.pdf|2016 Week 3-4]] * In-Class Examples ** [[Turing Exercise]] ** [https://predictivestatmech.org/code/example.dcd Example DCD File] * [[Media:Week-5.2017.pdf|Week 5 Notes]] * [[Media:PlottingMaps.pdf|Week 6 Notes]] ** [[Code:PyTesting]] * [[Media:NumpyArrays.pdf|Week 7 Notes]] ** [http://www.labri.fr/perso/nrougier/from-python-to-numpy/ all about numpy] * Misc. Notes for Week 8 ** [[Physics:Pairs|Rundown of Pair Interactions]] ** Parameterized surfaces [[Media:param1.jpg|1]] and [[Media:param2.jpg|2]] * Notes for Compilation Lab ** [https://learnpythonthehardway.org/book/appendixa.html Command Line Crash Course] Cheat sheet for bash commands. ** USF's compute cluster documentation at [https://wiki.rc.usf.edu/index.php/Main_Page RC Wiki]. *** See especially the "Connecting to SC" and "Modules" sections ** [[Code:Compiling|Cheat-codes]] for compilation lab. * [[Media:jobs.pdf|Research Computing Batch Queue]] * [[Media:Plug-in.pdf|Plugging Into Libraries]] * [[Media:Matrix.pdf|Matrix Algorithms]] === Homework === * Homework will be assigned through Repl.IT ** Homework 1 is due Friday, Jan. 20 ** Homework 2 is due Friday, Jan 27 ** Homework 3 is due Friday, Feb 10 ** Homework 4 is due Friday, Feb 17 ** Homework 5 is due Wednesday, Mar. 8 * Project presentations will be on Wed., Mar 29 ** Homework 6 is due Friday, Mar. 31 ** Homework 7 is due Friday, Apr. 7 ** Homework 8 is due Friday, Apr. 14 ** Homework 9 is due Friday, Apr. 21 ** Homework 10 is due Friday, Apr. 28 * Final Project presentations will be during exam time. Hints for HW 4 <source lang="python"> def translate(nuc): # 1. remove all non-ATGC characters from nuc # str -> str (nuc.translate) # str -> [char], [char] -> str # 2. capitalize all characters : str -> str # 3. translate 3-char blocks # str -> [char] # hint: range(0, len(s), 3) prot = [] for i in range(2): prot += gencode[nuc[i:i+3]] # 4. join characters return "".join(prot) # TODO: fix empty return and string-values! def get_params(sparams): print(sparams) # 1. split sparams on newlines # str -> [str] lines = sparams.split('\n') print(lines) # 2. create an empty dictionary d = {} # 3. for each line, split on ' ' # add key = val to d for line in lines: tok = line.split() print(tok) continue d[tok[0]] = tok[2] return d def newton(x, v, m, k, dt): dxdt = v dvdt = # acceleration (use F = m a), F = (use Hook's law) return (x+dt*dxdt, v+dt*dvdt) </source> 3d plotting example: <source lang="python"> # modified 3d plot from http://matplotlib.org/examples/mplot3d/rotate_axes3d_demo.html from numpy import * import pylab as plt from mpl_toolkits.mplot3d import axes3d def plot_a_list(x): fig = plt.figure() ax = fig.add_subplot(111, projection='3d') x = array(x) X = x[:,0] Y = x[:,1] #[x[0,1], x[1,1], x[2,1], ... Z = x[:,2] # [x[0,2], x[1,2], ... ax.scatter(X, Y, Z) # rotate the axes and update for angle in range(0, 360): ax.view_init(30, angle) plt.draw() plt.pause(.001) x = [ [5,5,0], [6,7,-1], [7, 9, -2], [8, 11, -3], [9, 13, -4]] x.append([10,15,-5]) plot_a_list(x) </source> 10711599f9f067a01173a564f840be094a841e7d CompSciSpring2018 0 142 612 2018-01-08T16:51:17Z David M. Rogers 2 Created page with "'''<BIG>Introduction to Scientific Computing</BIG>''' Course Info * Course Numbers CHM 4932-004/6938-010, CRN: 20438/20439 * Credit Hours: 3 * Meeting Dates: January 8 - Apri..." wikitext text/x-wiki '''<BIG>Introduction to Scientific Computing</BIG>''' Course Info * Course Numbers CHM 4932-004/6938-010, CRN: 20438/20439 * Credit Hours: 3 * Meeting Dates: January 8 - April 25, 2018 ** No Class Jan. 15 or Mar. 12-18 * Meeting Times: Mon. and Wed., 12:30-13:45 in SCA 222 ** Midterm Project Presentations: Mon.-Wed., Mar 5 and 7. ** Final Project Presentations: Wed., May 2, 10:00am – 12:00pm (scheduled final date) ** Lab Session & Office Hours: Fri. 12:30-13:45 in IDR 214 (or SCA 222 by announcement) <pre> $ for((i=1;i<=4;i++)); do cal $i 2018; done ____ January 2018 ____ _____ March 2018 ____ | Su Mo Tu We Th Fr Sa | | Su Mo Tu We Th Fr Sa | 1 2 3 4 5 6 | | 1 (2) 3 1 | 7 8 9*10 11 12 13 | 9 | 4 (5) 6 (7) 8 9 10 2 | 14 x 16*17 18 19 20 | | x x 3 | 21*22 23 24 25 26 27 | 10 | 18*19 20 21 22 23 24 4 | 28*29 30 31 | 11 | 25*26 27 28 29 30 31 ___ February 2018 ____ _____ April 2018 ____ | Su Mo Tu We Th Fr Sa | | Su Mo Tu We Th Fr Sa | 1 2 3 | 12 | 1 *2 3 4 5 6 7 5 | 4 *5 6 7 8 9 10 | 13 | 8 *9 10 11 12 13 14 6 | 11*12 13 14 15 16 17 | 14 | 15*16 17 18 19 20 21 7 | 18*19 20 21 22 23 24 | 15 | 22*23 24(25)26 27 28 8 | 25*26 27 28 | | 29 x Week Topic 1 Calculator Form 2 Pseudocode 3 Plotting 1 (Excel) 4 Plotting 2 (Matplotlib and linear spaces) 5 Abstraction 1 (advanced functions and oo method) 6 Abstraction 2 (Booleans and logic) 7 2D transforms and iterated maps 8 Optimization 1 (Newton-Rhapson) 9 midterm project presentations 10 Optimization 2 (MD Energy) 11 ODE and SDE algorithms 12 Statistics 13 Complexity 14 Circe and Linux crash course 15 Compile & install process, ctypes </pre> == Overview == Mathematical models in the natural sciences take many shapes and forms. The moment they become more complicated than tracking a few variables over time, we have to put away our Excel spreadsheets and make use of a solid foundation in computational science. The course establishes this foundation by introducing data structures and algorithms used in everyday scientific computing using examples in the python scripting language. By the end of the Semester, students will be able to navigate the Linux command-line to go from a mathematical model to a numerical solution. Best practices for working with computer code and visualizing data will also be covered. == Topics == # Languages #* bash (shell) #* python (scripting) #* stack & register-based machine languages: overview of C and Fortran syntax & compiling with gcc, ‘thread safety’ #* Shared libraries & language inter-operability (FFI) # Algorithms #* Horner’s algorithm for polynomials #* Newton’s root finding algo. #* Overview of general optimization algo-s (example: linear & nonlin. least-squares) #* Numerical integration (scripted, plus gnu ODE) #* Communication (how HTTP get/put works) # Data Structures #* Linked Lists #* Trees (file system hierarchies) #* Graphs #* Arrays (dense & sparse) example: vectors & rotations / transpositions, densities and difference operators # Presentation & visualization #* Flat CSV files (and excel) #* Working with binary data #* Python matplotlib (2D images) #* Binning histograms & weighted averages # Best Practices #* High-level code design (modularity, interface specifications, unit testing, etc.) #* Code audit: open-source libraries, ex. Gnu Scientific Library, qsort in libc, Boost #* Source code versioning (example: git or mercurial) #* gdb & execution profiling #* documentation #* Makefiles == Grading == '''Grading Scale (out of 400 points possible)''' {| class="wikitable" |- ! Grade ! Undergraduate ! Graduate |- | A+ | 269 | 323 |- | A | 258 | 310 |- | A- | 250 | 300 |- | B+ | 241 | 290 |- | B | 230 | 276 |- | B- | 222 | 266 |- | C+ | 213 | 256 |- | C | 202 | 243 |- | C- | 194 | 233 |- | D+ | 186 | 223 |- | D | 175 | 210 |- | D- | 166 | 200 |} * (280 U / 330 G) Points Possible: ** 9 homework assignments (10 points per homework) ** 14 in-class assignments / quizzes (10 points per week) ** 2 projects / competitions (50 points per project) ** Undergraduates must complete 1 project, graduates must complete 2 * Important Rules ** For maximum benefit, homework should be done on-time. However, homework will be allowed to be re-submitted at any time for full credit, but must present a unique solution to previous work from yourself or others. ** All work must cite co-group members (if any) and the source of any code snippets used online. === Grading Rationale === Homework points will only be awarded for correct, working code and correct algorithmic analysis, while the homework problems will become progressively tougher. Undergraduates should be able to pass the course with an A if they have correctly answered most of the homework, appear at class prepared and on-time, and made a strong attempt at one of the projects. Graduate students should both perform well on the homework and successfully complete one or two projects. The re-grading for homework allows making up for missed assignments, and encourages returning to core concepts at a later point in the class. Students who have put in the studying effort, completed significant portions of the homework and projects both in- and out of class have thus demonstrated introductory programming proficiency. == Projects == * Midterm Project Description [[Media:Midterm2018.pdf]] (2 Mar., 2018) ** [[Agile|Agile Development Tips & Tricks]] * Final Project Description [[Media:Final2018.pdf]] (25 Apr., 2018) == Textbooks and Resources == * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-0072-7 Beginning Python, Hetland, 2005] (eBook avail. from USF Library) * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-3238-4 Python Algorithms, Hetland, 2010] (eBook avail. from USF Library) * [http://aosabook.org/en/index.html The Architecture of Open Source Applications] * [http://docs.python.org Python Documentation] * [https://developers.google.com/edu/python/ Google Introductory Python Notes] * [http://huffman.sourceforge.net/tao/tao-of-programming.html Tao of Programming] Other (possibly useful) materials: * [http://hackersdictionary.com/html/entry/larval-stage.html The Jargon File] * Chapters 7&8 of Modelling and Simulation, Birta and Arbez, Springer 2007 (eBook avail. from USF Library). * Chapters 4-6 of Models and Algorithms for Intelligent Data Analysis, Runkler, Springer 2012 (eBook avail. from USF Library). * Guide to Scientific Computing in C++, Francis and Whiteley, Springer, 2012. (eBook avail. from USF Library) * Extra info. On the basics: ** Chapters 3 and 7 of Mathematics in Computing, Regan, Springer 2013. (eBook avail. from USF Library) ** Instant feedback graphical programming with [https://www.khanacademy.org/cs/programming/ Khan Academy] * [http://www.meetup.com/python-178/ Local PyBulls Meetings] Code: * [http://carsonfarmer.com/2013/07/essential-python-geo-libraries Python Libraries Useful for Geospatial Problems] * [[Code#Python_Libraries|Python Libraries Useful for Computational Chemistry]] (very small list at present) Interactive Interpreters: * [http://www.codewars.com CodeWars] Recommended for building experience with practice problems. * [http://codecombat.com/ CodeCombat] A very visual way to interact with your python code. * [http://exercism.io Exercism] A command-line client with a similar learn-through-challenge philosophy. * [http://repl.it repl.it] A read-eval-print loop for several computer languages. * [http://en.cppreference.com/w/cpp/language CppReference] Documentation with an online evaluator for C++ code. === Notes === * [[Media:Intro.pdf|Introduction Notes]] <!-- * [[Media:Week2-2017.pdf|Week 2-3 Notes]] * Week 4: read through function syntax in [[Media:Week2.pdf|2016 Week 2]] and for-loops in [[Media:Week3.pdf|2016 Week 3-4]] * In-Class Examples ** [[Turing Exercise]] ** [https://predictivestatmech.org/code/example.dcd Example DCD File] * [[Media:Week-5.2017.pdf|Week 5 Notes]] * [[Media:PlottingMaps.pdf|Week 6 Notes]] ** [[Code:PyTesting]] * [[Media:NumpyArrays.pdf|Week 7 Notes]] ** [http://www.labri.fr/perso/nrougier/from-python-to-numpy/ all about numpy] * Misc. Notes for Week 8 ** [[Physics:Pairs|Rundown of Pair Interactions]] ** Parameterized surfaces [[Media:param1.jpg|1]] and [[Media:param2.jpg|2]] * Notes for Compilation Lab ** [https://learnpythonthehardway.org/book/appendixa.html Command Line Crash Course] Cheat sheet for bash commands. ** USF's compute cluster documentation at [https://wiki.rc.usf.edu/index.php/Main_Page RC Wiki]. *** See especially the "Connecting to SC" and "Modules" sections ** [[Code:Compiling|Cheat-codes]] for compilation lab. * [[Media:jobs.pdf|Research Computing Batch Queue]] * [[Media:Plug-in.pdf|Plugging Into Libraries]] * [[Media:Matrix.pdf|Matrix Algorithms]] --> === Homework === * Homework will be assigned through Repl.IT * Project presentations will be on Mon.-Wed., Mar 5-7 * Final Project presentations will be during exam time, Wed., May 2 bcb994c888adaf62999121813f3ae9494a2ca43b 615 612 2018-01-09T21:11:14Z David M. Rogers 2 wikitext text/x-wiki '''<BIG>Introduction to Scientific Computing</BIG>''' Course Info * Course Numbers CHM 4932-004/6938-010, CRN: 20438/20439 * Credit Hours: 3 * Meeting Dates: January 8 - April 25, 2018 ** No Class Jan. 15 or Mar. 12-18 * Meeting Times: Mon. and Wed., 12:30-13:45 in SCA 222 ** Midterm Project Presentations: Mon.-Wed., Mar 5 and 7. ** Final Project Presentations: Wed., May 2, 10:00am – 12:00pm (scheduled final date) ** Lab Session & Office Hours: Fri. 12:30-13:45 in IDR 214 (or SCA 222 by announcement) <pre> $ for((i=1;i<=4;i++)); do cal $i 2018; done ____ January 2018 ____ _____ March 2018 ____ | Su Mo Tu We Th Fr Sa | | Su Mo Tu We Th Fr Sa | 1 2 3 4 5 6 | | 1 (2) 3 1 | 7 8 9*10 11 12 13 | 9 | 4 (5) 6 (7) 8 9 10 2 | 14 x 16*17 18 19 20 | | x x 3 | 21*22 23 24 25 26 27 | 10 | 18*19 20 21 22 23 24 4 | 28*29 30 31 | 11 | 25*26 27 28 29 30 31 ___ February 2018 ____ _____ April 2018 ____ | Su Mo Tu We Th Fr Sa | | Su Mo Tu We Th Fr Sa | 1 2 3 | 12 | 1 *2 3 4 5 6 7 5 | 4 *5 6 7 8 9 10 | 13 | 8 *9 10 11 12 13 14 6 | 11*12 13 14 15 16 17 | 14 | 15*16 17 18 19 20 21 7 | 18*19 20 21 22 23 24 | 15 | 22*23 24(25)26 27 28 8 | 25*26 27 28 | | 29 x Week Topic 1 Calculator Form 2 Pseudocode 3 Plotting 1 (Excel) 4 Plotting 2 (Matplotlib and linear spaces) 5 Abstraction 1 (advanced functions and oo method) 6 Abstraction 2 (Booleans and logic) 7 2D transforms and iterated maps 8 Optimization 1 (Newton-Rhapson) 9 midterm project presentations 10 Optimization 2 (MD Energy) 11 ODE and SDE algorithms 12 Statistics 13 Complexity 14 Circe and Linux crash course 15 Compile & install process, ctypes </pre> == Overview == Mathematical models in the natural sciences take many shapes and forms. The moment they become more complicated than tracking a few variables over time, we have to put away our Excel spreadsheets and make use of a solid foundation in computational science. The course establishes this foundation by introducing data structures and algorithms used in everyday scientific computing using examples in the python scripting language. By the end of the Semester, students will be able to navigate the Linux command-line to go from a mathematical model to a numerical solution. Best practices for working with computer code and visualizing data will also be covered. == Topics == # Languages #* bash (shell) #* python (scripting) #* stack & register-based machine languages: overview of C and Fortran syntax & compiling with gcc, ‘thread safety’ #* Shared libraries & language inter-operability (FFI) # Algorithms #* Horner’s algorithm for polynomials #* Newton’s root finding algo. #* Overview of general optimization algo-s (example: linear & nonlin. least-squares) #* Numerical integration (scripted, plus gnu ODE) #* Communication (how HTTP get/put works) # Data Structures #* Linked Lists #* Trees (file system hierarchies) #* Graphs #* Arrays (dense & sparse) example: vectors & rotations / transpositions, densities and difference operators # Presentation & visualization #* Flat CSV files (and excel) #* Working with binary data #* Python matplotlib (2D images) #* Binning histograms & weighted averages # Best Practices #* High-level code design (modularity, interface specifications, unit testing, etc.) #* Code audit: open-source libraries, ex. Gnu Scientific Library, qsort in libc, Boost #* Source code versioning (example: git or mercurial) #* gdb & execution profiling #* documentation #* Makefiles == Grading == '''Grading Scale (out of 400 points possible)''' {| class="wikitable" |- ! Grade ! Undergraduate ! Graduate |- | A+ | 269 | 323 |- | A | 258 | 310 |- | A- | 250 | 300 |- | B+ | 241 | 290 |- | B | 230 | 276 |- | B- | 222 | 266 |- | C+ | 213 | 256 |- | C | 202 | 243 |- | C- | 194 | 233 |- | D+ | 186 | 223 |- | D | 175 | 210 |- | D- | 166 | 200 |} * (280 U / 330 G) Points Possible: ** 9 homework assignments (10 points per homework) ** 14 in-class assignments / quizzes (10 points per week) ** 2 projects / competitions (50 points per project) ** Undergraduates must complete 1 project, graduates must complete 2 * Important Rules ** For maximum benefit, homework should be done on-time. However, homework will be allowed to be re-submitted at any time for full credit, but must present a unique solution to previous work from yourself or others. ** All work must cite co-group members (if any) and the source of any code snippets used online. === Grading Rationale === Homework points will only be awarded for correct, working code and correct algorithmic analysis, while the homework problems will become progressively tougher. Undergraduates should be able to pass the course with an A if they have correctly answered most of the homework, appear at class prepared and on-time, and made a strong attempt at one of the projects. Graduate students should both perform well on the homework and successfully complete one or two projects. The re-grading for homework allows making up for missed assignments, and encourages returning to core concepts at a later point in the class. Students who have put in the studying effort, completed significant portions of the homework and projects both in- and out of class have thus demonstrated introductory programming proficiency. == Projects == * Midterm Project Description [[Media:Midterm2018.pdf]] (2 Mar., 2018) ** [[Agile|Agile Development Tips & Tricks]] * Final Project Description [[Media:Final2018.pdf]] (25 Apr., 2018) == Textbooks and Resources == * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-0072-7 Beginning Python, Hetland, 2005] (eBook avail. from USF Library) * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-3238-4 Python Algorithms, Hetland, 2010] (eBook avail. from USF Library) * [http://aosabook.org/en/index.html The Architecture of Open Source Applications] * [http://docs.python.org Python Documentation] * [https://developers.google.com/edu/python/ Google Introductory Python Notes] * [http://huffman.sourceforge.net/tao/tao-of-programming.html Tao of Programming] Other (possibly useful) materials: * [http://hackersdictionary.com/html/entry/larval-stage.html The Jargon File] * Chapters 7&8 of Modelling and Simulation, Birta and Arbez, Springer 2007 (eBook avail. from USF Library). * Chapters 4-6 of Models and Algorithms for Intelligent Data Analysis, Runkler, Springer 2012 (eBook avail. from USF Library). * Guide to Scientific Computing in C++, Francis and Whiteley, Springer, 2012. (eBook avail. from USF Library) * Extra info. On the basics: ** Chapters 3 and 7 of Mathematics in Computing, Regan, Springer 2013. (eBook avail. from USF Library) ** Instant feedback graphical programming with [https://www.khanacademy.org/cs/programming/ Khan Academy] * [http://www.meetup.com/python-178/ Local PyBulls Meetings] Code: * [http://carsonfarmer.com/2013/07/essential-python-geo-libraries Python Libraries Useful for Geospatial Problems] * [[Code#Python_Libraries|Python Libraries Useful for Computational Chemistry]] (very small list at present) Interactive Interpreters: * [http://www.codewars.com CodeWars] Recommended for building experience with practice problems. * [http://codecombat.com/ CodeCombat] A very visual way to interact with your python code. * [http://exercism.io Exercism] A command-line client with a similar learn-through-challenge philosophy. * [http://repl.it repl.it] A read-eval-print loop for several computer languages. * [http://en.cppreference.com/w/cpp/language CppReference] Documentation with an online evaluator for C++ code. === Notes === * [[Media:Intro.pdf|Introduction Notes]] <!-- * [[Media:Week2-2017.pdf|Week 2-3 Notes]] * Week 4: read through function syntax in [[Media:Week2.pdf|2016 Week 2]] and for-loops in [[Media:Week3.pdf|2016 Week 3-4]] * In-Class Examples ** [[Turing Exercise]] ** [https://predictivestatmech.org/code/example.dcd Example DCD File] * [[Media:Week-5.2017.pdf|Week 5 Notes]] * [[Media:PlottingMaps.pdf|Week 6 Notes]] ** [[Code:PyTesting]] * [[Media:NumpyArrays.pdf|Week 7 Notes]] ** [http://www.labri.fr/perso/nrougier/from-python-to-numpy/ all about numpy] * Misc. Notes for Week 8 ** [[Physics:Pairs|Rundown of Pair Interactions]] ** Parameterized surfaces [[Media:param1.jpg|1]] and [[Media:param2.jpg|2]] * Notes for Compilation Lab ** [https://learnpythonthehardway.org/book/appendixa.html Command Line Crash Course] Cheat sheet for bash commands. ** USF's compute cluster documentation at [https://wiki.rc.usf.edu/index.php/Main_Page RC Wiki]. *** See especially the "Connecting to SC" and "Modules" sections ** [[Code:Compiling|Cheat-codes]] for compilation lab. * [[Media:jobs.pdf|Research Computing Batch Queue]] * [[Media:Plug-in.pdf|Plugging Into Libraries]] * [[Media:Matrix.pdf|Matrix Algorithms]] --> === In-Class Problems === * Week 1: [[Media:CalculatorProbs.pdf|Calculator Problems]] === Homework === * Homework will be assigned through Repl.IT * Project presentations will be on Mon.-Wed., Mar 5-7 * Final Project presentations will be during exam time, Wed., May 2 29827addc0644b4fd9ef0cb9f017748033bbce9d 616 615 2018-01-10T18:10:58Z David M. Rogers 2 /* In-Class Problems */ wikitext text/x-wiki '''<BIG>Introduction to Scientific Computing</BIG>''' Course Info * Course Numbers CHM 4932-004/6938-010, CRN: 20438/20439 * Credit Hours: 3 * Meeting Dates: January 8 - April 25, 2018 ** No Class Jan. 15 or Mar. 12-18 * Meeting Times: Mon. and Wed., 12:30-13:45 in SCA 222 ** Midterm Project Presentations: Mon.-Wed., Mar 5 and 7. ** Final Project Presentations: Wed., May 2, 10:00am – 12:00pm (scheduled final date) ** Lab Session & Office Hours: Fri. 12:30-13:45 in IDR 214 (or SCA 222 by announcement) <pre> $ for((i=1;i<=4;i++)); do cal $i 2018; done ____ January 2018 ____ _____ March 2018 ____ | Su Mo Tu We Th Fr Sa | | Su Mo Tu We Th Fr Sa | 1 2 3 4 5 6 | | 1 (2) 3 1 | 7 8 9*10 11 12 13 | 9 | 4 (5) 6 (7) 8 9 10 2 | 14 x 16*17 18 19 20 | | x x 3 | 21*22 23 24 25 26 27 | 10 | 18*19 20 21 22 23 24 4 | 28*29 30 31 | 11 | 25*26 27 28 29 30 31 ___ February 2018 ____ _____ April 2018 ____ | Su Mo Tu We Th Fr Sa | | Su Mo Tu We Th Fr Sa | 1 2 3 | 12 | 1 *2 3 4 5 6 7 5 | 4 *5 6 7 8 9 10 | 13 | 8 *9 10 11 12 13 14 6 | 11*12 13 14 15 16 17 | 14 | 15*16 17 18 19 20 21 7 | 18*19 20 21 22 23 24 | 15 | 22*23 24(25)26 27 28 8 | 25*26 27 28 | | 29 x Week Topic 1 Calculator Form 2 Pseudocode 3 Plotting 1 (Excel) 4 Plotting 2 (Matplotlib and linear spaces) 5 Abstraction 1 (advanced functions and oo method) 6 Abstraction 2 (Booleans and logic) 7 2D transforms and iterated maps 8 Optimization 1 (Newton-Rhapson) 9 midterm project presentations 10 Optimization 2 (MD Energy) 11 ODE and SDE algorithms 12 Statistics 13 Complexity 14 Circe and Linux crash course 15 Compile & install process, ctypes </pre> == Overview == Mathematical models in the natural sciences take many shapes and forms. The moment they become more complicated than tracking a few variables over time, we have to put away our Excel spreadsheets and make use of a solid foundation in computational science. The course establishes this foundation by introducing data structures and algorithms used in everyday scientific computing using examples in the python scripting language. By the end of the Semester, students will be able to navigate the Linux command-line to go from a mathematical model to a numerical solution. Best practices for working with computer code and visualizing data will also be covered. == Topics == # Languages #* bash (shell) #* python (scripting) #* stack & register-based machine languages: overview of C and Fortran syntax & compiling with gcc, ‘thread safety’ #* Shared libraries & language inter-operability (FFI) # Algorithms #* Horner’s algorithm for polynomials #* Newton’s root finding algo. #* Overview of general optimization algo-s (example: linear & nonlin. least-squares) #* Numerical integration (scripted, plus gnu ODE) #* Communication (how HTTP get/put works) # Data Structures #* Linked Lists #* Trees (file system hierarchies) #* Graphs #* Arrays (dense & sparse) example: vectors & rotations / transpositions, densities and difference operators # Presentation & visualization #* Flat CSV files (and excel) #* Working with binary data #* Python matplotlib (2D images) #* Binning histograms & weighted averages # Best Practices #* High-level code design (modularity, interface specifications, unit testing, etc.) #* Code audit: open-source libraries, ex. Gnu Scientific Library, qsort in libc, Boost #* Source code versioning (example: git or mercurial) #* gdb & execution profiling #* documentation #* Makefiles == Grading == '''Grading Scale (out of 400 points possible)''' {| class="wikitable" |- ! Grade ! Undergraduate ! Graduate |- | A+ | 269 | 323 |- | A | 258 | 310 |- | A- | 250 | 300 |- | B+ | 241 | 290 |- | B | 230 | 276 |- | B- | 222 | 266 |- | C+ | 213 | 256 |- | C | 202 | 243 |- | C- | 194 | 233 |- | D+ | 186 | 223 |- | D | 175 | 210 |- | D- | 166 | 200 |} * (280 U / 330 G) Points Possible: ** 9 homework assignments (10 points per homework) ** 14 in-class assignments / quizzes (10 points per week) ** 2 projects / competitions (50 points per project) ** Undergraduates must complete 1 project, graduates must complete 2 * Important Rules ** For maximum benefit, homework should be done on-time. However, homework will be allowed to be re-submitted at any time for full credit, but must present a unique solution to previous work from yourself or others. ** All work must cite co-group members (if any) and the source of any code snippets used online. === Grading Rationale === Homework points will only be awarded for correct, working code and correct algorithmic analysis, while the homework problems will become progressively tougher. Undergraduates should be able to pass the course with an A if they have correctly answered most of the homework, appear at class prepared and on-time, and made a strong attempt at one of the projects. Graduate students should both perform well on the homework and successfully complete one or two projects. The re-grading for homework allows making up for missed assignments, and encourages returning to core concepts at a later point in the class. Students who have put in the studying effort, completed significant portions of the homework and projects both in- and out of class have thus demonstrated introductory programming proficiency. == Projects == * Midterm Project Description [[Media:Midterm2018.pdf]] (2 Mar., 2018) ** [[Agile|Agile Development Tips & Tricks]] * Final Project Description [[Media:Final2018.pdf]] (25 Apr., 2018) == Textbooks and Resources == * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-0072-7 Beginning Python, Hetland, 2005] (eBook avail. from USF Library) * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-3238-4 Python Algorithms, Hetland, 2010] (eBook avail. from USF Library) * [http://aosabook.org/en/index.html The Architecture of Open Source Applications] * [http://docs.python.org Python Documentation] * [https://developers.google.com/edu/python/ Google Introductory Python Notes] * [http://huffman.sourceforge.net/tao/tao-of-programming.html Tao of Programming] Other (possibly useful) materials: * [http://hackersdictionary.com/html/entry/larval-stage.html The Jargon File] * Chapters 7&8 of Modelling and Simulation, Birta and Arbez, Springer 2007 (eBook avail. from USF Library). * Chapters 4-6 of Models and Algorithms for Intelligent Data Analysis, Runkler, Springer 2012 (eBook avail. from USF Library). * Guide to Scientific Computing in C++, Francis and Whiteley, Springer, 2012. (eBook avail. from USF Library) * Extra info. On the basics: ** Chapters 3 and 7 of Mathematics in Computing, Regan, Springer 2013. (eBook avail. from USF Library) ** Instant feedback graphical programming with [https://www.khanacademy.org/cs/programming/ Khan Academy] * [http://www.meetup.com/python-178/ Local PyBulls Meetings] Code: * [http://carsonfarmer.com/2013/07/essential-python-geo-libraries Python Libraries Useful for Geospatial Problems] * [[Code#Python_Libraries|Python Libraries Useful for Computational Chemistry]] (very small list at present) Interactive Interpreters: * [http://www.codewars.com CodeWars] Recommended for building experience with practice problems. * [http://codecombat.com/ CodeCombat] A very visual way to interact with your python code. * [http://exercism.io Exercism] A command-line client with a similar learn-through-challenge philosophy. * [http://repl.it repl.it] A read-eval-print loop for several computer languages. * [http://en.cppreference.com/w/cpp/language CppReference] Documentation with an online evaluator for C++ code. === Notes === * [[Media:Intro.pdf|Introduction Notes]] <!-- * [[Media:Week2-2017.pdf|Week 2-3 Notes]] * Week 4: read through function syntax in [[Media:Week2.pdf|2016 Week 2]] and for-loops in [[Media:Week3.pdf|2016 Week 3-4]] * In-Class Examples ** [[Turing Exercise]] ** [https://predictivestatmech.org/code/example.dcd Example DCD File] * [[Media:Week-5.2017.pdf|Week 5 Notes]] * [[Media:PlottingMaps.pdf|Week 6 Notes]] ** [[Code:PyTesting]] * [[Media:NumpyArrays.pdf|Week 7 Notes]] ** [http://www.labri.fr/perso/nrougier/from-python-to-numpy/ all about numpy] * Misc. Notes for Week 8 ** [[Physics:Pairs|Rundown of Pair Interactions]] ** Parameterized surfaces [[Media:param1.jpg|1]] and [[Media:param2.jpg|2]] * Notes for Compilation Lab ** [https://learnpythonthehardway.org/book/appendixa.html Command Line Crash Course] Cheat sheet for bash commands. ** USF's compute cluster documentation at [https://wiki.rc.usf.edu/index.php/Main_Page RC Wiki]. *** See especially the "Connecting to SC" and "Modules" sections ** [[Code:Compiling|Cheat-codes]] for compilation lab. * [[Media:jobs.pdf|Research Computing Batch Queue]] * [[Media:Plug-in.pdf|Plugging Into Libraries]] * [[Media:Matrix.pdf|Matrix Algorithms]] --> === In-Class Problems === * Week 1: [[Media:CalculatorProbs.pdf|Calculator Problems]] ** Solutions: [https://docs.google.com/document/d/1HRkSdVNsTUydY4cVx67jRHRyhi5gL6nneEj9IX89wlE/edit?usp=sharing] === Homework === * Homework will be assigned through Repl.IT * Project presentations will be on Mon.-Wed., Mar 5-7 * Final Project presentations will be during exam time, Wed., May 2 c11e69221533f53d60e854d2f197b61500d02e90 617 616 2018-01-15T23:18:51Z David M. Rogers 2 /* In-Class Problems */ wikitext text/x-wiki '''<BIG>Introduction to Scientific Computing</BIG>''' Course Info * Course Numbers CHM 4932-004/6938-010, CRN: 20438/20439 * Credit Hours: 3 * Meeting Dates: January 8 - April 25, 2018 ** No Class Jan. 15 or Mar. 12-18 * Meeting Times: Mon. and Wed., 12:30-13:45 in SCA 222 ** Midterm Project Presentations: Mon.-Wed., Mar 5 and 7. ** Final Project Presentations: Wed., May 2, 10:00am – 12:00pm (scheduled final date) ** Lab Session & Office Hours: Fri. 12:30-13:45 in IDR 214 (or SCA 222 by announcement) <pre> $ for((i=1;i<=4;i++)); do cal $i 2018; done ____ January 2018 ____ _____ March 2018 ____ | Su Mo Tu We Th Fr Sa | | Su Mo Tu We Th Fr Sa | 1 2 3 4 5 6 | | 1 (2) 3 1 | 7 8 9*10 11 12 13 | 9 | 4 (5) 6 (7) 8 9 10 2 | 14 x 16*17 18 19 20 | | x x 3 | 21*22 23 24 25 26 27 | 10 | 18*19 20 21 22 23 24 4 | 28*29 30 31 | 11 | 25*26 27 28 29 30 31 ___ February 2018 ____ _____ April 2018 ____ | Su Mo Tu We Th Fr Sa | | Su Mo Tu We Th Fr Sa | 1 2 3 | 12 | 1 *2 3 4 5 6 7 5 | 4 *5 6 7 8 9 10 | 13 | 8 *9 10 11 12 13 14 6 | 11*12 13 14 15 16 17 | 14 | 15*16 17 18 19 20 21 7 | 18*19 20 21 22 23 24 | 15 | 22*23 24(25)26 27 28 8 | 25*26 27 28 | | 29 x Week Topic 1 Calculator Form 2 Pseudocode 3 Plotting 1 (Excel) 4 Plotting 2 (Matplotlib and linear spaces) 5 Abstraction 1 (advanced functions and oo method) 6 Abstraction 2 (Booleans and logic) 7 2D transforms and iterated maps 8 Optimization 1 (Newton-Rhapson) 9 midterm project presentations 10 Optimization 2 (MD Energy) 11 ODE and SDE algorithms 12 Statistics 13 Complexity 14 Circe and Linux crash course 15 Compile & install process, ctypes </pre> == Overview == Mathematical models in the natural sciences take many shapes and forms. The moment they become more complicated than tracking a few variables over time, we have to put away our Excel spreadsheets and make use of a solid foundation in computational science. The course establishes this foundation by introducing data structures and algorithms used in everyday scientific computing using examples in the python scripting language. By the end of the Semester, students will be able to navigate the Linux command-line to go from a mathematical model to a numerical solution. Best practices for working with computer code and visualizing data will also be covered. == Topics == # Languages #* bash (shell) #* python (scripting) #* stack & register-based machine languages: overview of C and Fortran syntax & compiling with gcc, ‘thread safety’ #* Shared libraries & language inter-operability (FFI) # Algorithms #* Horner’s algorithm for polynomials #* Newton’s root finding algo. #* Overview of general optimization algo-s (example: linear & nonlin. least-squares) #* Numerical integration (scripted, plus gnu ODE) #* Communication (how HTTP get/put works) # Data Structures #* Linked Lists #* Trees (file system hierarchies) #* Graphs #* Arrays (dense & sparse) example: vectors & rotations / transpositions, densities and difference operators # Presentation & visualization #* Flat CSV files (and excel) #* Working with binary data #* Python matplotlib (2D images) #* Binning histograms & weighted averages # Best Practices #* High-level code design (modularity, interface specifications, unit testing, etc.) #* Code audit: open-source libraries, ex. Gnu Scientific Library, qsort in libc, Boost #* Source code versioning (example: git or mercurial) #* gdb & execution profiling #* documentation #* Makefiles == Grading == '''Grading Scale (out of 400 points possible)''' {| class="wikitable" |- ! Grade ! Undergraduate ! Graduate |- | A+ | 269 | 323 |- | A | 258 | 310 |- | A- | 250 | 300 |- | B+ | 241 | 290 |- | B | 230 | 276 |- | B- | 222 | 266 |- | C+ | 213 | 256 |- | C | 202 | 243 |- | C- | 194 | 233 |- | D+ | 186 | 223 |- | D | 175 | 210 |- | D- | 166 | 200 |} * (280 U / 330 G) Points Possible: ** 9 homework assignments (10 points per homework) ** 14 in-class assignments / quizzes (10 points per week) ** 2 projects / competitions (50 points per project) ** Undergraduates must complete 1 project, graduates must complete 2 * Important Rules ** For maximum benefit, homework should be done on-time. However, homework will be allowed to be re-submitted at any time for full credit, but must present a unique solution to previous work from yourself or others. ** All work must cite co-group members (if any) and the source of any code snippets used online. === Grading Rationale === Homework points will only be awarded for correct, working code and correct algorithmic analysis, while the homework problems will become progressively tougher. Undergraduates should be able to pass the course with an A if they have correctly answered most of the homework, appear at class prepared and on-time, and made a strong attempt at one of the projects. Graduate students should both perform well on the homework and successfully complete one or two projects. The re-grading for homework allows making up for missed assignments, and encourages returning to core concepts at a later point in the class. Students who have put in the studying effort, completed significant portions of the homework and projects both in- and out of class have thus demonstrated introductory programming proficiency. == Projects == * Midterm Project Description [[Media:Midterm2018.pdf]] (2 Mar., 2018) ** [[Agile|Agile Development Tips & Tricks]] * Final Project Description [[Media:Final2018.pdf]] (25 Apr., 2018) == Textbooks and Resources == * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-0072-7 Beginning Python, Hetland, 2005] (eBook avail. from USF Library) * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-3238-4 Python Algorithms, Hetland, 2010] (eBook avail. from USF Library) * [http://aosabook.org/en/index.html The Architecture of Open Source Applications] * [http://docs.python.org Python Documentation] * [https://developers.google.com/edu/python/ Google Introductory Python Notes] * [http://huffman.sourceforge.net/tao/tao-of-programming.html Tao of Programming] Other (possibly useful) materials: * [http://hackersdictionary.com/html/entry/larval-stage.html The Jargon File] * Chapters 7&8 of Modelling and Simulation, Birta and Arbez, Springer 2007 (eBook avail. from USF Library). * Chapters 4-6 of Models and Algorithms for Intelligent Data Analysis, Runkler, Springer 2012 (eBook avail. from USF Library). * Guide to Scientific Computing in C++, Francis and Whiteley, Springer, 2012. (eBook avail. from USF Library) * Extra info. On the basics: ** Chapters 3 and 7 of Mathematics in Computing, Regan, Springer 2013. (eBook avail. from USF Library) ** Instant feedback graphical programming with [https://www.khanacademy.org/cs/programming/ Khan Academy] * [http://www.meetup.com/python-178/ Local PyBulls Meetings] Code: * [http://carsonfarmer.com/2013/07/essential-python-geo-libraries Python Libraries Useful for Geospatial Problems] * [[Code#Python_Libraries|Python Libraries Useful for Computational Chemistry]] (very small list at present) Interactive Interpreters: * [http://www.codewars.com CodeWars] Recommended for building experience with practice problems. * [http://codecombat.com/ CodeCombat] A very visual way to interact with your python code. * [http://exercism.io Exercism] A command-line client with a similar learn-through-challenge philosophy. * [http://repl.it repl.it] A read-eval-print loop for several computer languages. * [http://en.cppreference.com/w/cpp/language CppReference] Documentation with an online evaluator for C++ code. === Notes === * [[Media:Intro.pdf|Introduction Notes]] <!-- * [[Media:Week2-2017.pdf|Week 2-3 Notes]] * Week 4: read through function syntax in [[Media:Week2.pdf|2016 Week 2]] and for-loops in [[Media:Week3.pdf|2016 Week 3-4]] * In-Class Examples ** [[Turing Exercise]] ** [https://predictivestatmech.org/code/example.dcd Example DCD File] * [[Media:Week-5.2017.pdf|Week 5 Notes]] * [[Media:PlottingMaps.pdf|Week 6 Notes]] ** [[Code:PyTesting]] * [[Media:NumpyArrays.pdf|Week 7 Notes]] ** [http://www.labri.fr/perso/nrougier/from-python-to-numpy/ all about numpy] * Misc. Notes for Week 8 ** [[Physics:Pairs|Rundown of Pair Interactions]] ** Parameterized surfaces [[Media:param1.jpg|1]] and [[Media:param2.jpg|2]] * Notes for Compilation Lab ** [https://learnpythonthehardway.org/book/appendixa.html Command Line Crash Course] Cheat sheet for bash commands. ** USF's compute cluster documentation at [https://wiki.rc.usf.edu/index.php/Main_Page RC Wiki]. *** See especially the "Connecting to SC" and "Modules" sections ** [[Code:Compiling|Cheat-codes]] for compilation lab. * [[Media:jobs.pdf|Research Computing Batch Queue]] * [[Media:Plug-in.pdf|Plugging Into Libraries]] * [[Media:Matrix.pdf|Matrix Algorithms]] --> === In-Class Problems === * Week 1: [[Media:CalculatorProbs.pdf|Calculator Problems]] ** Solutions: [http://predictivestatmech.org/terms/term.html] ** This solution uses python list comprehensions, and shows that the slowest step is actually unit conversion! === Homework === * Homework will be assigned through Repl.IT * Project presentations will be on Mon.-Wed., Mar 5-7 * Final Project presentations will be during exam time, Wed., May 2 a88aab1acd488836b7e15513acb04fbad9db960d 618 617 2018-01-17T00:02:46Z David M. Rogers 2 /* In-Class Problems */ wikitext text/x-wiki '''<BIG>Introduction to Scientific Computing</BIG>''' Course Info * Course Numbers CHM 4932-004/6938-010, CRN: 20438/20439 * Credit Hours: 3 * Meeting Dates: January 8 - April 25, 2018 ** No Class Jan. 15 or Mar. 12-18 * Meeting Times: Mon. and Wed., 12:30-13:45 in SCA 222 ** Midterm Project Presentations: Mon.-Wed., Mar 5 and 7. ** Final Project Presentations: Wed., May 2, 10:00am – 12:00pm (scheduled final date) ** Lab Session & Office Hours: Fri. 12:30-13:45 in IDR 214 (or SCA 222 by announcement) <pre> $ for((i=1;i<=4;i++)); do cal $i 2018; done ____ January 2018 ____ _____ March 2018 ____ | Su Mo Tu We Th Fr Sa | | Su Mo Tu We Th Fr Sa | 1 2 3 4 5 6 | | 1 (2) 3 1 | 7 8 9*10 11 12 13 | 9 | 4 (5) 6 (7) 8 9 10 2 | 14 x 16*17 18 19 20 | | x x 3 | 21*22 23 24 25 26 27 | 10 | 18*19 20 21 22 23 24 4 | 28*29 30 31 | 11 | 25*26 27 28 29 30 31 ___ February 2018 ____ _____ April 2018 ____ | Su Mo Tu We Th Fr Sa | | Su Mo Tu We Th Fr Sa | 1 2 3 | 12 | 1 *2 3 4 5 6 7 5 | 4 *5 6 7 8 9 10 | 13 | 8 *9 10 11 12 13 14 6 | 11*12 13 14 15 16 17 | 14 | 15*16 17 18 19 20 21 7 | 18*19 20 21 22 23 24 | 15 | 22*23 24(25)26 27 28 8 | 25*26 27 28 | | 29 x Week Topic 1 Calculator Form 2 Pseudocode 3 Plotting 1 (Excel) 4 Plotting 2 (Matplotlib and linear spaces) 5 Abstraction 1 (advanced functions and oo method) 6 Abstraction 2 (Booleans and logic) 7 2D transforms and iterated maps 8 Optimization 1 (Newton-Rhapson) 9 midterm project presentations 10 Optimization 2 (MD Energy) 11 ODE and SDE algorithms 12 Statistics 13 Complexity 14 Circe and Linux crash course 15 Compile & install process, ctypes </pre> == Overview == Mathematical models in the natural sciences take many shapes and forms. The moment they become more complicated than tracking a few variables over time, we have to put away our Excel spreadsheets and make use of a solid foundation in computational science. The course establishes this foundation by introducing data structures and algorithms used in everyday scientific computing using examples in the python scripting language. By the end of the Semester, students will be able to navigate the Linux command-line to go from a mathematical model to a numerical solution. Best practices for working with computer code and visualizing data will also be covered. == Topics == # Languages #* bash (shell) #* python (scripting) #* stack & register-based machine languages: overview of C and Fortran syntax & compiling with gcc, ‘thread safety’ #* Shared libraries & language inter-operability (FFI) # Algorithms #* Horner’s algorithm for polynomials #* Newton’s root finding algo. #* Overview of general optimization algo-s (example: linear & nonlin. least-squares) #* Numerical integration (scripted, plus gnu ODE) #* Communication (how HTTP get/put works) # Data Structures #* Linked Lists #* Trees (file system hierarchies) #* Graphs #* Arrays (dense & sparse) example: vectors & rotations / transpositions, densities and difference operators # Presentation & visualization #* Flat CSV files (and excel) #* Working with binary data #* Python matplotlib (2D images) #* Binning histograms & weighted averages # Best Practices #* High-level code design (modularity, interface specifications, unit testing, etc.) #* Code audit: open-source libraries, ex. Gnu Scientific Library, qsort in libc, Boost #* Source code versioning (example: git or mercurial) #* gdb & execution profiling #* documentation #* Makefiles == Grading == '''Grading Scale (out of 400 points possible)''' {| class="wikitable" |- ! Grade ! Undergraduate ! Graduate |- | A+ | 269 | 323 |- | A | 258 | 310 |- | A- | 250 | 300 |- | B+ | 241 | 290 |- | B | 230 | 276 |- | B- | 222 | 266 |- | C+ | 213 | 256 |- | C | 202 | 243 |- | C- | 194 | 233 |- | D+ | 186 | 223 |- | D | 175 | 210 |- | D- | 166 | 200 |} * (280 U / 330 G) Points Possible: ** 9 homework assignments (10 points per homework) ** 14 in-class assignments / quizzes (10 points per week) ** 2 projects / competitions (50 points per project) ** Undergraduates must complete 1 project, graduates must complete 2 * Important Rules ** For maximum benefit, homework should be done on-time. However, homework will be allowed to be re-submitted at any time for full credit, but must present a unique solution to previous work from yourself or others. ** All work must cite co-group members (if any) and the source of any code snippets used online. === Grading Rationale === Homework points will only be awarded for correct, working code and correct algorithmic analysis, while the homework problems will become progressively tougher. Undergraduates should be able to pass the course with an A if they have correctly answered most of the homework, appear at class prepared and on-time, and made a strong attempt at one of the projects. Graduate students should both perform well on the homework and successfully complete one or two projects. The re-grading for homework allows making up for missed assignments, and encourages returning to core concepts at a later point in the class. Students who have put in the studying effort, completed significant portions of the homework and projects both in- and out of class have thus demonstrated introductory programming proficiency. == Projects == * Midterm Project Description [[Media:Midterm2018.pdf]] (2 Mar., 2018) ** [[Agile|Agile Development Tips & Tricks]] * Final Project Description [[Media:Final2018.pdf]] (25 Apr., 2018) == Textbooks and Resources == * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-0072-7 Beginning Python, Hetland, 2005] (eBook avail. from USF Library) * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-3238-4 Python Algorithms, Hetland, 2010] (eBook avail. from USF Library) * [http://aosabook.org/en/index.html The Architecture of Open Source Applications] * [http://docs.python.org Python Documentation] * [https://developers.google.com/edu/python/ Google Introductory Python Notes] * [http://huffman.sourceforge.net/tao/tao-of-programming.html Tao of Programming] Other (possibly useful) materials: * [http://hackersdictionary.com/html/entry/larval-stage.html The Jargon File] * Chapters 7&8 of Modelling and Simulation, Birta and Arbez, Springer 2007 (eBook avail. from USF Library). * Chapters 4-6 of Models and Algorithms for Intelligent Data Analysis, Runkler, Springer 2012 (eBook avail. from USF Library). * Guide to Scientific Computing in C++, Francis and Whiteley, Springer, 2012. (eBook avail. from USF Library) * Extra info. On the basics: ** Chapters 3 and 7 of Mathematics in Computing, Regan, Springer 2013. (eBook avail. from USF Library) ** Instant feedback graphical programming with [https://www.khanacademy.org/cs/programming/ Khan Academy] * [http://www.meetup.com/python-178/ Local PyBulls Meetings] Code: * [http://carsonfarmer.com/2013/07/essential-python-geo-libraries Python Libraries Useful for Geospatial Problems] * [[Code#Python_Libraries|Python Libraries Useful for Computational Chemistry]] (very small list at present) Interactive Interpreters: * [http://www.codewars.com CodeWars] Recommended for building experience with practice problems. * [http://codecombat.com/ CodeCombat] A very visual way to interact with your python code. * [http://exercism.io Exercism] A command-line client with a similar learn-through-challenge philosophy. * [http://repl.it repl.it] A read-eval-print loop for several computer languages. * [http://en.cppreference.com/w/cpp/language CppReference] Documentation with an online evaluator for C++ code. === Notes === * [[Media:Intro.pdf|Introduction Notes]] <!-- * [[Media:Week2-2017.pdf|Week 2-3 Notes]] * Week 4: read through function syntax in [[Media:Week2.pdf|2016 Week 2]] and for-loops in [[Media:Week3.pdf|2016 Week 3-4]] * In-Class Examples ** [[Turing Exercise]] ** [https://predictivestatmech.org/code/example.dcd Example DCD File] * [[Media:Week-5.2017.pdf|Week 5 Notes]] * [[Media:PlottingMaps.pdf|Week 6 Notes]] ** [[Code:PyTesting]] * [[Media:NumpyArrays.pdf|Week 7 Notes]] ** [http://www.labri.fr/perso/nrougier/from-python-to-numpy/ all about numpy] * Misc. Notes for Week 8 ** [[Physics:Pairs|Rundown of Pair Interactions]] ** Parameterized surfaces [[Media:param1.jpg|1]] and [[Media:param2.jpg|2]] * Notes for Compilation Lab ** [https://learnpythonthehardway.org/book/appendixa.html Command Line Crash Course] Cheat sheet for bash commands. ** USF's compute cluster documentation at [https://wiki.rc.usf.edu/index.php/Main_Page RC Wiki]. *** See especially the "Connecting to SC" and "Modules" sections ** [[Code:Compiling|Cheat-codes]] for compilation lab. * [[Media:jobs.pdf|Research Computing Batch Queue]] * [[Media:Plug-in.pdf|Plugging Into Libraries]] * [[Media:Matrix.pdf|Matrix Algorithms]] --> === In-Class Problems === * Week 1: [[Media:CalculatorProbs.pdf|Calculator Problems]] ** Solutions: [http://predictivestatmech.org/terms/term.html] ** This solution uses python list comprehensions, and shows that the slowest step is actually unit conversion! * Week 2: [[Media:Pseudocode.pdf|Pseudocode Problems]] ** We will work these in class. For practice, be sure you have python list ideas down! === Homework === * Homework will be assigned through Repl.IT * Project presentations will be on Mon.-Wed., Mar 5-7 * Final Project presentations will be during exam time, Wed., May 2 c8d24b376d4b19c3f1444a43aa048fad310bc6fa 621 618 2018-01-17T18:01:35Z David M. Rogers 2 /* In-Class Problems */ wikitext text/x-wiki '''<BIG>Introduction to Scientific Computing</BIG>''' Course Info * Course Numbers CHM 4932-004/6938-010, CRN: 20438/20439 * Credit Hours: 3 * Meeting Dates: January 8 - April 25, 2018 ** No Class Jan. 15 or Mar. 12-18 * Meeting Times: Mon. and Wed., 12:30-13:45 in SCA 222 ** Midterm Project Presentations: Mon.-Wed., Mar 5 and 7. ** Final Project Presentations: Wed., May 2, 10:00am – 12:00pm (scheduled final date) ** Lab Session & Office Hours: Fri. 12:30-13:45 in IDR 214 (or SCA 222 by announcement) <pre> $ for((i=1;i<=4;i++)); do cal $i 2018; done ____ January 2018 ____ _____ March 2018 ____ | Su Mo Tu We Th Fr Sa | | Su Mo Tu We Th Fr Sa | 1 2 3 4 5 6 | | 1 (2) 3 1 | 7 8 9*10 11 12 13 | 9 | 4 (5) 6 (7) 8 9 10 2 | 14 x 16*17 18 19 20 | | x x 3 | 21*22 23 24 25 26 27 | 10 | 18*19 20 21 22 23 24 4 | 28*29 30 31 | 11 | 25*26 27 28 29 30 31 ___ February 2018 ____ _____ April 2018 ____ | Su Mo Tu We Th Fr Sa | | Su Mo Tu We Th Fr Sa | 1 2 3 | 12 | 1 *2 3 4 5 6 7 5 | 4 *5 6 7 8 9 10 | 13 | 8 *9 10 11 12 13 14 6 | 11*12 13 14 15 16 17 | 14 | 15*16 17 18 19 20 21 7 | 18*19 20 21 22 23 24 | 15 | 22*23 24(25)26 27 28 8 | 25*26 27 28 | | 29 x Week Topic 1 Calculator Form 2 Pseudocode 3 Plotting 1 (Excel) 4 Plotting 2 (Matplotlib and linear spaces) 5 Abstraction 1 (advanced functions and oo method) 6 Abstraction 2 (Booleans and logic) 7 2D transforms and iterated maps 8 Optimization 1 (Newton-Rhapson) 9 midterm project presentations 10 Optimization 2 (MD Energy) 11 ODE and SDE algorithms 12 Statistics 13 Complexity 14 Circe and Linux crash course 15 Compile & install process, ctypes </pre> == Overview == Mathematical models in the natural sciences take many shapes and forms. The moment they become more complicated than tracking a few variables over time, we have to put away our Excel spreadsheets and make use of a solid foundation in computational science. The course establishes this foundation by introducing data structures and algorithms used in everyday scientific computing using examples in the python scripting language. By the end of the Semester, students will be able to navigate the Linux command-line to go from a mathematical model to a numerical solution. Best practices for working with computer code and visualizing data will also be covered. == Topics == # Languages #* bash (shell) #* python (scripting) #* stack & register-based machine languages: overview of C and Fortran syntax & compiling with gcc, ‘thread safety’ #* Shared libraries & language inter-operability (FFI) # Algorithms #* Horner’s algorithm for polynomials #* Newton’s root finding algo. #* Overview of general optimization algo-s (example: linear & nonlin. least-squares) #* Numerical integration (scripted, plus gnu ODE) #* Communication (how HTTP get/put works) # Data Structures #* Linked Lists #* Trees (file system hierarchies) #* Graphs #* Arrays (dense & sparse) example: vectors & rotations / transpositions, densities and difference operators # Presentation & visualization #* Flat CSV files (and excel) #* Working with binary data #* Python matplotlib (2D images) #* Binning histograms & weighted averages # Best Practices #* High-level code design (modularity, interface specifications, unit testing, etc.) #* Code audit: open-source libraries, ex. Gnu Scientific Library, qsort in libc, Boost #* Source code versioning (example: git or mercurial) #* gdb & execution profiling #* documentation #* Makefiles == Grading == '''Grading Scale (out of 400 points possible)''' {| class="wikitable" |- ! Grade ! Undergraduate ! Graduate |- | A+ | 269 | 323 |- | A | 258 | 310 |- | A- | 250 | 300 |- | B+ | 241 | 290 |- | B | 230 | 276 |- | B- | 222 | 266 |- | C+ | 213 | 256 |- | C | 202 | 243 |- | C- | 194 | 233 |- | D+ | 186 | 223 |- | D | 175 | 210 |- | D- | 166 | 200 |} * (280 U / 330 G) Points Possible: ** 9 homework assignments (10 points per homework) ** 14 in-class assignments / quizzes (10 points per week) ** 2 projects / competitions (50 points per project) ** Undergraduates must complete 1 project, graduates must complete 2 * Important Rules ** For maximum benefit, homework should be done on-time. However, homework will be allowed to be re-submitted at any time for full credit, but must present a unique solution to previous work from yourself or others. ** All work must cite co-group members (if any) and the source of any code snippets used online. === Grading Rationale === Homework points will only be awarded for correct, working code and correct algorithmic analysis, while the homework problems will become progressively tougher. Undergraduates should be able to pass the course with an A if they have correctly answered most of the homework, appear at class prepared and on-time, and made a strong attempt at one of the projects. Graduate students should both perform well on the homework and successfully complete one or two projects. The re-grading for homework allows making up for missed assignments, and encourages returning to core concepts at a later point in the class. Students who have put in the studying effort, completed significant portions of the homework and projects both in- and out of class have thus demonstrated introductory programming proficiency. == Projects == * Midterm Project Description [[Media:Midterm2018.pdf]] (2 Mar., 2018) ** [[Agile|Agile Development Tips & Tricks]] * Final Project Description [[Media:Final2018.pdf]] (25 Apr., 2018) == Textbooks and Resources == * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-0072-7 Beginning Python, Hetland, 2005] (eBook avail. from USF Library) * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-3238-4 Python Algorithms, Hetland, 2010] (eBook avail. from USF Library) * [http://aosabook.org/en/index.html The Architecture of Open Source Applications] * [http://docs.python.org Python Documentation] * [https://developers.google.com/edu/python/ Google Introductory Python Notes] * [http://huffman.sourceforge.net/tao/tao-of-programming.html Tao of Programming] Other (possibly useful) materials: * [http://hackersdictionary.com/html/entry/larval-stage.html The Jargon File] * Chapters 7&8 of Modelling and Simulation, Birta and Arbez, Springer 2007 (eBook avail. from USF Library). * Chapters 4-6 of Models and Algorithms for Intelligent Data Analysis, Runkler, Springer 2012 (eBook avail. from USF Library). * Guide to Scientific Computing in C++, Francis and Whiteley, Springer, 2012. (eBook avail. from USF Library) * Extra info. On the basics: ** Chapters 3 and 7 of Mathematics in Computing, Regan, Springer 2013. (eBook avail. from USF Library) ** Instant feedback graphical programming with [https://www.khanacademy.org/cs/programming/ Khan Academy] * [http://www.meetup.com/python-178/ Local PyBulls Meetings] Code: * [http://carsonfarmer.com/2013/07/essential-python-geo-libraries Python Libraries Useful for Geospatial Problems] * [[Code#Python_Libraries|Python Libraries Useful for Computational Chemistry]] (very small list at present) Interactive Interpreters: * [http://www.codewars.com CodeWars] Recommended for building experience with practice problems. * [http://codecombat.com/ CodeCombat] A very visual way to interact with your python code. * [http://exercism.io Exercism] A command-line client with a similar learn-through-challenge philosophy. * [http://repl.it repl.it] A read-eval-print loop for several computer languages. * [http://en.cppreference.com/w/cpp/language CppReference] Documentation with an online evaluator for C++ code. === Notes === * [[Media:Intro.pdf|Introduction Notes]] <!-- * [[Media:Week2-2017.pdf|Week 2-3 Notes]] * Week 4: read through function syntax in [[Media:Week2.pdf|2016 Week 2]] and for-loops in [[Media:Week3.pdf|2016 Week 3-4]] * In-Class Examples ** [[Turing Exercise]] ** [https://predictivestatmech.org/code/example.dcd Example DCD File] * [[Media:Week-5.2017.pdf|Week 5 Notes]] * [[Media:PlottingMaps.pdf|Week 6 Notes]] ** [[Code:PyTesting]] * [[Media:NumpyArrays.pdf|Week 7 Notes]] ** [http://www.labri.fr/perso/nrougier/from-python-to-numpy/ all about numpy] * Misc. Notes for Week 8 ** [[Physics:Pairs|Rundown of Pair Interactions]] ** Parameterized surfaces [[Media:param1.jpg|1]] and [[Media:param2.jpg|2]] * Notes for Compilation Lab ** [https://learnpythonthehardway.org/book/appendixa.html Command Line Crash Course] Cheat sheet for bash commands. ** USF's compute cluster documentation at [https://wiki.rc.usf.edu/index.php/Main_Page RC Wiki]. *** See especially the "Connecting to SC" and "Modules" sections ** [[Code:Compiling|Cheat-codes]] for compilation lab. * [[Media:jobs.pdf|Research Computing Batch Queue]] * [[Media:Plug-in.pdf|Plugging Into Libraries]] * [[Media:Matrix.pdf|Matrix Algorithms]] --> === In-Class Problems === * Week 1: [[Media:CalculatorProbs.pdf|Calculator Problems]] ** Solutions: [http://predictivestatmech.org/terms/term.html] ** This solution uses python list comprehensions, and shows that the slowest step is actually unit conversion! * Week 2: [[Media:Pseudocode.pdf|Pseudocode Problems]] ** We will work these in class. For practice, be sure you have python list ideas down! ** Solutions: [https://docs.google.com/document/d/1HRkSdVNsTUydY4cVx67jRHRyhi5gL6nneEj9IX89wlE/edit?usp=sharing] === Homework === * Homework will be assigned through Repl.IT * Project presentations will be on Mon.-Wed., Mar 5-7 * Final Project presentations will be during exam time, Wed., May 2 e8741eadccd7d160342e8d08832af2baf1ec25bb 622 621 2018-01-22T00:28:20Z David M. Rogers 2 /* In-Class Problems */ wikitext text/x-wiki '''<BIG>Introduction to Scientific Computing</BIG>''' Course Info * Course Numbers CHM 4932-004/6938-010, CRN: 20438/20439 * Credit Hours: 3 * Meeting Dates: January 8 - April 25, 2018 ** No Class Jan. 15 or Mar. 12-18 * Meeting Times: Mon. and Wed., 12:30-13:45 in SCA 222 ** Midterm Project Presentations: Mon.-Wed., Mar 5 and 7. ** Final Project Presentations: Wed., May 2, 10:00am – 12:00pm (scheduled final date) ** Lab Session & Office Hours: Fri. 12:30-13:45 in IDR 214 (or SCA 222 by announcement) <pre> $ for((i=1;i<=4;i++)); do cal $i 2018; done ____ January 2018 ____ _____ March 2018 ____ | Su Mo Tu We Th Fr Sa | | Su Mo Tu We Th Fr Sa | 1 2 3 4 5 6 | | 1 (2) 3 1 | 7 8 9*10 11 12 13 | 9 | 4 (5) 6 (7) 8 9 10 2 | 14 x 16*17 18 19 20 | | x x 3 | 21*22 23 24 25 26 27 | 10 | 18*19 20 21 22 23 24 4 | 28*29 30 31 | 11 | 25*26 27 28 29 30 31 ___ February 2018 ____ _____ April 2018 ____ | Su Mo Tu We Th Fr Sa | | Su Mo Tu We Th Fr Sa | 1 2 3 | 12 | 1 *2 3 4 5 6 7 5 | 4 *5 6 7 8 9 10 | 13 | 8 *9 10 11 12 13 14 6 | 11*12 13 14 15 16 17 | 14 | 15*16 17 18 19 20 21 7 | 18*19 20 21 22 23 24 | 15 | 22*23 24(25)26 27 28 8 | 25*26 27 28 | | 29 x Week Topic 1 Calculator Form 2 Pseudocode 3 Plotting 1 (Excel) 4 Plotting 2 (Matplotlib and linear spaces) 5 Abstraction 1 (advanced functions and oo method) 6 Abstraction 2 (Booleans and logic) 7 2D transforms and iterated maps 8 Optimization 1 (Newton-Rhapson) 9 midterm project presentations 10 Optimization 2 (MD Energy) 11 ODE and SDE algorithms 12 Statistics 13 Complexity 14 Circe and Linux crash course 15 Compile & install process, ctypes </pre> == Overview == Mathematical models in the natural sciences take many shapes and forms. The moment they become more complicated than tracking a few variables over time, we have to put away our Excel spreadsheets and make use of a solid foundation in computational science. The course establishes this foundation by introducing data structures and algorithms used in everyday scientific computing using examples in the python scripting language. By the end of the Semester, students will be able to navigate the Linux command-line to go from a mathematical model to a numerical solution. Best practices for working with computer code and visualizing data will also be covered. == Topics == # Languages #* bash (shell) #* python (scripting) #* stack & register-based machine languages: overview of C and Fortran syntax & compiling with gcc, ‘thread safety’ #* Shared libraries & language inter-operability (FFI) # Algorithms #* Horner’s algorithm for polynomials #* Newton’s root finding algo. #* Overview of general optimization algo-s (example: linear & nonlin. least-squares) #* Numerical integration (scripted, plus gnu ODE) #* Communication (how HTTP get/put works) # Data Structures #* Linked Lists #* Trees (file system hierarchies) #* Graphs #* Arrays (dense & sparse) example: vectors & rotations / transpositions, densities and difference operators # Presentation & visualization #* Flat CSV files (and excel) #* Working with binary data #* Python matplotlib (2D images) #* Binning histograms & weighted averages # Best Practices #* High-level code design (modularity, interface specifications, unit testing, etc.) #* Code audit: open-source libraries, ex. Gnu Scientific Library, qsort in libc, Boost #* Source code versioning (example: git or mercurial) #* gdb & execution profiling #* documentation #* Makefiles == Grading == '''Grading Scale (out of 400 points possible)''' {| class="wikitable" |- ! Grade ! Undergraduate ! Graduate |- | A+ | 269 | 323 |- | A | 258 | 310 |- | A- | 250 | 300 |- | B+ | 241 | 290 |- | B | 230 | 276 |- | B- | 222 | 266 |- | C+ | 213 | 256 |- | C | 202 | 243 |- | C- | 194 | 233 |- | D+ | 186 | 223 |- | D | 175 | 210 |- | D- | 166 | 200 |} * (280 U / 330 G) Points Possible: ** 9 homework assignments (10 points per homework) ** 14 in-class assignments / quizzes (10 points per week) ** 2 projects / competitions (50 points per project) ** Undergraduates must complete 1 project, graduates must complete 2 * Important Rules ** For maximum benefit, homework should be done on-time. However, homework will be allowed to be re-submitted at any time for full credit, but must present a unique solution to previous work from yourself or others. ** All work must cite co-group members (if any) and the source of any code snippets used online. === Grading Rationale === Homework points will only be awarded for correct, working code and correct algorithmic analysis, while the homework problems will become progressively tougher. Undergraduates should be able to pass the course with an A if they have correctly answered most of the homework, appear at class prepared and on-time, and made a strong attempt at one of the projects. Graduate students should both perform well on the homework and successfully complete one or two projects. The re-grading for homework allows making up for missed assignments, and encourages returning to core concepts at a later point in the class. Students who have put in the studying effort, completed significant portions of the homework and projects both in- and out of class have thus demonstrated introductory programming proficiency. == Projects == * Midterm Project Description [[Media:Midterm2018.pdf]] (2 Mar., 2018) ** [[Agile|Agile Development Tips & Tricks]] * Final Project Description [[Media:Final2018.pdf]] (25 Apr., 2018) == Textbooks and Resources == * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-0072-7 Beginning Python, Hetland, 2005] (eBook avail. from USF Library) * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-3238-4 Python Algorithms, Hetland, 2010] (eBook avail. from USF Library) * [http://aosabook.org/en/index.html The Architecture of Open Source Applications] * [http://docs.python.org Python Documentation] * [https://developers.google.com/edu/python/ Google Introductory Python Notes] * [http://huffman.sourceforge.net/tao/tao-of-programming.html Tao of Programming] Other (possibly useful) materials: * [http://hackersdictionary.com/html/entry/larval-stage.html The Jargon File] * Chapters 7&8 of Modelling and Simulation, Birta and Arbez, Springer 2007 (eBook avail. from USF Library). * Chapters 4-6 of Models and Algorithms for Intelligent Data Analysis, Runkler, Springer 2012 (eBook avail. from USF Library). * Guide to Scientific Computing in C++, Francis and Whiteley, Springer, 2012. (eBook avail. from USF Library) * Extra info. On the basics: ** Chapters 3 and 7 of Mathematics in Computing, Regan, Springer 2013. (eBook avail. from USF Library) ** Instant feedback graphical programming with [https://www.khanacademy.org/cs/programming/ Khan Academy] * [http://www.meetup.com/python-178/ Local PyBulls Meetings] Code: * [http://carsonfarmer.com/2013/07/essential-python-geo-libraries Python Libraries Useful for Geospatial Problems] * [[Code#Python_Libraries|Python Libraries Useful for Computational Chemistry]] (very small list at present) Interactive Interpreters: * [http://www.codewars.com CodeWars] Recommended for building experience with practice problems. * [http://codecombat.com/ CodeCombat] A very visual way to interact with your python code. * [http://exercism.io Exercism] A command-line client with a similar learn-through-challenge philosophy. * [http://repl.it repl.it] A read-eval-print loop for several computer languages. * [http://en.cppreference.com/w/cpp/language CppReference] Documentation with an online evaluator for C++ code. === Notes === * [[Media:Intro.pdf|Introduction Notes]] <!-- * [[Media:Week2-2017.pdf|Week 2-3 Notes]] * Week 4: read through function syntax in [[Media:Week2.pdf|2016 Week 2]] and for-loops in [[Media:Week3.pdf|2016 Week 3-4]] * In-Class Examples ** [[Turing Exercise]] ** [https://predictivestatmech.org/code/example.dcd Example DCD File] * [[Media:Week-5.2017.pdf|Week 5 Notes]] * [[Media:PlottingMaps.pdf|Week 6 Notes]] ** [[Code:PyTesting]] * [[Media:NumpyArrays.pdf|Week 7 Notes]] ** [http://www.labri.fr/perso/nrougier/from-python-to-numpy/ all about numpy] * Misc. Notes for Week 8 ** [[Physics:Pairs|Rundown of Pair Interactions]] ** Parameterized surfaces [[Media:param1.jpg|1]] and [[Media:param2.jpg|2]] * Notes for Compilation Lab ** [https://learnpythonthehardway.org/book/appendixa.html Command Line Crash Course] Cheat sheet for bash commands. ** USF's compute cluster documentation at [https://wiki.rc.usf.edu/index.php/Main_Page RC Wiki]. *** See especially the "Connecting to SC" and "Modules" sections ** [[Code:Compiling|Cheat-codes]] for compilation lab. * [[Media:jobs.pdf|Research Computing Batch Queue]] * [[Media:Plug-in.pdf|Plugging Into Libraries]] * [[Media:Matrix.pdf|Matrix Algorithms]] --> === In-Class Problems === * Week 1: [[Media:CalculatorProbs.pdf|Calculator Problems]] ** Solutions: [http://predictivestatmech.org/terms/term.html] ** This solution uses python list comprehensions, and shows that the slowest step is actually unit conversion! * Week 2: [[Media:Pseudocode.pdf|Pseudocode Problems]] ** We will work these in class. For practice, be sure you have python list ideas down! ** Solutions: [https://docs.google.com/document/d/1HRkSdVNsTUydY4cVx67jRHRyhi5gL6nneEj9IX89wlE/edit?usp=sharing] * Week 3: [[Media:Plotting1.pdf|Plotting 1]] === Homework === * Homework will be assigned through Repl.IT * Project presentations will be on Mon.-Wed., Mar 5-7 * Final Project presentations will be during exam time, Wed., May 2 c63941d7648b1226475a380bda02fa0d7e0678e8 627 622 2018-01-24T19:25:16Z David M. Rogers 2 /* In-Class Problems */ wikitext text/x-wiki '''<BIG>Introduction to Scientific Computing</BIG>''' Course Info * Course Numbers CHM 4932-004/6938-010, CRN: 20438/20439 * Credit Hours: 3 * Meeting Dates: January 8 - April 25, 2018 ** No Class Jan. 15 or Mar. 12-18 * Meeting Times: Mon. and Wed., 12:30-13:45 in SCA 222 ** Midterm Project Presentations: Mon.-Wed., Mar 5 and 7. ** Final Project Presentations: Wed., May 2, 10:00am – 12:00pm (scheduled final date) ** Lab Session & Office Hours: Fri. 12:30-13:45 in IDR 214 (or SCA 222 by announcement) <pre> $ for((i=1;i<=4;i++)); do cal $i 2018; done ____ January 2018 ____ _____ March 2018 ____ | Su Mo Tu We Th Fr Sa | | Su Mo Tu We Th Fr Sa | 1 2 3 4 5 6 | | 1 (2) 3 1 | 7 8 9*10 11 12 13 | 9 | 4 (5) 6 (7) 8 9 10 2 | 14 x 16*17 18 19 20 | | x x 3 | 21*22 23 24 25 26 27 | 10 | 18*19 20 21 22 23 24 4 | 28*29 30 31 | 11 | 25*26 27 28 29 30 31 ___ February 2018 ____ _____ April 2018 ____ | Su Mo Tu We Th Fr Sa | | Su Mo Tu We Th Fr Sa | 1 2 3 | 12 | 1 *2 3 4 5 6 7 5 | 4 *5 6 7 8 9 10 | 13 | 8 *9 10 11 12 13 14 6 | 11*12 13 14 15 16 17 | 14 | 15*16 17 18 19 20 21 7 | 18*19 20 21 22 23 24 | 15 | 22*23 24(25)26 27 28 8 | 25*26 27 28 | | 29 x Week Topic 1 Calculator Form 2 Pseudocode 3 Plotting 1 (Excel) 4 Plotting 2 (Matplotlib and linear spaces) 5 Abstraction 1 (advanced functions and oo method) 6 Abstraction 2 (Booleans and logic) 7 2D transforms and iterated maps 8 Optimization 1 (Newton-Rhapson) 9 midterm project presentations 10 Optimization 2 (MD Energy) 11 ODE and SDE algorithms 12 Statistics 13 Complexity 14 Circe and Linux crash course 15 Compile & install process, ctypes </pre> == Overview == Mathematical models in the natural sciences take many shapes and forms. The moment they become more complicated than tracking a few variables over time, we have to put away our Excel spreadsheets and make use of a solid foundation in computational science. The course establishes this foundation by introducing data structures and algorithms used in everyday scientific computing using examples in the python scripting language. By the end of the Semester, students will be able to navigate the Linux command-line to go from a mathematical model to a numerical solution. Best practices for working with computer code and visualizing data will also be covered. == Topics == # Languages #* bash (shell) #* python (scripting) #* stack & register-based machine languages: overview of C and Fortran syntax & compiling with gcc, ‘thread safety’ #* Shared libraries & language inter-operability (FFI) # Algorithms #* Horner’s algorithm for polynomials #* Newton’s root finding algo. #* Overview of general optimization algo-s (example: linear & nonlin. least-squares) #* Numerical integration (scripted, plus gnu ODE) #* Communication (how HTTP get/put works) # Data Structures #* Linked Lists #* Trees (file system hierarchies) #* Graphs #* Arrays (dense & sparse) example: vectors & rotations / transpositions, densities and difference operators # Presentation & visualization #* Flat CSV files (and excel) #* Working with binary data #* Python matplotlib (2D images) #* Binning histograms & weighted averages # Best Practices #* High-level code design (modularity, interface specifications, unit testing, etc.) #* Code audit: open-source libraries, ex. Gnu Scientific Library, qsort in libc, Boost #* Source code versioning (example: git or mercurial) #* gdb & execution profiling #* documentation #* Makefiles == Grading == '''Grading Scale (out of 400 points possible)''' {| class="wikitable" |- ! Grade ! Undergraduate ! Graduate |- | A+ | 269 | 323 |- | A | 258 | 310 |- | A- | 250 | 300 |- | B+ | 241 | 290 |- | B | 230 | 276 |- | B- | 222 | 266 |- | C+ | 213 | 256 |- | C | 202 | 243 |- | C- | 194 | 233 |- | D+ | 186 | 223 |- | D | 175 | 210 |- | D- | 166 | 200 |} * (280 U / 330 G) Points Possible: ** 9 homework assignments (10 points per homework) ** 14 in-class assignments / quizzes (10 points per week) ** 2 projects / competitions (50 points per project) ** Undergraduates must complete 1 project, graduates must complete 2 * Important Rules ** For maximum benefit, homework should be done on-time. However, homework will be allowed to be re-submitted at any time for full credit, but must present a unique solution to previous work from yourself or others. ** All work must cite co-group members (if any) and the source of any code snippets used online. === Grading Rationale === Homework points will only be awarded for correct, working code and correct algorithmic analysis, while the homework problems will become progressively tougher. Undergraduates should be able to pass the course with an A if they have correctly answered most of the homework, appear at class prepared and on-time, and made a strong attempt at one of the projects. Graduate students should both perform well on the homework and successfully complete one or two projects. The re-grading for homework allows making up for missed assignments, and encourages returning to core concepts at a later point in the class. Students who have put in the studying effort, completed significant portions of the homework and projects both in- and out of class have thus demonstrated introductory programming proficiency. == Projects == * Midterm Project Description [[Media:Midterm2018.pdf]] (2 Mar., 2018) ** [[Agile|Agile Development Tips & Tricks]] * Final Project Description [[Media:Final2018.pdf]] (25 Apr., 2018) == Textbooks and Resources == * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-0072-7 Beginning Python, Hetland, 2005] (eBook avail. from USF Library) * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-3238-4 Python Algorithms, Hetland, 2010] (eBook avail. from USF Library) * [http://aosabook.org/en/index.html The Architecture of Open Source Applications] * [http://docs.python.org Python Documentation] * [https://developers.google.com/edu/python/ Google Introductory Python Notes] * [http://huffman.sourceforge.net/tao/tao-of-programming.html Tao of Programming] Other (possibly useful) materials: * [http://hackersdictionary.com/html/entry/larval-stage.html The Jargon File] * Chapters 7&8 of Modelling and Simulation, Birta and Arbez, Springer 2007 (eBook avail. from USF Library). * Chapters 4-6 of Models and Algorithms for Intelligent Data Analysis, Runkler, Springer 2012 (eBook avail. from USF Library). * Guide to Scientific Computing in C++, Francis and Whiteley, Springer, 2012. (eBook avail. from USF Library) * Extra info. On the basics: ** Chapters 3 and 7 of Mathematics in Computing, Regan, Springer 2013. (eBook avail. from USF Library) ** Instant feedback graphical programming with [https://www.khanacademy.org/cs/programming/ Khan Academy] * [http://www.meetup.com/python-178/ Local PyBulls Meetings] Code: * [http://carsonfarmer.com/2013/07/essential-python-geo-libraries Python Libraries Useful for Geospatial Problems] * [[Code#Python_Libraries|Python Libraries Useful for Computational Chemistry]] (very small list at present) Interactive Interpreters: * [http://www.codewars.com CodeWars] Recommended for building experience with practice problems. * [http://codecombat.com/ CodeCombat] A very visual way to interact with your python code. * [http://exercism.io Exercism] A command-line client with a similar learn-through-challenge philosophy. * [http://repl.it repl.it] A read-eval-print loop for several computer languages. * [http://en.cppreference.com/w/cpp/language CppReference] Documentation with an online evaluator for C++ code. === Notes === * [[Media:Intro.pdf|Introduction Notes]] <!-- * [[Media:Week2-2017.pdf|Week 2-3 Notes]] * Week 4: read through function syntax in [[Media:Week2.pdf|2016 Week 2]] and for-loops in [[Media:Week3.pdf|2016 Week 3-4]] * In-Class Examples ** [[Turing Exercise]] ** [https://predictivestatmech.org/code/example.dcd Example DCD File] * [[Media:Week-5.2017.pdf|Week 5 Notes]] * [[Media:PlottingMaps.pdf|Week 6 Notes]] ** [[Code:PyTesting]] * [[Media:NumpyArrays.pdf|Week 7 Notes]] ** [http://www.labri.fr/perso/nrougier/from-python-to-numpy/ all about numpy] * Misc. Notes for Week 8 ** [[Physics:Pairs|Rundown of Pair Interactions]] ** Parameterized surfaces [[Media:param1.jpg|1]] and [[Media:param2.jpg|2]] * Notes for Compilation Lab ** [https://learnpythonthehardway.org/book/appendixa.html Command Line Crash Course] Cheat sheet for bash commands. ** USF's compute cluster documentation at [https://wiki.rc.usf.edu/index.php/Main_Page RC Wiki]. *** See especially the "Connecting to SC" and "Modules" sections ** [[Code:Compiling|Cheat-codes]] for compilation lab. * [[Media:jobs.pdf|Research Computing Batch Queue]] * [[Media:Plug-in.pdf|Plugging Into Libraries]] * [[Media:Matrix.pdf|Matrix Algorithms]] --> === In-Class Problems === * Week 1: [[Media:CalculatorProbs.pdf|Calculator Problems]] ** Solutions: [http://predictivestatmech.org/terms/term.html] ** This solution uses python list comprehensions, and shows that the slowest step is actually unit conversion! * Week 2: [[Media:Pseudocode.pdf|Pseudocode Problems]] ** We will work these in class. For practice, be sure you have python list ideas down! ** Solutions: [https://docs.google.com/document/d/1HRkSdVNsTUydY4cVx67jRHRyhi5gL6nneEj9IX89wlE/edit?usp=sharing] * Week 3: [[Media:Plotting1.pdf|Plotting 1]] ** [https://stackoverflow.com/questions/11815538/how-to-import-matplotlib-in-python#11830055 Notes on installing Matplotlib on your own computer] ** Challenge: actions vs. functions -- what does the following code do: "[ print(1) for i in range(10) ]" (python3 only) <source lang="python"> # This is a preview of next week's activity: # Scale and shift the sequence 0, ..., 99 to the new sequence 0.8, 0.83, ..., 3.77 x = [ i*3/100.0 + 0.8 for i in range(100) ] # Calculate the LJ function for each x-value in the sequence, "x" of x-values. y = [ 4*(xi**-12 - xi**-6) for xi in x] import matplotlib.pyplot as plt plt.plot(x, y) plt.show() </source> === Homework === * Homework will be assigned through Repl.IT * Project presentations will be on Mon.-Wed., Mar 5-7 * Final Project presentations will be during exam time, Wed., May 2 cb338842b459eeedbeb0db52f06bb71a2c4b4486 630 627 2018-01-29T14:20:34Z David M. Rogers 2 /* In-Class Problems */ wikitext text/x-wiki '''<BIG>Introduction to Scientific Computing</BIG>''' Course Info * Course Numbers CHM 4932-004/6938-010, CRN: 20438/20439 * Credit Hours: 3 * Meeting Dates: January 8 - April 25, 2018 ** No Class Jan. 15 or Mar. 12-18 * Meeting Times: Mon. and Wed., 12:30-13:45 in SCA 222 ** Midterm Project Presentations: Mon.-Wed., Mar 5 and 7. ** Final Project Presentations: Wed., May 2, 10:00am – 12:00pm (scheduled final date) ** Lab Session & Office Hours: Fri. 12:30-13:45 in IDR 214 (or SCA 222 by announcement) <pre> $ for((i=1;i<=4;i++)); do cal $i 2018; done ____ January 2018 ____ _____ March 2018 ____ | Su Mo Tu We Th Fr Sa | | Su Mo Tu We Th Fr Sa | 1 2 3 4 5 6 | | 1 (2) 3 1 | 7 8 9*10 11 12 13 | 9 | 4 (5) 6 (7) 8 9 10 2 | 14 x 16*17 18 19 20 | | x x 3 | 21*22 23 24 25 26 27 | 10 | 18*19 20 21 22 23 24 4 | 28*29 30 31 | 11 | 25*26 27 28 29 30 31 ___ February 2018 ____ _____ April 2018 ____ | Su Mo Tu We Th Fr Sa | | Su Mo Tu We Th Fr Sa | 1 2 3 | 12 | 1 *2 3 4 5 6 7 5 | 4 *5 6 7 8 9 10 | 13 | 8 *9 10 11 12 13 14 6 | 11*12 13 14 15 16 17 | 14 | 15*16 17 18 19 20 21 7 | 18*19 20 21 22 23 24 | 15 | 22*23 24(25)26 27 28 8 | 25*26 27 28 | | 29 x Week Topic 1 Calculator Form 2 Pseudocode 3 Plotting 1 (Excel) 4 Plotting 2 (Matplotlib and linear spaces) 5 Abstraction 1 (advanced functions and oo method) 6 Abstraction 2 (Booleans and logic) 7 2D transforms and iterated maps 8 Optimization 1 (Newton-Rhapson) 9 midterm project presentations 10 Optimization 2 (MD Energy) 11 ODE and SDE algorithms 12 Statistics 13 Complexity 14 Circe and Linux crash course 15 Compile & install process, ctypes </pre> == Overview == Mathematical models in the natural sciences take many shapes and forms. The moment they become more complicated than tracking a few variables over time, we have to put away our Excel spreadsheets and make use of a solid foundation in computational science. The course establishes this foundation by introducing data structures and algorithms used in everyday scientific computing using examples in the python scripting language. By the end of the Semester, students will be able to navigate the Linux command-line to go from a mathematical model to a numerical solution. Best practices for working with computer code and visualizing data will also be covered. == Topics == # Languages #* bash (shell) #* python (scripting) #* stack & register-based machine languages: overview of C and Fortran syntax & compiling with gcc, ‘thread safety’ #* Shared libraries & language inter-operability (FFI) # Algorithms #* Horner’s algorithm for polynomials #* Newton’s root finding algo. #* Overview of general optimization algo-s (example: linear & nonlin. least-squares) #* Numerical integration (scripted, plus gnu ODE) #* Communication (how HTTP get/put works) # Data Structures #* Linked Lists #* Trees (file system hierarchies) #* Graphs #* Arrays (dense & sparse) example: vectors & rotations / transpositions, densities and difference operators # Presentation & visualization #* Flat CSV files (and excel) #* Working with binary data #* Python matplotlib (2D images) #* Binning histograms & weighted averages # Best Practices #* High-level code design (modularity, interface specifications, unit testing, etc.) #* Code audit: open-source libraries, ex. Gnu Scientific Library, qsort in libc, Boost #* Source code versioning (example: git or mercurial) #* gdb & execution profiling #* documentation #* Makefiles == Grading == '''Grading Scale (out of 400 points possible)''' {| class="wikitable" |- ! Grade ! Undergraduate ! Graduate |- | A+ | 269 | 323 |- | A | 258 | 310 |- | A- | 250 | 300 |- | B+ | 241 | 290 |- | B | 230 | 276 |- | B- | 222 | 266 |- | C+ | 213 | 256 |- | C | 202 | 243 |- | C- | 194 | 233 |- | D+ | 186 | 223 |- | D | 175 | 210 |- | D- | 166 | 200 |} * (280 U / 330 G) Points Possible: ** 9 homework assignments (10 points per homework) ** 14 in-class assignments / quizzes (10 points per week) ** 2 projects / competitions (50 points per project) ** Undergraduates must complete 1 project, graduates must complete 2 * Important Rules ** For maximum benefit, homework should be done on-time. However, homework will be allowed to be re-submitted at any time for full credit, but must present a unique solution to previous work from yourself or others. ** All work must cite co-group members (if any) and the source of any code snippets used online. === Grading Rationale === Homework points will only be awarded for correct, working code and correct algorithmic analysis, while the homework problems will become progressively tougher. Undergraduates should be able to pass the course with an A if they have correctly answered most of the homework, appear at class prepared and on-time, and made a strong attempt at one of the projects. Graduate students should both perform well on the homework and successfully complete one or two projects. The re-grading for homework allows making up for missed assignments, and encourages returning to core concepts at a later point in the class. Students who have put in the studying effort, completed significant portions of the homework and projects both in- and out of class have thus demonstrated introductory programming proficiency. == Projects == * Midterm Project Description [[Media:Midterm2018.pdf]] (2 Mar., 2018) ** [[Agile|Agile Development Tips & Tricks]] * Final Project Description [[Media:Final2018.pdf]] (25 Apr., 2018) == Textbooks and Resources == * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-0072-7 Beginning Python, Hetland, 2005] (eBook avail. from USF Library) * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-3238-4 Python Algorithms, Hetland, 2010] (eBook avail. from USF Library) * [http://aosabook.org/en/index.html The Architecture of Open Source Applications] * [http://docs.python.org Python Documentation] * [https://developers.google.com/edu/python/ Google Introductory Python Notes] * [http://huffman.sourceforge.net/tao/tao-of-programming.html Tao of Programming] Other (possibly useful) materials: * [http://hackersdictionary.com/html/entry/larval-stage.html The Jargon File] * Chapters 7&8 of Modelling and Simulation, Birta and Arbez, Springer 2007 (eBook avail. from USF Library). * Chapters 4-6 of Models and Algorithms for Intelligent Data Analysis, Runkler, Springer 2012 (eBook avail. from USF Library). * Guide to Scientific Computing in C++, Francis and Whiteley, Springer, 2012. (eBook avail. from USF Library) * Extra info. On the basics: ** Chapters 3 and 7 of Mathematics in Computing, Regan, Springer 2013. (eBook avail. from USF Library) ** Instant feedback graphical programming with [https://www.khanacademy.org/cs/programming/ Khan Academy] * [http://www.meetup.com/python-178/ Local PyBulls Meetings] Code: * [http://carsonfarmer.com/2013/07/essential-python-geo-libraries Python Libraries Useful for Geospatial Problems] * [[Code#Python_Libraries|Python Libraries Useful for Computational Chemistry]] (very small list at present) Interactive Interpreters: * [http://www.codewars.com CodeWars] Recommended for building experience with practice problems. * [http://codecombat.com/ CodeCombat] A very visual way to interact with your python code. * [http://exercism.io Exercism] A command-line client with a similar learn-through-challenge philosophy. * [http://repl.it repl.it] A read-eval-print loop for several computer languages. * [http://en.cppreference.com/w/cpp/language CppReference] Documentation with an online evaluator for C++ code. === Notes === * [[Media:Intro.pdf|Introduction Notes]] <!-- * [[Media:Week2-2017.pdf|Week 2-3 Notes]] * Week 4: read through function syntax in [[Media:Week2.pdf|2016 Week 2]] and for-loops in [[Media:Week3.pdf|2016 Week 3-4]] * In-Class Examples ** [[Turing Exercise]] ** [https://predictivestatmech.org/code/example.dcd Example DCD File] * [[Media:Week-5.2017.pdf|Week 5 Notes]] * [[Media:PlottingMaps.pdf|Week 6 Notes]] ** [[Code:PyTesting]] * [[Media:NumpyArrays.pdf|Week 7 Notes]] ** [http://www.labri.fr/perso/nrougier/from-python-to-numpy/ all about numpy] * Misc. Notes for Week 8 ** [[Physics:Pairs|Rundown of Pair Interactions]] ** Parameterized surfaces [[Media:param1.jpg|1]] and [[Media:param2.jpg|2]] * Notes for Compilation Lab ** [https://learnpythonthehardway.org/book/appendixa.html Command Line Crash Course] Cheat sheet for bash commands. ** USF's compute cluster documentation at [https://wiki.rc.usf.edu/index.php/Main_Page RC Wiki]. *** See especially the "Connecting to SC" and "Modules" sections ** [[Code:Compiling|Cheat-codes]] for compilation lab. * [[Media:jobs.pdf|Research Computing Batch Queue]] * [[Media:Plug-in.pdf|Plugging Into Libraries]] * [[Media:Matrix.pdf|Matrix Algorithms]] --> === In-Class Problems === * Week 1: [[Media:CalculatorProbs.pdf|Calculator Problems]] ** Solutions: [http://predictivestatmech.org/terms/term.html] ** This solution uses python list comprehensions, and shows that the slowest step is actually unit conversion! * Week 2: [[Media:Pseudocode.pdf|Pseudocode Problems]] ** We will work these in class. For practice, be sure you have python list ideas down! ** Solutions: [https://docs.google.com/document/d/1HRkSdVNsTUydY4cVx67jRHRyhi5gL6nneEj9IX89wlE/edit?usp=sharing] * Week 3: [[Media:Plotting1.pdf|Plotting 1]] ** [https://stackoverflow.com/questions/11815538/how-to-import-matplotlib-in-python#11830055 Notes on installing Matplotlib on your own computer] ** Challenge: actions vs. functions -- what does the following code do: "[ print(1) for i in range(10) ]" (python3 only) * Week 4: [[Media:Plotting2.pdf|Plotting 2]] <source lang="python"> # This is a preview of next week's activity: # Scale and shift the sequence 0, ..., 99 to the new sequence 0.8, 0.83, ..., 3.77 x = [ i*3/100.0 + 0.8 for i in range(100) ] # Calculate the LJ function for each x-value in the sequence, "x" of x-values. y = [ 4*(xi**-12 - xi**-6) for xi in x] import matplotlib.pyplot as plt plt.plot(x, y) plt.show() </source> === Homework === * Homework will be assigned through Repl.IT * Project presentations will be on Mon.-Wed., Mar 5-7 * Final Project presentations will be during exam time, Wed., May 2 b6f6af6a51cee05263ed80da14f7d06b6eab3888 632 630 2018-01-31T18:37:06Z David M. Rogers 2 /* In-Class Problems */ wikitext text/x-wiki '''<BIG>Introduction to Scientific Computing</BIG>''' Course Info * Course Numbers CHM 4932-004/6938-010, CRN: 20438/20439 * Credit Hours: 3 * Meeting Dates: January 8 - April 25, 2018 ** No Class Jan. 15 or Mar. 12-18 * Meeting Times: Mon. and Wed., 12:30-13:45 in SCA 222 ** Midterm Project Presentations: Mon.-Wed., Mar 5 and 7. ** Final Project Presentations: Wed., May 2, 10:00am – 12:00pm (scheduled final date) ** Lab Session & Office Hours: Fri. 12:30-13:45 in IDR 214 (or SCA 222 by announcement) <pre> $ for((i=1;i<=4;i++)); do cal $i 2018; done ____ January 2018 ____ _____ March 2018 ____ | Su Mo Tu We Th Fr Sa | | Su Mo Tu We Th Fr Sa | 1 2 3 4 5 6 | | 1 (2) 3 1 | 7 8 9*10 11 12 13 | 9 | 4 (5) 6 (7) 8 9 10 2 | 14 x 16*17 18 19 20 | | x x 3 | 21*22 23 24 25 26 27 | 10 | 18*19 20 21 22 23 24 4 | 28*29 30 31 | 11 | 25*26 27 28 29 30 31 ___ February 2018 ____ _____ April 2018 ____ | Su Mo Tu We Th Fr Sa | | Su Mo Tu We Th Fr Sa | 1 2 3 | 12 | 1 *2 3 4 5 6 7 5 | 4 *5 6 7 8 9 10 | 13 | 8 *9 10 11 12 13 14 6 | 11*12 13 14 15 16 17 | 14 | 15*16 17 18 19 20 21 7 | 18*19 20 21 22 23 24 | 15 | 22*23 24(25)26 27 28 8 | 25*26 27 28 | | 29 x Week Topic 1 Calculator Form 2 Pseudocode 3 Plotting 1 (Excel) 4 Plotting 2 (Matplotlib and linear spaces) 5 Abstraction 1 (advanced functions and oo method) 6 Abstraction 2 (Booleans and logic) 7 2D transforms and iterated maps 8 Optimization 1 (Newton-Rhapson) 9 midterm project presentations 10 Optimization 2 (MD Energy) 11 ODE and SDE algorithms 12 Statistics 13 Complexity 14 Circe and Linux crash course 15 Compile & install process, ctypes </pre> == Overview == Mathematical models in the natural sciences take many shapes and forms. The moment they become more complicated than tracking a few variables over time, we have to put away our Excel spreadsheets and make use of a solid foundation in computational science. The course establishes this foundation by introducing data structures and algorithms used in everyday scientific computing using examples in the python scripting language. By the end of the Semester, students will be able to navigate the Linux command-line to go from a mathematical model to a numerical solution. Best practices for working with computer code and visualizing data will also be covered. == Topics == # Languages #* bash (shell) #* python (scripting) #* stack & register-based machine languages: overview of C and Fortran syntax & compiling with gcc, ‘thread safety’ #* Shared libraries & language inter-operability (FFI) # Algorithms #* Horner’s algorithm for polynomials #* Newton’s root finding algo. #* Overview of general optimization algo-s (example: linear & nonlin. least-squares) #* Numerical integration (scripted, plus gnu ODE) #* Communication (how HTTP get/put works) # Data Structures #* Linked Lists #* Trees (file system hierarchies) #* Graphs #* Arrays (dense & sparse) example: vectors & rotations / transpositions, densities and difference operators # Presentation & visualization #* Flat CSV files (and excel) #* Working with binary data #* Python matplotlib (2D images) #* Binning histograms & weighted averages # Best Practices #* High-level code design (modularity, interface specifications, unit testing, etc.) #* Code audit: open-source libraries, ex. Gnu Scientific Library, qsort in libc, Boost #* Source code versioning (example: git or mercurial) #* gdb & execution profiling #* documentation #* Makefiles == Grading == '''Grading Scale (out of 400 points possible)''' {| class="wikitable" |- ! Grade ! Undergraduate ! Graduate |- | A+ | 269 | 323 |- | A | 258 | 310 |- | A- | 250 | 300 |- | B+ | 241 | 290 |- | B | 230 | 276 |- | B- | 222 | 266 |- | C+ | 213 | 256 |- | C | 202 | 243 |- | C- | 194 | 233 |- | D+ | 186 | 223 |- | D | 175 | 210 |- | D- | 166 | 200 |} * (280 U / 330 G) Points Possible: ** 9 homework assignments (10 points per homework) ** 14 in-class assignments / quizzes (10 points per week) ** 2 projects / competitions (50 points per project) ** Undergraduates must complete 1 project, graduates must complete 2 * Important Rules ** For maximum benefit, homework should be done on-time. However, homework will be allowed to be re-submitted at any time for full credit, but must present a unique solution to previous work from yourself or others. ** All work must cite co-group members (if any) and the source of any code snippets used online. === Grading Rationale === Homework points will only be awarded for correct, working code and correct algorithmic analysis, while the homework problems will become progressively tougher. Undergraduates should be able to pass the course with an A if they have correctly answered most of the homework, appear at class prepared and on-time, and made a strong attempt at one of the projects. Graduate students should both perform well on the homework and successfully complete one or two projects. The re-grading for homework allows making up for missed assignments, and encourages returning to core concepts at a later point in the class. Students who have put in the studying effort, completed significant portions of the homework and projects both in- and out of class have thus demonstrated introductory programming proficiency. == Projects == * Midterm Project Description [[Media:Midterm2018.pdf]] (2 Mar., 2018) ** [[Agile|Agile Development Tips & Tricks]] * Final Project Description [[Media:Final2018.pdf]] (25 Apr., 2018) == Textbooks and Resources == * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-0072-7 Beginning Python, Hetland, 2005] (eBook avail. from USF Library) * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-3238-4 Python Algorithms, Hetland, 2010] (eBook avail. from USF Library) * [http://aosabook.org/en/index.html The Architecture of Open Source Applications] * [http://docs.python.org Python Documentation] * [https://developers.google.com/edu/python/ Google Introductory Python Notes] * [http://huffman.sourceforge.net/tao/tao-of-programming.html Tao of Programming] Other (possibly useful) materials: * [http://hackersdictionary.com/html/entry/larval-stage.html The Jargon File] * Chapters 7&8 of Modelling and Simulation, Birta and Arbez, Springer 2007 (eBook avail. from USF Library). * Chapters 4-6 of Models and Algorithms for Intelligent Data Analysis, Runkler, Springer 2012 (eBook avail. from USF Library). * Guide to Scientific Computing in C++, Francis and Whiteley, Springer, 2012. (eBook avail. from USF Library) * Extra info. On the basics: ** Chapters 3 and 7 of Mathematics in Computing, Regan, Springer 2013. (eBook avail. from USF Library) ** Instant feedback graphical programming with [https://www.khanacademy.org/cs/programming/ Khan Academy] * [http://www.meetup.com/python-178/ Local PyBulls Meetings] Code: * [http://carsonfarmer.com/2013/07/essential-python-geo-libraries Python Libraries Useful for Geospatial Problems] * [[Code#Python_Libraries|Python Libraries Useful for Computational Chemistry]] (very small list at present) Interactive Interpreters: * [http://www.codewars.com CodeWars] Recommended for building experience with practice problems. * [http://codecombat.com/ CodeCombat] A very visual way to interact with your python code. * [http://exercism.io Exercism] A command-line client with a similar learn-through-challenge philosophy. * [http://repl.it repl.it] A read-eval-print loop for several computer languages. * [http://en.cppreference.com/w/cpp/language CppReference] Documentation with an online evaluator for C++ code. === Notes === * [[Media:Intro.pdf|Introduction Notes]] <!-- * [[Media:Week2-2017.pdf|Week 2-3 Notes]] * Week 4: read through function syntax in [[Media:Week2.pdf|2016 Week 2]] and for-loops in [[Media:Week3.pdf|2016 Week 3-4]] * In-Class Examples ** [[Turing Exercise]] ** [https://predictivestatmech.org/code/example.dcd Example DCD File] * [[Media:Week-5.2017.pdf|Week 5 Notes]] * [[Media:PlottingMaps.pdf|Week 6 Notes]] ** [[Code:PyTesting]] * [[Media:NumpyArrays.pdf|Week 7 Notes]] ** [http://www.labri.fr/perso/nrougier/from-python-to-numpy/ all about numpy] * Misc. Notes for Week 8 ** [[Physics:Pairs|Rundown of Pair Interactions]] ** Parameterized surfaces [[Media:param1.jpg|1]] and [[Media:param2.jpg|2]] * Notes for Compilation Lab ** [https://learnpythonthehardway.org/book/appendixa.html Command Line Crash Course] Cheat sheet for bash commands. ** USF's compute cluster documentation at [https://wiki.rc.usf.edu/index.php/Main_Page RC Wiki]. *** See especially the "Connecting to SC" and "Modules" sections ** [[Code:Compiling|Cheat-codes]] for compilation lab. * [[Media:jobs.pdf|Research Computing Batch Queue]] * [[Media:Plug-in.pdf|Plugging Into Libraries]] * [[Media:Matrix.pdf|Matrix Algorithms]] --> === In-Class Problems === * Week 1: [[Media:CalculatorProbs.pdf|Calculator Problems]] ** Solutions: [http://predictivestatmech.org/terms/term.html] ** This solution uses python list comprehensions, and shows that the slowest step is actually unit conversion! * Week 2: [[Media:Pseudocode.pdf|Pseudocode Problems]] ** We will work these in class. For practice, be sure you have python list ideas down! ** Solutions: [https://docs.google.com/document/d/1HRkSdVNsTUydY4cVx67jRHRyhi5gL6nneEj9IX89wlE/edit?usp=sharing] * Week 3: [[Media:Plotting1.pdf|Plotting 1]] ** [https://stackoverflow.com/questions/11815538/how-to-import-matplotlib-in-python#11830055 Notes on installing Matplotlib on your own computer] ** Challenge: actions vs. functions -- what does the following code do: "[ print(1) for i in range(10) ]" (python3 only) * Week 4: [[Media:Plotting2.pdf|Plotting 2]] ** Solutions: [https://docs.google.com/document/d/1AanEFQmxLxoNM-662MHxsxToY3wsqovNx6SwcPQuBIg/edit?usp=sharing] <source lang="python"> # This is a preview of next week's activity: # Scale and shift the sequence 0, ..., 99 to the new sequence 0.8, 0.83, ..., 3.77 x = [ i*3/100.0 + 0.8 for i in range(100) ] # Calculate the LJ function for each x-value in the sequence, "x" of x-values. y = [ 4*(xi**-12 - xi**-6) for xi in x] import matplotlib.pyplot as plt plt.plot(x, y) plt.show() </source> === Homework === * Homework will be assigned through Repl.IT * Project presentations will be on Mon.-Wed., Mar 5-7 * Final Project presentations will be during exam time, Wed., May 2 3dd2bced4269f953b4e506952e4903d37b7bb350 633 632 2018-02-05T12:20:29Z David M. Rogers 2 /* In-Class Problems */ wikitext text/x-wiki '''<BIG>Introduction to Scientific Computing</BIG>''' Course Info * Course Numbers CHM 4932-004/6938-010, CRN: 20438/20439 * Credit Hours: 3 * Meeting Dates: January 8 - April 25, 2018 ** No Class Jan. 15 or Mar. 12-18 * Meeting Times: Mon. and Wed., 12:30-13:45 in SCA 222 ** Midterm Project Presentations: Mon.-Wed., Mar 5 and 7. ** Final Project Presentations: Wed., May 2, 10:00am – 12:00pm (scheduled final date) ** Lab Session & Office Hours: Fri. 12:30-13:45 in IDR 214 (or SCA 222 by announcement) <pre> $ for((i=1;i<=4;i++)); do cal $i 2018; done ____ January 2018 ____ _____ March 2018 ____ | Su Mo Tu We Th Fr Sa | | Su Mo Tu We Th Fr Sa | 1 2 3 4 5 6 | | 1 (2) 3 1 | 7 8 9*10 11 12 13 | 9 | 4 (5) 6 (7) 8 9 10 2 | 14 x 16*17 18 19 20 | | x x 3 | 21*22 23 24 25 26 27 | 10 | 18*19 20 21 22 23 24 4 | 28*29 30 31 | 11 | 25*26 27 28 29 30 31 ___ February 2018 ____ _____ April 2018 ____ | Su Mo Tu We Th Fr Sa | | Su Mo Tu We Th Fr Sa | 1 2 3 | 12 | 1 *2 3 4 5 6 7 5 | 4 *5 6 7 8 9 10 | 13 | 8 *9 10 11 12 13 14 6 | 11*12 13 14 15 16 17 | 14 | 15*16 17 18 19 20 21 7 | 18*19 20 21 22 23 24 | 15 | 22*23 24(25)26 27 28 8 | 25*26 27 28 | | 29 x Week Topic 1 Calculator Form 2 Pseudocode 3 Plotting 1 (Excel) 4 Plotting 2 (Matplotlib and linear spaces) 5 Abstraction 1 (advanced functions and oo method) 6 Abstraction 2 (Booleans and logic) 7 2D transforms and iterated maps 8 Optimization 1 (Newton-Rhapson) 9 midterm project presentations 10 Optimization 2 (MD Energy) 11 ODE and SDE algorithms 12 Statistics 13 Complexity 14 Circe and Linux crash course 15 Compile & install process, ctypes </pre> == Overview == Mathematical models in the natural sciences take many shapes and forms. The moment they become more complicated than tracking a few variables over time, we have to put away our Excel spreadsheets and make use of a solid foundation in computational science. The course establishes this foundation by introducing data structures and algorithms used in everyday scientific computing using examples in the python scripting language. By the end of the Semester, students will be able to navigate the Linux command-line to go from a mathematical model to a numerical solution. Best practices for working with computer code and visualizing data will also be covered. == Topics == # Languages #* bash (shell) #* python (scripting) #* stack & register-based machine languages: overview of C and Fortran syntax & compiling with gcc, ‘thread safety’ #* Shared libraries & language inter-operability (FFI) # Algorithms #* Horner’s algorithm for polynomials #* Newton’s root finding algo. #* Overview of general optimization algo-s (example: linear & nonlin. least-squares) #* Numerical integration (scripted, plus gnu ODE) #* Communication (how HTTP get/put works) # Data Structures #* Linked Lists #* Trees (file system hierarchies) #* Graphs #* Arrays (dense & sparse) example: vectors & rotations / transpositions, densities and difference operators # Presentation & visualization #* Flat CSV files (and excel) #* Working with binary data #* Python matplotlib (2D images) #* Binning histograms & weighted averages # Best Practices #* High-level code design (modularity, interface specifications, unit testing, etc.) #* Code audit: open-source libraries, ex. Gnu Scientific Library, qsort in libc, Boost #* Source code versioning (example: git or mercurial) #* gdb & execution profiling #* documentation #* Makefiles == Grading == '''Grading Scale (out of 400 points possible)''' {| class="wikitable" |- ! Grade ! Undergraduate ! Graduate |- | A+ | 269 | 323 |- | A | 258 | 310 |- | A- | 250 | 300 |- | B+ | 241 | 290 |- | B | 230 | 276 |- | B- | 222 | 266 |- | C+ | 213 | 256 |- | C | 202 | 243 |- | C- | 194 | 233 |- | D+ | 186 | 223 |- | D | 175 | 210 |- | D- | 166 | 200 |} * (280 U / 330 G) Points Possible: ** 9 homework assignments (10 points per homework) ** 14 in-class assignments / quizzes (10 points per week) ** 2 projects / competitions (50 points per project) ** Undergraduates must complete 1 project, graduates must complete 2 * Important Rules ** For maximum benefit, homework should be done on-time. However, homework will be allowed to be re-submitted at any time for full credit, but must present a unique solution to previous work from yourself or others. ** All work must cite co-group members (if any) and the source of any code snippets used online. === Grading Rationale === Homework points will only be awarded for correct, working code and correct algorithmic analysis, while the homework problems will become progressively tougher. Undergraduates should be able to pass the course with an A if they have correctly answered most of the homework, appear at class prepared and on-time, and made a strong attempt at one of the projects. Graduate students should both perform well on the homework and successfully complete one or two projects. The re-grading for homework allows making up for missed assignments, and encourages returning to core concepts at a later point in the class. Students who have put in the studying effort, completed significant portions of the homework and projects both in- and out of class have thus demonstrated introductory programming proficiency. == Projects == * Midterm Project Description [[Media:Midterm2018.pdf]] (2 Mar., 2018) ** [[Agile|Agile Development Tips & Tricks]] * Final Project Description [[Media:Final2018.pdf]] (25 Apr., 2018) == Textbooks and Resources == * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-0072-7 Beginning Python, Hetland, 2005] (eBook avail. from USF Library) * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-3238-4 Python Algorithms, Hetland, 2010] (eBook avail. from USF Library) * [http://aosabook.org/en/index.html The Architecture of Open Source Applications] * [http://docs.python.org Python Documentation] * [https://developers.google.com/edu/python/ Google Introductory Python Notes] * [http://huffman.sourceforge.net/tao/tao-of-programming.html Tao of Programming] Other (possibly useful) materials: * [http://hackersdictionary.com/html/entry/larval-stage.html The Jargon File] * Chapters 7&8 of Modelling and Simulation, Birta and Arbez, Springer 2007 (eBook avail. from USF Library). * Chapters 4-6 of Models and Algorithms for Intelligent Data Analysis, Runkler, Springer 2012 (eBook avail. from USF Library). * Guide to Scientific Computing in C++, Francis and Whiteley, Springer, 2012. (eBook avail. from USF Library) * Extra info. On the basics: ** Chapters 3 and 7 of Mathematics in Computing, Regan, Springer 2013. (eBook avail. from USF Library) ** Instant feedback graphical programming with [https://www.khanacademy.org/cs/programming/ Khan Academy] * [http://www.meetup.com/python-178/ Local PyBulls Meetings] Code: * [http://carsonfarmer.com/2013/07/essential-python-geo-libraries Python Libraries Useful for Geospatial Problems] * [[Code#Python_Libraries|Python Libraries Useful for Computational Chemistry]] (very small list at present) Interactive Interpreters: * [http://www.codewars.com CodeWars] Recommended for building experience with practice problems. * [http://codecombat.com/ CodeCombat] A very visual way to interact with your python code. * [http://exercism.io Exercism] A command-line client with a similar learn-through-challenge philosophy. * [http://repl.it repl.it] A read-eval-print loop for several computer languages. * [http://en.cppreference.com/w/cpp/language CppReference] Documentation with an online evaluator for C++ code. === Notes === * [[Media:Intro.pdf|Introduction Notes]] <!-- * [[Media:Week2-2017.pdf|Week 2-3 Notes]] * Week 4: read through function syntax in [[Media:Week2.pdf|2016 Week 2]] and for-loops in [[Media:Week3.pdf|2016 Week 3-4]] * In-Class Examples ** [[Turing Exercise]] ** [https://predictivestatmech.org/code/example.dcd Example DCD File] * [[Media:Week-5.2017.pdf|Week 5 Notes]] * [[Media:PlottingMaps.pdf|Week 6 Notes]] ** [[Code:PyTesting]] * [[Media:NumpyArrays.pdf|Week 7 Notes]] ** [http://www.labri.fr/perso/nrougier/from-python-to-numpy/ all about numpy] * Misc. Notes for Week 8 ** [[Physics:Pairs|Rundown of Pair Interactions]] ** Parameterized surfaces [[Media:param1.jpg|1]] and [[Media:param2.jpg|2]] * Notes for Compilation Lab ** [https://learnpythonthehardway.org/book/appendixa.html Command Line Crash Course] Cheat sheet for bash commands. ** USF's compute cluster documentation at [https://wiki.rc.usf.edu/index.php/Main_Page RC Wiki]. *** See especially the "Connecting to SC" and "Modules" sections ** [[Code:Compiling|Cheat-codes]] for compilation lab. * [[Media:jobs.pdf|Research Computing Batch Queue]] * [[Media:Plug-in.pdf|Plugging Into Libraries]] * [[Media:Matrix.pdf|Matrix Algorithms]] --> === In-Class Problems === * Week 1: [[Media:CalculatorProbs.pdf|Calculator Problems]] ** Solutions: [http://predictivestatmech.org/terms/term.html] ** This solution uses python list comprehensions, and shows that the slowest step is actually unit conversion! * Week 2: [[Media:Pseudocode.pdf|Pseudocode Problems]] ** We will work these in class. For practice, be sure you have python list ideas down! ** Solutions: [https://docs.google.com/document/d/1HRkSdVNsTUydY4cVx67jRHRyhi5gL6nneEj9IX89wlE/edit?usp=sharing] * Week 3: [[Media:Plotting1.pdf|Plotting 1]] ** [https://stackoverflow.com/questions/11815538/how-to-import-matplotlib-in-python#11830055 Notes on installing Matplotlib on your own computer] ** Challenge: actions vs. functions -- what does the following code do: "[ print(1) for i in range(10) ]" (python3 only) * Week 4: [[Media:Plotting2.pdf|Plotting 2]] ** Solutions: [https://docs.google.com/document/d/1AanEFQmxLxoNM-662MHxsxToY3wsqovNx6SwcPQuBIg/edit?usp=sharing] * Week 5: Read pseudocode and plotting, focusing on types and syntax. Also, re-read the end of chapter summaries for Ch. 3, 5 and 6. <source lang="python"> # This is a preview of next week's activity: # Scale and shift the sequence 0, ..., 99 to the new sequence 0.8, 0.83, ..., 3.77 x = [ i*3/100.0 + 0.8 for i in range(100) ] # Calculate the LJ function for each x-value in the sequence, "x" of x-values. y = [ 4*(xi**-12 - xi**-6) for xi in x] import matplotlib.pyplot as plt plt.plot(x, y) plt.show() </source> === Homework === * Homework will be assigned through Repl.IT * Project presentations will be on Mon.-Wed., Mar 5-7 * Final Project presentations will be during exam time, Wed., May 2 a3b512287e9de036e45e1643d850c7930db19498 634 633 2018-02-11T23:16:05Z David M. Rogers 2 /* In-Class Problems */ wikitext text/x-wiki '''<BIG>Introduction to Scientific Computing</BIG>''' Course Info * Course Numbers CHM 4932-004/6938-010, CRN: 20438/20439 * Credit Hours: 3 * Meeting Dates: January 8 - April 25, 2018 ** No Class Jan. 15 or Mar. 12-18 * Meeting Times: Mon. and Wed., 12:30-13:45 in SCA 222 ** Midterm Project Presentations: Mon.-Wed., Mar 5 and 7. ** Final Project Presentations: Wed., May 2, 10:00am – 12:00pm (scheduled final date) ** Lab Session & Office Hours: Fri. 12:30-13:45 in IDR 214 (or SCA 222 by announcement) <pre> $ for((i=1;i<=4;i++)); do cal $i 2018; done ____ January 2018 ____ _____ March 2018 ____ | Su Mo Tu We Th Fr Sa | | Su Mo Tu We Th Fr Sa | 1 2 3 4 5 6 | | 1 (2) 3 1 | 7 8 9*10 11 12 13 | 9 | 4 (5) 6 (7) 8 9 10 2 | 14 x 16*17 18 19 20 | | x x 3 | 21*22 23 24 25 26 27 | 10 | 18*19 20 21 22 23 24 4 | 28*29 30 31 | 11 | 25*26 27 28 29 30 31 ___ February 2018 ____ _____ April 2018 ____ | Su Mo Tu We Th Fr Sa | | Su Mo Tu We Th Fr Sa | 1 2 3 | 12 | 1 *2 3 4 5 6 7 5 | 4 *5 6 7 8 9 10 | 13 | 8 *9 10 11 12 13 14 6 | 11*12 13 14 15 16 17 | 14 | 15*16 17 18 19 20 21 7 | 18*19 20 21 22 23 24 | 15 | 22*23 24(25)26 27 28 8 | 25*26 27 28 | | 29 x Week Topic 1 Calculator Form 2 Pseudocode 3 Plotting 1 (Excel) 4 Plotting 2 (Matplotlib and linear spaces) 5 Abstraction 1 (advanced functions and oo method) 6 Abstraction 2 (Booleans and logic) 7 2D transforms and iterated maps 8 Optimization 1 (Newton-Rhapson) 9 midterm project presentations 10 Optimization 2 (MD Energy) 11 ODE and SDE algorithms 12 Statistics 13 Complexity 14 Circe and Linux crash course 15 Compile & install process, ctypes </pre> == Overview == Mathematical models in the natural sciences take many shapes and forms. The moment they become more complicated than tracking a few variables over time, we have to put away our Excel spreadsheets and make use of a solid foundation in computational science. The course establishes this foundation by introducing data structures and algorithms used in everyday scientific computing using examples in the python scripting language. By the end of the Semester, students will be able to navigate the Linux command-line to go from a mathematical model to a numerical solution. Best practices for working with computer code and visualizing data will also be covered. == Topics == # Languages #* bash (shell) #* python (scripting) #* stack & register-based machine languages: overview of C and Fortran syntax & compiling with gcc, ‘thread safety’ #* Shared libraries & language inter-operability (FFI) # Algorithms #* Horner’s algorithm for polynomials #* Newton’s root finding algo. #* Overview of general optimization algo-s (example: linear & nonlin. least-squares) #* Numerical integration (scripted, plus gnu ODE) #* Communication (how HTTP get/put works) # Data Structures #* Linked Lists #* Trees (file system hierarchies) #* Graphs #* Arrays (dense & sparse) example: vectors & rotations / transpositions, densities and difference operators # Presentation & visualization #* Flat CSV files (and excel) #* Working with binary data #* Python matplotlib (2D images) #* Binning histograms & weighted averages # Best Practices #* High-level code design (modularity, interface specifications, unit testing, etc.) #* Code audit: open-source libraries, ex. Gnu Scientific Library, qsort in libc, Boost #* Source code versioning (example: git or mercurial) #* gdb & execution profiling #* documentation #* Makefiles == Grading == '''Grading Scale (out of 400 points possible)''' {| class="wikitable" |- ! Grade ! Undergraduate ! Graduate |- | A+ | 269 | 323 |- | A | 258 | 310 |- | A- | 250 | 300 |- | B+ | 241 | 290 |- | B | 230 | 276 |- | B- | 222 | 266 |- | C+ | 213 | 256 |- | C | 202 | 243 |- | C- | 194 | 233 |- | D+ | 186 | 223 |- | D | 175 | 210 |- | D- | 166 | 200 |} * (280 U / 330 G) Points Possible: ** 9 homework assignments (10 points per homework) ** 14 in-class assignments / quizzes (10 points per week) ** 2 projects / competitions (50 points per project) ** Undergraduates must complete 1 project, graduates must complete 2 * Important Rules ** For maximum benefit, homework should be done on-time. However, homework will be allowed to be re-submitted at any time for full credit, but must present a unique solution to previous work from yourself or others. ** All work must cite co-group members (if any) and the source of any code snippets used online. === Grading Rationale === Homework points will only be awarded for correct, working code and correct algorithmic analysis, while the homework problems will become progressively tougher. Undergraduates should be able to pass the course with an A if they have correctly answered most of the homework, appear at class prepared and on-time, and made a strong attempt at one of the projects. Graduate students should both perform well on the homework and successfully complete one or two projects. The re-grading for homework allows making up for missed assignments, and encourages returning to core concepts at a later point in the class. Students who have put in the studying effort, completed significant portions of the homework and projects both in- and out of class have thus demonstrated introductory programming proficiency. == Projects == * Midterm Project Description [[Media:Midterm2018.pdf]] (2 Mar., 2018) ** [[Agile|Agile Development Tips & Tricks]] * Final Project Description [[Media:Final2018.pdf]] (25 Apr., 2018) == Textbooks and Resources == * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-0072-7 Beginning Python, Hetland, 2005] (eBook avail. from USF Library) * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-3238-4 Python Algorithms, Hetland, 2010] (eBook avail. from USF Library) * [http://aosabook.org/en/index.html The Architecture of Open Source Applications] * [http://docs.python.org Python Documentation] * [https://developers.google.com/edu/python/ Google Introductory Python Notes] * [http://huffman.sourceforge.net/tao/tao-of-programming.html Tao of Programming] Other (possibly useful) materials: * [http://hackersdictionary.com/html/entry/larval-stage.html The Jargon File] * Chapters 7&8 of Modelling and Simulation, Birta and Arbez, Springer 2007 (eBook avail. from USF Library). * Chapters 4-6 of Models and Algorithms for Intelligent Data Analysis, Runkler, Springer 2012 (eBook avail. from USF Library). * Guide to Scientific Computing in C++, Francis and Whiteley, Springer, 2012. (eBook avail. from USF Library) * Extra info. On the basics: ** Chapters 3 and 7 of Mathematics in Computing, Regan, Springer 2013. (eBook avail. from USF Library) ** Instant feedback graphical programming with [https://www.khanacademy.org/cs/programming/ Khan Academy] * [http://www.meetup.com/python-178/ Local PyBulls Meetings] Code: * [http://carsonfarmer.com/2013/07/essential-python-geo-libraries Python Libraries Useful for Geospatial Problems] * [[Code#Python_Libraries|Python Libraries Useful for Computational Chemistry]] (very small list at present) Interactive Interpreters: * [http://www.codewars.com CodeWars] Recommended for building experience with practice problems. * [http://codecombat.com/ CodeCombat] A very visual way to interact with your python code. * [http://exercism.io Exercism] A command-line client with a similar learn-through-challenge philosophy. * [http://repl.it repl.it] A read-eval-print loop for several computer languages. * [http://en.cppreference.com/w/cpp/language CppReference] Documentation with an online evaluator for C++ code. === Notes === * [[Media:Intro.pdf|Introduction Notes]] <!-- * [[Media:Week2-2017.pdf|Week 2-3 Notes]] * Week 4: read through function syntax in [[Media:Week2.pdf|2016 Week 2]] and for-loops in [[Media:Week3.pdf|2016 Week 3-4]] * In-Class Examples ** [[Turing Exercise]] ** [https://predictivestatmech.org/code/example.dcd Example DCD File] * [[Media:Week-5.2017.pdf|Week 5 Notes]] * [[Media:PlottingMaps.pdf|Week 6 Notes]] ** [[Code:PyTesting]] * [[Media:NumpyArrays.pdf|Week 7 Notes]] ** [http://www.labri.fr/perso/nrougier/from-python-to-numpy/ all about numpy] * Misc. Notes for Week 8 ** [[Physics:Pairs|Rundown of Pair Interactions]] ** Parameterized surfaces [[Media:param1.jpg|1]] and [[Media:param2.jpg|2]] * Notes for Compilation Lab ** [https://learnpythonthehardway.org/book/appendixa.html Command Line Crash Course] Cheat sheet for bash commands. ** USF's compute cluster documentation at [https://wiki.rc.usf.edu/index.php/Main_Page RC Wiki]. *** See especially the "Connecting to SC" and "Modules" sections ** [[Code:Compiling|Cheat-codes]] for compilation lab. * [[Media:jobs.pdf|Research Computing Batch Queue]] * [[Media:Plug-in.pdf|Plugging Into Libraries]] * [[Media:Matrix.pdf|Matrix Algorithms]] --> === In-Class Problems === * Week 1: [[Media:CalculatorProbs.pdf|Calculator Problems]] ** Solutions: [http://predictivestatmech.org/terms/term.html] ** This solution uses python list comprehensions, and shows that the slowest step is actually unit conversion! * Week 2: [[Media:Pseudocode.pdf|Pseudocode Problems]] ** We will work these in class. For practice, be sure you have python list ideas down! ** Solutions: [https://docs.google.com/document/d/1HRkSdVNsTUydY4cVx67jRHRyhi5gL6nneEj9IX89wlE/edit?usp=sharing] * Week 3: [[Media:Plotting1.pdf|Plotting 1]] ** [https://stackoverflow.com/questions/11815538/how-to-import-matplotlib-in-python#11830055 Notes on installing Matplotlib on your own computer] ** Challenge: actions vs. functions -- what does the following code do: "[ print(1) for i in range(10) ]" (python3 only) * Week 4: [[Media:Plotting2.pdf|Plotting 2]] ** Solutions: [https://docs.google.com/document/d/1AanEFQmxLxoNM-662MHxsxToY3wsqovNx6SwcPQuBIg/edit?usp=sharing] * Week 5: Read pseudocode and plotting, focusing on types and syntax. Also, re-read the end of chapter summaries for Ch. 3, 5 and 6. * Week 6: Read the following pieces on first order logic [http://bayes.wustl.edu/etj/prob/book.pdf Chapter 1 of Jaynes' Book] [http://web.cecs.pdx.edu/~cs410aph/Lectures/Smalltalk%20II/Dijkstra%20on%20Hamming%27s%20Problem.pdf Hamming's Problem], and pages 71-80 in Chapter 4 of Hetland's Algorithms book (on induction). Just skip directly to chapter 4. <source lang="python"> # Review Notes on Sequences, list comprehensions and arrays # Say you want to make a plot of the LJ function on the domain x \in [0.9, 3] # 1. You could use the following two list comprehensions to be specific: x = [ i*(3-0.9)/100.0 + 0.9 for i in range(101) ] y = [ 4*(xi**-12 - xi**-6) for xi in x] # 2. You could implement the LJ function as a python function and use MAP, def LJ(x): ix6 = x**-6 # the factoring makes this calculation more efficient return 4*ix6*(ix6 + 1.0) y = map(LJ, x) # 3. You could work on arrays, where addition, multiplication, and powers are elementwise: ax = arange(101)*(3-0.9)/100 + 0.9 ay = LJ(ax) # Mind the difference in type! type(x) type(ax) # 4. You could totally cheat, and use numpy's builtin functions. ax = linspace(0.9, 3.0, 101) # Exercise: replicate the steps above to test the finite difference computation # of the derivative against the analytical derivative of LJ. [ (y[i+1]-y[i])/(x[i+1]-x[i]) for i in ... import matplotlib.pyplot as plt plt.plot(x, y) plt.show() </source> === Homework === * Homework will be assigned through Repl.IT * Project presentations will be on Mon.-Wed., Mar 5-7 * Final Project presentations will be during exam time, Wed., May 2 81a180977ed4b4b00058867e9cdbbc641a76055c 635 634 2018-02-12T18:27:15Z David M. Rogers 2 /* In-Class Problems */ wikitext text/x-wiki '''<BIG>Introduction to Scientific Computing</BIG>''' Course Info * Course Numbers CHM 4932-004/6938-010, CRN: 20438/20439 * Credit Hours: 3 * Meeting Dates: January 8 - April 25, 2018 ** No Class Jan. 15 or Mar. 12-18 * Meeting Times: Mon. and Wed., 12:30-13:45 in SCA 222 ** Midterm Project Presentations: Mon.-Wed., Mar 5 and 7. ** Final Project Presentations: Wed., May 2, 10:00am – 12:00pm (scheduled final date) ** Lab Session & Office Hours: Fri. 12:30-13:45 in IDR 214 (or SCA 222 by announcement) <pre> $ for((i=1;i<=4;i++)); do cal $i 2018; done ____ January 2018 ____ _____ March 2018 ____ | Su Mo Tu We Th Fr Sa | | Su Mo Tu We Th Fr Sa | 1 2 3 4 5 6 | | 1 (2) 3 1 | 7 8 9*10 11 12 13 | 9 | 4 (5) 6 (7) 8 9 10 2 | 14 x 16*17 18 19 20 | | x x 3 | 21*22 23 24 25 26 27 | 10 | 18*19 20 21 22 23 24 4 | 28*29 30 31 | 11 | 25*26 27 28 29 30 31 ___ February 2018 ____ _____ April 2018 ____ | Su Mo Tu We Th Fr Sa | | Su Mo Tu We Th Fr Sa | 1 2 3 | 12 | 1 *2 3 4 5 6 7 5 | 4 *5 6 7 8 9 10 | 13 | 8 *9 10 11 12 13 14 6 | 11*12 13 14 15 16 17 | 14 | 15*16 17 18 19 20 21 7 | 18*19 20 21 22 23 24 | 15 | 22*23 24(25)26 27 28 8 | 25*26 27 28 | | 29 x Week Topic 1 Calculator Form 2 Pseudocode 3 Plotting 1 (Excel) 4 Plotting 2 (Matplotlib and linear spaces) 5 Abstraction 1 (advanced functions and oo method) 6 Abstraction 2 (Booleans and logic) 7 2D transforms and iterated maps 8 Optimization 1 (Newton-Rhapson) 9 midterm project presentations 10 Optimization 2 (MD Energy) 11 ODE and SDE algorithms 12 Statistics 13 Complexity 14 Circe and Linux crash course 15 Compile & install process, ctypes </pre> == Overview == Mathematical models in the natural sciences take many shapes and forms. The moment they become more complicated than tracking a few variables over time, we have to put away our Excel spreadsheets and make use of a solid foundation in computational science. The course establishes this foundation by introducing data structures and algorithms used in everyday scientific computing using examples in the python scripting language. By the end of the Semester, students will be able to navigate the Linux command-line to go from a mathematical model to a numerical solution. Best practices for working with computer code and visualizing data will also be covered. == Topics == # Languages #* bash (shell) #* python (scripting) #* stack & register-based machine languages: overview of C and Fortran syntax & compiling with gcc, ‘thread safety’ #* Shared libraries & language inter-operability (FFI) # Algorithms #* Horner’s algorithm for polynomials #* Newton’s root finding algo. #* Overview of general optimization algo-s (example: linear & nonlin. least-squares) #* Numerical integration (scripted, plus gnu ODE) #* Communication (how HTTP get/put works) # Data Structures #* Linked Lists #* Trees (file system hierarchies) #* Graphs #* Arrays (dense & sparse) example: vectors & rotations / transpositions, densities and difference operators # Presentation & visualization #* Flat CSV files (and excel) #* Working with binary data #* Python matplotlib (2D images) #* Binning histograms & weighted averages # Best Practices #* High-level code design (modularity, interface specifications, unit testing, etc.) #* Code audit: open-source libraries, ex. Gnu Scientific Library, qsort in libc, Boost #* Source code versioning (example: git or mercurial) #* gdb & execution profiling #* documentation #* Makefiles == Grading == '''Grading Scale (out of 400 points possible)''' {| class="wikitable" |- ! Grade ! Undergraduate ! Graduate |- | A+ | 269 | 323 |- | A | 258 | 310 |- | A- | 250 | 300 |- | B+ | 241 | 290 |- | B | 230 | 276 |- | B- | 222 | 266 |- | C+ | 213 | 256 |- | C | 202 | 243 |- | C- | 194 | 233 |- | D+ | 186 | 223 |- | D | 175 | 210 |- | D- | 166 | 200 |} * (280 U / 330 G) Points Possible: ** 9 homework assignments (10 points per homework) ** 14 in-class assignments / quizzes (10 points per week) ** 2 projects / competitions (50 points per project) ** Undergraduates must complete 1 project, graduates must complete 2 * Important Rules ** For maximum benefit, homework should be done on-time. However, homework will be allowed to be re-submitted at any time for full credit, but must present a unique solution to previous work from yourself or others. ** All work must cite co-group members (if any) and the source of any code snippets used online. === Grading Rationale === Homework points will only be awarded for correct, working code and correct algorithmic analysis, while the homework problems will become progressively tougher. Undergraduates should be able to pass the course with an A if they have correctly answered most of the homework, appear at class prepared and on-time, and made a strong attempt at one of the projects. Graduate students should both perform well on the homework and successfully complete one or two projects. The re-grading for homework allows making up for missed assignments, and encourages returning to core concepts at a later point in the class. Students who have put in the studying effort, completed significant portions of the homework and projects both in- and out of class have thus demonstrated introductory programming proficiency. == Projects == * Midterm Project Description [[Media:Midterm2018.pdf]] (2 Mar., 2018) ** [[Agile|Agile Development Tips & Tricks]] * Final Project Description [[Media:Final2018.pdf]] (25 Apr., 2018) == Textbooks and Resources == * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-0072-7 Beginning Python, Hetland, 2005] (eBook avail. from USF Library) * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-3238-4 Python Algorithms, Hetland, 2010] (eBook avail. from USF Library) * [http://aosabook.org/en/index.html The Architecture of Open Source Applications] * [http://docs.python.org Python Documentation] * [https://developers.google.com/edu/python/ Google Introductory Python Notes] * [http://huffman.sourceforge.net/tao/tao-of-programming.html Tao of Programming] Other (possibly useful) materials: * [http://hackersdictionary.com/html/entry/larval-stage.html The Jargon File] * Chapters 7&8 of Modelling and Simulation, Birta and Arbez, Springer 2007 (eBook avail. from USF Library). * Chapters 4-6 of Models and Algorithms for Intelligent Data Analysis, Runkler, Springer 2012 (eBook avail. from USF Library). * Guide to Scientific Computing in C++, Francis and Whiteley, Springer, 2012. (eBook avail. from USF Library) * Extra info. On the basics: ** Chapters 3 and 7 of Mathematics in Computing, Regan, Springer 2013. (eBook avail. from USF Library) ** Instant feedback graphical programming with [https://www.khanacademy.org/cs/programming/ Khan Academy] * [http://www.meetup.com/python-178/ Local PyBulls Meetings] Code: * [http://carsonfarmer.com/2013/07/essential-python-geo-libraries Python Libraries Useful for Geospatial Problems] * [[Code#Python_Libraries|Python Libraries Useful for Computational Chemistry]] (very small list at present) Interactive Interpreters: * [http://www.codewars.com CodeWars] Recommended for building experience with practice problems. * [http://codecombat.com/ CodeCombat] A very visual way to interact with your python code. * [http://exercism.io Exercism] A command-line client with a similar learn-through-challenge philosophy. * [http://repl.it repl.it] A read-eval-print loop for several computer languages. * [http://en.cppreference.com/w/cpp/language CppReference] Documentation with an online evaluator for C++ code. === Notes === * [[Media:Intro.pdf|Introduction Notes]] <!-- * [[Media:Week2-2017.pdf|Week 2-3 Notes]] * Week 4: read through function syntax in [[Media:Week2.pdf|2016 Week 2]] and for-loops in [[Media:Week3.pdf|2016 Week 3-4]] * In-Class Examples ** [[Turing Exercise]] ** [https://predictivestatmech.org/code/example.dcd Example DCD File] * [[Media:Week-5.2017.pdf|Week 5 Notes]] * [[Media:PlottingMaps.pdf|Week 6 Notes]] ** [[Code:PyTesting]] * [[Media:NumpyArrays.pdf|Week 7 Notes]] ** [http://www.labri.fr/perso/nrougier/from-python-to-numpy/ all about numpy] * Misc. Notes for Week 8 ** [[Physics:Pairs|Rundown of Pair Interactions]] ** Parameterized surfaces [[Media:param1.jpg|1]] and [[Media:param2.jpg|2]] * Notes for Compilation Lab ** [https://learnpythonthehardway.org/book/appendixa.html Command Line Crash Course] Cheat sheet for bash commands. ** USF's compute cluster documentation at [https://wiki.rc.usf.edu/index.php/Main_Page RC Wiki]. *** See especially the "Connecting to SC" and "Modules" sections ** [[Code:Compiling|Cheat-codes]] for compilation lab. * [[Media:jobs.pdf|Research Computing Batch Queue]] * [[Media:Plug-in.pdf|Plugging Into Libraries]] * [[Media:Matrix.pdf|Matrix Algorithms]] --> === In-Class Problems === * Week 1: [[Media:CalculatorProbs.pdf|Calculator Problems]] ** Solutions: [http://predictivestatmech.org/terms/term.html] ** This solution uses python list comprehensions, and shows that the slowest step is actually unit conversion! * Week 2: [[Media:Pseudocode.pdf|Pseudocode Problems]] ** We will work these in class. For practice, be sure you have python list ideas down! ** Solutions: [https://docs.google.com/document/d/1HRkSdVNsTUydY4cVx67jRHRyhi5gL6nneEj9IX89wlE/edit?usp=sharing] * Week 3: [[Media:Plotting1.pdf|Plotting 1]] ** [https://stackoverflow.com/questions/11815538/how-to-import-matplotlib-in-python#11830055 Notes on installing Matplotlib on your own computer] ** Challenge: actions vs. functions -- what does the following code do: "[ print(1) for i in range(10) ]" (python3 only) * Week 4: [[Media:Plotting2.pdf|Plotting 2]] ** Solutions: [https://docs.google.com/document/d/1AanEFQmxLxoNM-662MHxsxToY3wsqovNx6SwcPQuBIg/edit?usp=sharing] * Week 5: Read pseudocode and plotting, focusing on types and syntax. Also, re-read the end of chapter summaries for Ch. 3, 5 and 6. * Week 6: Read the following pieces on first order logic [http://bayes.wustl.edu/etj/prob/book.pdf Chapter 1 of Jaynes' Book] [http://web.cecs.pdx.edu/~cs410aph/Lectures/Smalltalk%20II/Dijkstra%20on%20Hamming%27s%20Problem.pdf Hamming's Problem], and pages 71-80 in Chapter 4 of Hetland's Algorithms book (on induction). Just skip directly to chapter 4. ** Solutions [https://docs.google.com/document/d/14QZxh2SAWl3JE-SzVyemkAv4p9TBChO-jzZ5YpT8BZs/edit?usp=sharing] <source lang="python"> # Review Notes on Sequences, list comprehensions and arrays # Say you want to make a plot of the LJ function on the domain x \in [0.9, 3] # 1. You could use the following two list comprehensions to be specific: x = [ i*(3-0.9)/100.0 + 0.9 for i in range(101) ] y = [ 4*(xi**-12 - xi**-6) for xi in x] # 2. You could implement the LJ function as a python function and use MAP, def LJ(x): ix6 = x**-6 # the factoring makes this calculation more efficient return 4*ix6*(ix6 + 1.0) y = map(LJ, x) # 3. You could work on arrays, where addition, multiplication, and powers are elementwise: ax = arange(101)*(3-0.9)/100 + 0.9 ay = LJ(ax) # Mind the difference in type! type(x) type(ax) # 4. You could totally cheat, and use numpy's builtin functions. ax = linspace(0.9, 3.0, 101) # Exercise: replicate the steps above to test the finite difference computation # of the derivative against the analytical derivative of LJ. [ (y[i+1]-y[i])/(x[i+1]-x[i]) for i in ... import matplotlib.pyplot as plt plt.plot(x, y) plt.show() </source> === Homework === * Homework will be assigned through Repl.IT * Project presentations will be on Mon.-Wed., Mar 5-7 * Final Project presentations will be during exam time, Wed., May 2 559dba91264155806612b9fd9da51b280072ec78 636 635 2018-02-19T11:06:10Z David M. Rogers 2 /* In-Class Problems */ wikitext text/x-wiki '''<BIG>Introduction to Scientific Computing</BIG>''' Course Info * Course Numbers CHM 4932-004/6938-010, CRN: 20438/20439 * Credit Hours: 3 * Meeting Dates: January 8 - April 25, 2018 ** No Class Jan. 15 or Mar. 12-18 * Meeting Times: Mon. and Wed., 12:30-13:45 in SCA 222 ** Midterm Project Presentations: Mon.-Wed., Mar 5 and 7. ** Final Project Presentations: Wed., May 2, 10:00am – 12:00pm (scheduled final date) ** Lab Session & Office Hours: Fri. 12:30-13:45 in IDR 214 (or SCA 222 by announcement) <pre> $ for((i=1;i<=4;i++)); do cal $i 2018; done ____ January 2018 ____ _____ March 2018 ____ | Su Mo Tu We Th Fr Sa | | Su Mo Tu We Th Fr Sa | 1 2 3 4 5 6 | | 1 (2) 3 1 | 7 8 9*10 11 12 13 | 9 | 4 (5) 6 (7) 8 9 10 2 | 14 x 16*17 18 19 20 | | x x 3 | 21*22 23 24 25 26 27 | 10 | 18*19 20 21 22 23 24 4 | 28*29 30 31 | 11 | 25*26 27 28 29 30 31 ___ February 2018 ____ _____ April 2018 ____ | Su Mo Tu We Th Fr Sa | | Su Mo Tu We Th Fr Sa | 1 2 3 | 12 | 1 *2 3 4 5 6 7 5 | 4 *5 6 7 8 9 10 | 13 | 8 *9 10 11 12 13 14 6 | 11*12 13 14 15 16 17 | 14 | 15*16 17 18 19 20 21 7 | 18*19 20 21 22 23 24 | 15 | 22*23 24(25)26 27 28 8 | 25*26 27 28 | | 29 x Week Topic 1 Calculator Form 2 Pseudocode 3 Plotting 1 (Excel) 4 Plotting 2 (Matplotlib and linear spaces) 5 Abstraction 1 (advanced functions and oo method) 6 Abstraction 2 (Booleans and logic) 7 2D transforms and iterated maps 8 Optimization 1 (Newton-Rhapson) 9 midterm project presentations 10 Optimization 2 (MD Energy) 11 ODE and SDE algorithms 12 Statistics 13 Complexity 14 Circe and Linux crash course 15 Compile & install process, ctypes </pre> == Overview == Mathematical models in the natural sciences take many shapes and forms. The moment they become more complicated than tracking a few variables over time, we have to put away our Excel spreadsheets and make use of a solid foundation in computational science. The course establishes this foundation by introducing data structures and algorithms used in everyday scientific computing using examples in the python scripting language. By the end of the Semester, students will be able to navigate the Linux command-line to go from a mathematical model to a numerical solution. Best practices for working with computer code and visualizing data will also be covered. == Topics == # Languages #* bash (shell) #* python (scripting) #* stack & register-based machine languages: overview of C and Fortran syntax & compiling with gcc, ‘thread safety’ #* Shared libraries & language inter-operability (FFI) # Algorithms #* Horner’s algorithm for polynomials #* Newton’s root finding algo. #* Overview of general optimization algo-s (example: linear & nonlin. least-squares) #* Numerical integration (scripted, plus gnu ODE) #* Communication (how HTTP get/put works) # Data Structures #* Linked Lists #* Trees (file system hierarchies) #* Graphs #* Arrays (dense & sparse) example: vectors & rotations / transpositions, densities and difference operators # Presentation & visualization #* Flat CSV files (and excel) #* Working with binary data #* Python matplotlib (2D images) #* Binning histograms & weighted averages # Best Practices #* High-level code design (modularity, interface specifications, unit testing, etc.) #* Code audit: open-source libraries, ex. Gnu Scientific Library, qsort in libc, Boost #* Source code versioning (example: git or mercurial) #* gdb & execution profiling #* documentation #* Makefiles == Grading == '''Grading Scale (out of 400 points possible)''' {| class="wikitable" |- ! Grade ! Undergraduate ! Graduate |- | A+ | 269 | 323 |- | A | 258 | 310 |- | A- | 250 | 300 |- | B+ | 241 | 290 |- | B | 230 | 276 |- | B- | 222 | 266 |- | C+ | 213 | 256 |- | C | 202 | 243 |- | C- | 194 | 233 |- | D+ | 186 | 223 |- | D | 175 | 210 |- | D- | 166 | 200 |} * (280 U / 330 G) Points Possible: ** 9 homework assignments (10 points per homework) ** 14 in-class assignments / quizzes (10 points per week) ** 2 projects / competitions (50 points per project) ** Undergraduates must complete 1 project, graduates must complete 2 * Important Rules ** For maximum benefit, homework should be done on-time. However, homework will be allowed to be re-submitted at any time for full credit, but must present a unique solution to previous work from yourself or others. ** All work must cite co-group members (if any) and the source of any code snippets used online. === Grading Rationale === Homework points will only be awarded for correct, working code and correct algorithmic analysis, while the homework problems will become progressively tougher. Undergraduates should be able to pass the course with an A if they have correctly answered most of the homework, appear at class prepared and on-time, and made a strong attempt at one of the projects. Graduate students should both perform well on the homework and successfully complete one or two projects. The re-grading for homework allows making up for missed assignments, and encourages returning to core concepts at a later point in the class. Students who have put in the studying effort, completed significant portions of the homework and projects both in- and out of class have thus demonstrated introductory programming proficiency. == Projects == * Midterm Project Description [[Media:Midterm2018.pdf]] (2 Mar., 2018) ** [[Agile|Agile Development Tips & Tricks]] * Final Project Description [[Media:Final2018.pdf]] (25 Apr., 2018) == Textbooks and Resources == * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-0072-7 Beginning Python, Hetland, 2005] (eBook avail. from USF Library) * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-3238-4 Python Algorithms, Hetland, 2010] (eBook avail. from USF Library) * [http://aosabook.org/en/index.html The Architecture of Open Source Applications] * [http://docs.python.org Python Documentation] * [https://developers.google.com/edu/python/ Google Introductory Python Notes] * [http://huffman.sourceforge.net/tao/tao-of-programming.html Tao of Programming] Other (possibly useful) materials: * [http://hackersdictionary.com/html/entry/larval-stage.html The Jargon File] * Chapters 7&8 of Modelling and Simulation, Birta and Arbez, Springer 2007 (eBook avail. from USF Library). * Chapters 4-6 of Models and Algorithms for Intelligent Data Analysis, Runkler, Springer 2012 (eBook avail. from USF Library). * Guide to Scientific Computing in C++, Francis and Whiteley, Springer, 2012. (eBook avail. from USF Library) * Extra info. On the basics: ** Chapters 3 and 7 of Mathematics in Computing, Regan, Springer 2013. (eBook avail. from USF Library) ** Instant feedback graphical programming with [https://www.khanacademy.org/cs/programming/ Khan Academy] * [http://www.meetup.com/python-178/ Local PyBulls Meetings] Code: * [http://carsonfarmer.com/2013/07/essential-python-geo-libraries Python Libraries Useful for Geospatial Problems] * [[Code#Python_Libraries|Python Libraries Useful for Computational Chemistry]] (very small list at present) Interactive Interpreters: * [http://www.codewars.com CodeWars] Recommended for building experience with practice problems. * [http://codecombat.com/ CodeCombat] A very visual way to interact with your python code. * [http://exercism.io Exercism] A command-line client with a similar learn-through-challenge philosophy. * [http://repl.it repl.it] A read-eval-print loop for several computer languages. * [http://en.cppreference.com/w/cpp/language CppReference] Documentation with an online evaluator for C++ code. === Notes === * [[Media:Intro.pdf|Introduction Notes]] <!-- * [[Media:Week2-2017.pdf|Week 2-3 Notes]] * Week 4: read through function syntax in [[Media:Week2.pdf|2016 Week 2]] and for-loops in [[Media:Week3.pdf|2016 Week 3-4]] * In-Class Examples ** [[Turing Exercise]] ** [https://predictivestatmech.org/code/example.dcd Example DCD File] * [[Media:Week-5.2017.pdf|Week 5 Notes]] * [[Media:PlottingMaps.pdf|Week 6 Notes]] ** [[Code:PyTesting]] * [[Media:NumpyArrays.pdf|Week 7 Notes]] ** [http://www.labri.fr/perso/nrougier/from-python-to-numpy/ all about numpy] * Misc. Notes for Week 8 ** [[Physics:Pairs|Rundown of Pair Interactions]] ** Parameterized surfaces [[Media:param1.jpg|1]] and [[Media:param2.jpg|2]] * Notes for Compilation Lab ** [https://learnpythonthehardway.org/book/appendixa.html Command Line Crash Course] Cheat sheet for bash commands. ** USF's compute cluster documentation at [https://wiki.rc.usf.edu/index.php/Main_Page RC Wiki]. *** See especially the "Connecting to SC" and "Modules" sections ** [[Code:Compiling|Cheat-codes]] for compilation lab. * [[Media:jobs.pdf|Research Computing Batch Queue]] * [[Media:Plug-in.pdf|Plugging Into Libraries]] * [[Media:Matrix.pdf|Matrix Algorithms]] --> === In-Class Problems === * Week 1: [[Media:CalculatorProbs.pdf|Calculator Problems]] ** Solutions: [http://predictivestatmech.org/terms/term.html] ** This solution uses python list comprehensions, and shows that the slowest step is actually unit conversion! * Week 2: [[Media:Pseudocode.pdf|Pseudocode Problems]] ** We will work these in class. For practice, be sure you have python list ideas down! ** Solutions: [https://docs.google.com/document/d/1HRkSdVNsTUydY4cVx67jRHRyhi5gL6nneEj9IX89wlE/edit?usp=sharing] * Week 3: [[Media:Plotting1.pdf|Plotting 1]] ** [https://stackoverflow.com/questions/11815538/how-to-import-matplotlib-in-python#11830055 Notes on installing Matplotlib on your own computer] ** Challenge: actions vs. functions -- what does the following code do: "[ print(1) for i in range(10) ]" (python3 only) * Week 4: [[Media:Plotting2.pdf|Plotting 2]] ** Solutions: [https://docs.google.com/document/d/1AanEFQmxLxoNM-662MHxsxToY3wsqovNx6SwcPQuBIg/edit?usp=sharing] * Week 5: Read pseudocode and plotting, focusing on types and syntax. Also, re-read the end of chapter summaries for Ch. 3, 5 and 6. * Week 6: Read the following pieces on first order logic [http://bayes.wustl.edu/etj/prob/book.pdf Chapter 1 of Jaynes' Book] [http://web.cecs.pdx.edu/~cs410aph/Lectures/Smalltalk%20II/Dijkstra%20on%20Hamming%27s%20Problem.pdf Hamming's Problem], and pages 71-80 in Chapter 4 of Hetland's Algorithms book (on induction). Just skip directly to chapter 4. ** Solutions [https://docs.google.com/document/d/14QZxh2SAWl3JE-SzVyemkAv4p9TBChO-jzZ5YpT8BZs/edit?usp=sharing] * Week 7: Review Hetland, Chapters 3-7. We'll do a series of parsing problems and flex our collective induction and recursion muscles. <source lang="python"> # Review Notes on Sequences, list comprehensions and arrays # Say you want to make a plot of the LJ function on the domain x \in [0.9, 3] # 1. You could use the following two list comprehensions to be specific: x = [ i*(3-0.9)/100.0 + 0.9 for i in range(101) ] y = [ 4*(xi**-12 - xi**-6) for xi in x] # 2. You could implement the LJ function as a python function and use MAP, def LJ(x): ix6 = x**-6 # the factoring makes this calculation more efficient return 4*ix6*(ix6 + 1.0) y = map(LJ, x) # 3. You could work on arrays, where addition, multiplication, and powers are elementwise: ax = arange(101)*(3-0.9)/100 + 0.9 ay = LJ(ax) # Mind the difference in type! type(x) type(ax) # 4. You could totally cheat, and use numpy's builtin functions. ax = linspace(0.9, 3.0, 101) # Exercise: replicate the steps above to test the finite difference computation # of the derivative against the analytical derivative of LJ. [ (y[i+1]-y[i])/(x[i+1]-x[i]) for i in ... import matplotlib.pyplot as plt plt.plot(x, y) plt.show() </source> === Homework === * Homework will be assigned through Repl.IT * Project presentations will be on Mon.-Wed., Mar 5-7 * Final Project presentations will be during exam time, Wed., May 2 da94c2aed43238d46fefc9d916556f9bac1fe2f9 637 636 2018-02-19T12:31:00Z David M. Rogers 2 /* In-Class Problems */ wikitext text/x-wiki '''<BIG>Introduction to Scientific Computing</BIG>''' Course Info * Course Numbers CHM 4932-004/6938-010, CRN: 20438/20439 * Credit Hours: 3 * Meeting Dates: January 8 - April 25, 2018 ** No Class Jan. 15 or Mar. 12-18 * Meeting Times: Mon. and Wed., 12:30-13:45 in SCA 222 ** Midterm Project Presentations: Mon.-Wed., Mar 5 and 7. ** Final Project Presentations: Wed., May 2, 10:00am – 12:00pm (scheduled final date) ** Lab Session & Office Hours: Fri. 12:30-13:45 in IDR 214 (or SCA 222 by announcement) <pre> $ for((i=1;i<=4;i++)); do cal $i 2018; done ____ January 2018 ____ _____ March 2018 ____ | Su Mo Tu We Th Fr Sa | | Su Mo Tu We Th Fr Sa | 1 2 3 4 5 6 | | 1 (2) 3 1 | 7 8 9*10 11 12 13 | 9 | 4 (5) 6 (7) 8 9 10 2 | 14 x 16*17 18 19 20 | | x x 3 | 21*22 23 24 25 26 27 | 10 | 18*19 20 21 22 23 24 4 | 28*29 30 31 | 11 | 25*26 27 28 29 30 31 ___ February 2018 ____ _____ April 2018 ____ | Su Mo Tu We Th Fr Sa | | Su Mo Tu We Th Fr Sa | 1 2 3 | 12 | 1 *2 3 4 5 6 7 5 | 4 *5 6 7 8 9 10 | 13 | 8 *9 10 11 12 13 14 6 | 11*12 13 14 15 16 17 | 14 | 15*16 17 18 19 20 21 7 | 18*19 20 21 22 23 24 | 15 | 22*23 24(25)26 27 28 8 | 25*26 27 28 | | 29 x Week Topic 1 Calculator Form 2 Pseudocode 3 Plotting 1 (Excel) 4 Plotting 2 (Matplotlib and linear spaces) 5 Abstraction 1 (advanced functions and oo method) 6 Abstraction 2 (Booleans and logic) 7 2D transforms and iterated maps 8 Optimization 1 (Newton-Rhapson) 9 midterm project presentations 10 Optimization 2 (MD Energy) 11 ODE and SDE algorithms 12 Statistics 13 Complexity 14 Circe and Linux crash course 15 Compile & install process, ctypes </pre> == Overview == Mathematical models in the natural sciences take many shapes and forms. The moment they become more complicated than tracking a few variables over time, we have to put away our Excel spreadsheets and make use of a solid foundation in computational science. The course establishes this foundation by introducing data structures and algorithms used in everyday scientific computing using examples in the python scripting language. By the end of the Semester, students will be able to navigate the Linux command-line to go from a mathematical model to a numerical solution. Best practices for working with computer code and visualizing data will also be covered. == Topics == # Languages #* bash (shell) #* python (scripting) #* stack & register-based machine languages: overview of C and Fortran syntax & compiling with gcc, ‘thread safety’ #* Shared libraries & language inter-operability (FFI) # Algorithms #* Horner’s algorithm for polynomials #* Newton’s root finding algo. #* Overview of general optimization algo-s (example: linear & nonlin. least-squares) #* Numerical integration (scripted, plus gnu ODE) #* Communication (how HTTP get/put works) # Data Structures #* Linked Lists #* Trees (file system hierarchies) #* Graphs #* Arrays (dense & sparse) example: vectors & rotations / transpositions, densities and difference operators # Presentation & visualization #* Flat CSV files (and excel) #* Working with binary data #* Python matplotlib (2D images) #* Binning histograms & weighted averages # Best Practices #* High-level code design (modularity, interface specifications, unit testing, etc.) #* Code audit: open-source libraries, ex. Gnu Scientific Library, qsort in libc, Boost #* Source code versioning (example: git or mercurial) #* gdb & execution profiling #* documentation #* Makefiles == Grading == '''Grading Scale (out of 400 points possible)''' {| class="wikitable" |- ! Grade ! Undergraduate ! Graduate |- | A+ | 269 | 323 |- | A | 258 | 310 |- | A- | 250 | 300 |- | B+ | 241 | 290 |- | B | 230 | 276 |- | B- | 222 | 266 |- | C+ | 213 | 256 |- | C | 202 | 243 |- | C- | 194 | 233 |- | D+ | 186 | 223 |- | D | 175 | 210 |- | D- | 166 | 200 |} * (280 U / 330 G) Points Possible: ** 9 homework assignments (10 points per homework) ** 14 in-class assignments / quizzes (10 points per week) ** 2 projects / competitions (50 points per project) ** Undergraduates must complete 1 project, graduates must complete 2 * Important Rules ** For maximum benefit, homework should be done on-time. However, homework will be allowed to be re-submitted at any time for full credit, but must present a unique solution to previous work from yourself or others. ** All work must cite co-group members (if any) and the source of any code snippets used online. === Grading Rationale === Homework points will only be awarded for correct, working code and correct algorithmic analysis, while the homework problems will become progressively tougher. Undergraduates should be able to pass the course with an A if they have correctly answered most of the homework, appear at class prepared and on-time, and made a strong attempt at one of the projects. Graduate students should both perform well on the homework and successfully complete one or two projects. The re-grading for homework allows making up for missed assignments, and encourages returning to core concepts at a later point in the class. Students who have put in the studying effort, completed significant portions of the homework and projects both in- and out of class have thus demonstrated introductory programming proficiency. == Projects == * Midterm Project Description [[Media:Midterm2018.pdf]] (2 Mar., 2018) ** [[Agile|Agile Development Tips & Tricks]] * Final Project Description [[Media:Final2018.pdf]] (25 Apr., 2018) == Textbooks and Resources == * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-0072-7 Beginning Python, Hetland, 2005] (eBook avail. from USF Library) * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-3238-4 Python Algorithms, Hetland, 2010] (eBook avail. from USF Library) * [http://aosabook.org/en/index.html The Architecture of Open Source Applications] * [http://docs.python.org Python Documentation] * [https://developers.google.com/edu/python/ Google Introductory Python Notes] * [http://huffman.sourceforge.net/tao/tao-of-programming.html Tao of Programming] Other (possibly useful) materials: * [http://hackersdictionary.com/html/entry/larval-stage.html The Jargon File] * Chapters 7&8 of Modelling and Simulation, Birta and Arbez, Springer 2007 (eBook avail. from USF Library). * Chapters 4-6 of Models and Algorithms for Intelligent Data Analysis, Runkler, Springer 2012 (eBook avail. from USF Library). * Guide to Scientific Computing in C++, Francis and Whiteley, Springer, 2012. (eBook avail. from USF Library) * Extra info. On the basics: ** Chapters 3 and 7 of Mathematics in Computing, Regan, Springer 2013. (eBook avail. from USF Library) ** Instant feedback graphical programming with [https://www.khanacademy.org/cs/programming/ Khan Academy] * [http://www.meetup.com/python-178/ Local PyBulls Meetings] Code: * [http://carsonfarmer.com/2013/07/essential-python-geo-libraries Python Libraries Useful for Geospatial Problems] * [[Code#Python_Libraries|Python Libraries Useful for Computational Chemistry]] (very small list at present) Interactive Interpreters: * [http://www.codewars.com CodeWars] Recommended for building experience with practice problems. * [http://codecombat.com/ CodeCombat] A very visual way to interact with your python code. * [http://exercism.io Exercism] A command-line client with a similar learn-through-challenge philosophy. * [http://repl.it repl.it] A read-eval-print loop for several computer languages. * [http://en.cppreference.com/w/cpp/language CppReference] Documentation with an online evaluator for C++ code. === Notes === * [[Media:Intro.pdf|Introduction Notes]] <!-- * [[Media:Week2-2017.pdf|Week 2-3 Notes]] * Week 4: read through function syntax in [[Media:Week2.pdf|2016 Week 2]] and for-loops in [[Media:Week3.pdf|2016 Week 3-4]] * In-Class Examples ** [[Turing Exercise]] ** [https://predictivestatmech.org/code/example.dcd Example DCD File] * [[Media:Week-5.2017.pdf|Week 5 Notes]] * [[Media:PlottingMaps.pdf|Week 6 Notes]] ** [[Code:PyTesting]] * [[Media:NumpyArrays.pdf|Week 7 Notes]] ** [http://www.labri.fr/perso/nrougier/from-python-to-numpy/ all about numpy] * Misc. Notes for Week 8 ** [[Physics:Pairs|Rundown of Pair Interactions]] ** Parameterized surfaces [[Media:param1.jpg|1]] and [[Media:param2.jpg|2]] * Notes for Compilation Lab ** [https://learnpythonthehardway.org/book/appendixa.html Command Line Crash Course] Cheat sheet for bash commands. ** USF's compute cluster documentation at [https://wiki.rc.usf.edu/index.php/Main_Page RC Wiki]. *** See especially the "Connecting to SC" and "Modules" sections ** [[Code:Compiling|Cheat-codes]] for compilation lab. * [[Media:jobs.pdf|Research Computing Batch Queue]] * [[Media:Plug-in.pdf|Plugging Into Libraries]] * [[Media:Matrix.pdf|Matrix Algorithms]] --> === In-Class Problems === * Week 1: [[Media:CalculatorProbs.pdf|Calculator Problems]] ** Solutions: [http://predictivestatmech.org/terms/term.html] ** This solution uses python list comprehensions, and shows that the slowest step is actually unit conversion! * Week 2: [[Media:Pseudocode.pdf|Pseudocode Problems]] ** We will work these in class. For practice, be sure you have python list ideas down! ** Solutions: [https://docs.google.com/document/d/1HRkSdVNsTUydY4cVx67jRHRyhi5gL6nneEj9IX89wlE/edit?usp=sharing] * Week 3: [[Media:Plotting1.pdf|Plotting 1]] ** [https://stackoverflow.com/questions/11815538/how-to-import-matplotlib-in-python#11830055 Notes on installing Matplotlib on your own computer] ** Challenge: actions vs. functions -- what does the following code do: "[ print(1) for i in range(10) ]" (python3 only) * Week 4: [[Media:Plotting2.pdf|Plotting 2]] ** Solutions: [https://docs.google.com/document/d/1AanEFQmxLxoNM-662MHxsxToY3wsqovNx6SwcPQuBIg/edit?usp=sharing] * Week 5: Read pseudocode and plotting, focusing on types and syntax. Also, re-read the end of chapter summaries for Ch. 3, 5 and 6. * Week 6: Read the following pieces on first order logic [http://bayes.wustl.edu/etj/prob/book.pdf Chapter 1 of Jaynes' Book] [http://web.cecs.pdx.edu/~cs410aph/Lectures/Smalltalk%20II/Dijkstra%20on%20Hamming%27s%20Problem.pdf Hamming's Problem], and pages 71-80 in Chapter 4 of Hetland's Algorithms book (on induction). Just skip directly to chapter 4. ** Solutions [https://docs.google.com/document/d/14QZxh2SAWl3JE-SzVyemkAv4p9TBChO-jzZ5YpT8BZs/edit?usp=sharing] * Week 7: Review Hetland, Chapters 3-7. We'll do a series of parsing problems and flex our collective induction and recursion muscles. ** [https://docs.google.com/document/d/1i04oL7zJsD3KzvsPIaHBgwaOZ78UZvz5ReRDF-PlyF0/edit?usp=sharing Week 7 Problems] <source lang="python"> # Review Notes on Sequences, list comprehensions and arrays # Say you want to make a plot of the LJ function on the domain x \in [0.9, 3] # 1. You could use the following two list comprehensions to be specific: x = [ i*(3-0.9)/100.0 + 0.9 for i in range(101) ] y = [ 4*(xi**-12 - xi**-6) for xi in x] # 2. You could implement the LJ function as a python function and use MAP, def LJ(x): ix6 = x**-6 # the factoring makes this calculation more efficient return 4*ix6*(ix6 + 1.0) y = map(LJ, x) # 3. You could work on arrays, where addition, multiplication, and powers are elementwise: ax = arange(101)*(3-0.9)/100 + 0.9 ay = LJ(ax) # Mind the difference in type! type(x) type(ax) # 4. You could totally cheat, and use numpy's builtin functions. ax = linspace(0.9, 3.0, 101) # Exercise: replicate the steps above to test the finite difference computation # of the derivative against the analytical derivative of LJ. [ (y[i+1]-y[i])/(x[i+1]-x[i]) for i in ... import matplotlib.pyplot as plt plt.plot(x, y) plt.show() </source> === Homework === * Homework will be assigned through Repl.IT * Project presentations will be on Mon.-Wed., Mar 5-7 * Final Project presentations will be during exam time, Wed., May 2 2dd9151463b8ad9417f31ca9a83cd0e9a71b4f64 638 637 2018-02-23T18:45:19Z David M. Rogers 2 /* Notes */ wikitext text/x-wiki '''<BIG>Introduction to Scientific Computing</BIG>''' Course Info * Course Numbers CHM 4932-004/6938-010, CRN: 20438/20439 * Credit Hours: 3 * Meeting Dates: January 8 - April 25, 2018 ** No Class Jan. 15 or Mar. 12-18 * Meeting Times: Mon. and Wed., 12:30-13:45 in SCA 222 ** Midterm Project Presentations: Mon.-Wed., Mar 5 and 7. ** Final Project Presentations: Wed., May 2, 10:00am – 12:00pm (scheduled final date) ** Lab Session & Office Hours: Fri. 12:30-13:45 in IDR 214 (or SCA 222 by announcement) <pre> $ for((i=1;i<=4;i++)); do cal $i 2018; done ____ January 2018 ____ _____ March 2018 ____ | Su Mo Tu We Th Fr Sa | | Su Mo Tu We Th Fr Sa | 1 2 3 4 5 6 | | 1 (2) 3 1 | 7 8 9*10 11 12 13 | 9 | 4 (5) 6 (7) 8 9 10 2 | 14 x 16*17 18 19 20 | | x x 3 | 21*22 23 24 25 26 27 | 10 | 18*19 20 21 22 23 24 4 | 28*29 30 31 | 11 | 25*26 27 28 29 30 31 ___ February 2018 ____ _____ April 2018 ____ | Su Mo Tu We Th Fr Sa | | Su Mo Tu We Th Fr Sa | 1 2 3 | 12 | 1 *2 3 4 5 6 7 5 | 4 *5 6 7 8 9 10 | 13 | 8 *9 10 11 12 13 14 6 | 11*12 13 14 15 16 17 | 14 | 15*16 17 18 19 20 21 7 | 18*19 20 21 22 23 24 | 15 | 22*23 24(25)26 27 28 8 | 25*26 27 28 | | 29 x Week Topic 1 Calculator Form 2 Pseudocode 3 Plotting 1 (Excel) 4 Plotting 2 (Matplotlib and linear spaces) 5 Abstraction 1 (advanced functions and oo method) 6 Abstraction 2 (Booleans and logic) 7 2D transforms and iterated maps 8 Optimization 1 (Newton-Rhapson) 9 midterm project presentations 10 Optimization 2 (MD Energy) 11 ODE and SDE algorithms 12 Statistics 13 Complexity 14 Circe and Linux crash course 15 Compile & install process, ctypes </pre> == Overview == Mathematical models in the natural sciences take many shapes and forms. The moment they become more complicated than tracking a few variables over time, we have to put away our Excel spreadsheets and make use of a solid foundation in computational science. The course establishes this foundation by introducing data structures and algorithms used in everyday scientific computing using examples in the python scripting language. By the end of the Semester, students will be able to navigate the Linux command-line to go from a mathematical model to a numerical solution. Best practices for working with computer code and visualizing data will also be covered. == Topics == # Languages #* bash (shell) #* python (scripting) #* stack & register-based machine languages: overview of C and Fortran syntax & compiling with gcc, ‘thread safety’ #* Shared libraries & language inter-operability (FFI) # Algorithms #* Horner’s algorithm for polynomials #* Newton’s root finding algo. #* Overview of general optimization algo-s (example: linear & nonlin. least-squares) #* Numerical integration (scripted, plus gnu ODE) #* Communication (how HTTP get/put works) # Data Structures #* Linked Lists #* Trees (file system hierarchies) #* Graphs #* Arrays (dense & sparse) example: vectors & rotations / transpositions, densities and difference operators # Presentation & visualization #* Flat CSV files (and excel) #* Working with binary data #* Python matplotlib (2D images) #* Binning histograms & weighted averages # Best Practices #* High-level code design (modularity, interface specifications, unit testing, etc.) #* Code audit: open-source libraries, ex. Gnu Scientific Library, qsort in libc, Boost #* Source code versioning (example: git or mercurial) #* gdb & execution profiling #* documentation #* Makefiles == Grading == '''Grading Scale (out of 400 points possible)''' {| class="wikitable" |- ! Grade ! Undergraduate ! Graduate |- | A+ | 269 | 323 |- | A | 258 | 310 |- | A- | 250 | 300 |- | B+ | 241 | 290 |- | B | 230 | 276 |- | B- | 222 | 266 |- | C+ | 213 | 256 |- | C | 202 | 243 |- | C- | 194 | 233 |- | D+ | 186 | 223 |- | D | 175 | 210 |- | D- | 166 | 200 |} * (280 U / 330 G) Points Possible: ** 9 homework assignments (10 points per homework) ** 14 in-class assignments / quizzes (10 points per week) ** 2 projects / competitions (50 points per project) ** Undergraduates must complete 1 project, graduates must complete 2 * Important Rules ** For maximum benefit, homework should be done on-time. However, homework will be allowed to be re-submitted at any time for full credit, but must present a unique solution to previous work from yourself or others. ** All work must cite co-group members (if any) and the source of any code snippets used online. === Grading Rationale === Homework points will only be awarded for correct, working code and correct algorithmic analysis, while the homework problems will become progressively tougher. Undergraduates should be able to pass the course with an A if they have correctly answered most of the homework, appear at class prepared and on-time, and made a strong attempt at one of the projects. Graduate students should both perform well on the homework and successfully complete one or two projects. The re-grading for homework allows making up for missed assignments, and encourages returning to core concepts at a later point in the class. Students who have put in the studying effort, completed significant portions of the homework and projects both in- and out of class have thus demonstrated introductory programming proficiency. == Projects == * Midterm Project Description [[Media:Midterm2018.pdf]] (2 Mar., 2018) ** [[Agile|Agile Development Tips & Tricks]] * Final Project Description [[Media:Final2018.pdf]] (25 Apr., 2018) == Textbooks and Resources == * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-0072-7 Beginning Python, Hetland, 2005] (eBook avail. from USF Library) * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-3238-4 Python Algorithms, Hetland, 2010] (eBook avail. from USF Library) * [http://aosabook.org/en/index.html The Architecture of Open Source Applications] * [http://docs.python.org Python Documentation] * [https://developers.google.com/edu/python/ Google Introductory Python Notes] * [http://huffman.sourceforge.net/tao/tao-of-programming.html Tao of Programming] Other (possibly useful) materials: * [http://hackersdictionary.com/html/entry/larval-stage.html The Jargon File] * Chapters 7&8 of Modelling and Simulation, Birta and Arbez, Springer 2007 (eBook avail. from USF Library). * Chapters 4-6 of Models and Algorithms for Intelligent Data Analysis, Runkler, Springer 2012 (eBook avail. from USF Library). * Guide to Scientific Computing in C++, Francis and Whiteley, Springer, 2012. (eBook avail. from USF Library) * Extra info. On the basics: ** Chapters 3 and 7 of Mathematics in Computing, Regan, Springer 2013. (eBook avail. from USF Library) ** Instant feedback graphical programming with [https://www.khanacademy.org/cs/programming/ Khan Academy] * [http://www.meetup.com/python-178/ Local PyBulls Meetings] Code: * [http://carsonfarmer.com/2013/07/essential-python-geo-libraries Python Libraries Useful for Geospatial Problems] * [[Code#Python_Libraries|Python Libraries Useful for Computational Chemistry]] (very small list at present) Interactive Interpreters: * [http://www.codewars.com CodeWars] Recommended for building experience with practice problems. * [http://codecombat.com/ CodeCombat] A very visual way to interact with your python code. * [http://exercism.io Exercism] A command-line client with a similar learn-through-challenge philosophy. * [http://repl.it repl.it] A read-eval-print loop for several computer languages. * [http://en.cppreference.com/w/cpp/language CppReference] Documentation with an online evaluator for C++ code. === Notes === * [[Media:Intro.pdf|Introduction Notes]] * [[Media:Week2.pdf|Function Syntax]] and [[Media:Week3.pdf|For-Loop Syntax]] cheat-sheets. * [[Media:PlottingMaps.pdf|Plotting Maps]] <!-- ** [[Turing Exercise]] ** [https://predictivestatmech.org/code/example.dcd Example DCD File] * [[Media:Week-5.2017.pdf|Week 5 Notes]] * [[Media:PlottingMaps.pdf|Week 6 Notes]] ** [[Code:PyTesting]] * [[Media:NumpyArrays.pdf|Week 7 Notes]] ** [http://www.labri.fr/perso/nrougier/from-python-to-numpy/ all about numpy] * Misc. Notes for Week 8 ** [[Physics:Pairs|Rundown of Pair Interactions]] ** Parameterized surfaces [[Media:param1.jpg|1]] and [[Media:param2.jpg|2]] * Notes for Compilation Lab ** [https://learnpythonthehardway.org/book/appendixa.html Command Line Crash Course] Cheat sheet for bash commands. ** USF's compute cluster documentation at [https://wiki.rc.usf.edu/index.php/Main_Page RC Wiki]. *** See especially the "Connecting to SC" and "Modules" sections ** [[Code:Compiling|Cheat-codes]] for compilation lab. * [[Media:jobs.pdf|Research Computing Batch Queue]] * [[Media:Plug-in.pdf|Plugging Into Libraries]] * [[Media:Matrix.pdf|Matrix Algorithms]] --> === In-Class Problems === * Week 1: [[Media:CalculatorProbs.pdf|Calculator Problems]] ** Solutions: [http://predictivestatmech.org/terms/term.html] ** This solution uses python list comprehensions, and shows that the slowest step is actually unit conversion! * Week 2: [[Media:Pseudocode.pdf|Pseudocode Problems]] ** We will work these in class. For practice, be sure you have python list ideas down! ** Solutions: [https://docs.google.com/document/d/1HRkSdVNsTUydY4cVx67jRHRyhi5gL6nneEj9IX89wlE/edit?usp=sharing] * Week 3: [[Media:Plotting1.pdf|Plotting 1]] ** [https://stackoverflow.com/questions/11815538/how-to-import-matplotlib-in-python#11830055 Notes on installing Matplotlib on your own computer] ** Challenge: actions vs. functions -- what does the following code do: "[ print(1) for i in range(10) ]" (python3 only) * Week 4: [[Media:Plotting2.pdf|Plotting 2]] ** Solutions: [https://docs.google.com/document/d/1AanEFQmxLxoNM-662MHxsxToY3wsqovNx6SwcPQuBIg/edit?usp=sharing] * Week 5: Read pseudocode and plotting, focusing on types and syntax. Also, re-read the end of chapter summaries for Ch. 3, 5 and 6. * Week 6: Read the following pieces on first order logic [http://bayes.wustl.edu/etj/prob/book.pdf Chapter 1 of Jaynes' Book] [http://web.cecs.pdx.edu/~cs410aph/Lectures/Smalltalk%20II/Dijkstra%20on%20Hamming%27s%20Problem.pdf Hamming's Problem], and pages 71-80 in Chapter 4 of Hetland's Algorithms book (on induction). Just skip directly to chapter 4. ** Solutions [https://docs.google.com/document/d/14QZxh2SAWl3JE-SzVyemkAv4p9TBChO-jzZ5YpT8BZs/edit?usp=sharing] * Week 7: Review Hetland, Chapters 3-7. We'll do a series of parsing problems and flex our collective induction and recursion muscles. ** [https://docs.google.com/document/d/1i04oL7zJsD3KzvsPIaHBgwaOZ78UZvz5ReRDF-PlyF0/edit?usp=sharing Week 7 Problems] <source lang="python"> # Review Notes on Sequences, list comprehensions and arrays # Say you want to make a plot of the LJ function on the domain x \in [0.9, 3] # 1. You could use the following two list comprehensions to be specific: x = [ i*(3-0.9)/100.0 + 0.9 for i in range(101) ] y = [ 4*(xi**-12 - xi**-6) for xi in x] # 2. You could implement the LJ function as a python function and use MAP, def LJ(x): ix6 = x**-6 # the factoring makes this calculation more efficient return 4*ix6*(ix6 + 1.0) y = map(LJ, x) # 3. You could work on arrays, where addition, multiplication, and powers are elementwise: ax = arange(101)*(3-0.9)/100 + 0.9 ay = LJ(ax) # Mind the difference in type! type(x) type(ax) # 4. You could totally cheat, and use numpy's builtin functions. ax = linspace(0.9, 3.0, 101) # Exercise: replicate the steps above to test the finite difference computation # of the derivative against the analytical derivative of LJ. [ (y[i+1]-y[i])/(x[i+1]-x[i]) for i in ... import matplotlib.pyplot as plt plt.plot(x, y) plt.show() </source> === Homework === * Homework will be assigned through Repl.IT * Project presentations will be on Mon.-Wed., Mar 5-7 * Final Project presentations will be during exam time, Wed., May 2 d01e4926a9003192bb0518b854a1c8ff59bd32f2 639 638 2018-02-25T16:57:29Z David M. Rogers 2 /* In-Class Problems */ wikitext text/x-wiki '''<BIG>Introduction to Scientific Computing</BIG>''' Course Info * Course Numbers CHM 4932-004/6938-010, CRN: 20438/20439 * Credit Hours: 3 * Meeting Dates: January 8 - April 25, 2018 ** No Class Jan. 15 or Mar. 12-18 * Meeting Times: Mon. and Wed., 12:30-13:45 in SCA 222 ** Midterm Project Presentations: Mon.-Wed., Mar 5 and 7. ** Final Project Presentations: Wed., May 2, 10:00am – 12:00pm (scheduled final date) ** Lab Session & Office Hours: Fri. 12:30-13:45 in IDR 214 (or SCA 222 by announcement) <pre> $ for((i=1;i<=4;i++)); do cal $i 2018; done ____ January 2018 ____ _____ March 2018 ____ | Su Mo Tu We Th Fr Sa | | Su Mo Tu We Th Fr Sa | 1 2 3 4 5 6 | | 1 (2) 3 1 | 7 8 9*10 11 12 13 | 9 | 4 (5) 6 (7) 8 9 10 2 | 14 x 16*17 18 19 20 | | x x 3 | 21*22 23 24 25 26 27 | 10 | 18*19 20 21 22 23 24 4 | 28*29 30 31 | 11 | 25*26 27 28 29 30 31 ___ February 2018 ____ _____ April 2018 ____ | Su Mo Tu We Th Fr Sa | | Su Mo Tu We Th Fr Sa | 1 2 3 | 12 | 1 *2 3 4 5 6 7 5 | 4 *5 6 7 8 9 10 | 13 | 8 *9 10 11 12 13 14 6 | 11*12 13 14 15 16 17 | 14 | 15*16 17 18 19 20 21 7 | 18*19 20 21 22 23 24 | 15 | 22*23 24(25)26 27 28 8 | 25*26 27 28 | | 29 x Week Topic 1 Calculator Form 2 Pseudocode 3 Plotting 1 (Excel) 4 Plotting 2 (Matplotlib and linear spaces) 5 Abstraction 1 (advanced functions and oo method) 6 Abstraction 2 (Booleans and logic) 7 2D transforms and iterated maps 8 Optimization 1 (Newton-Rhapson) 9 midterm project presentations 10 Optimization 2 (MD Energy) 11 ODE and SDE algorithms 12 Statistics 13 Complexity 14 Circe and Linux crash course 15 Compile & install process, ctypes </pre> == Overview == Mathematical models in the natural sciences take many shapes and forms. The moment they become more complicated than tracking a few variables over time, we have to put away our Excel spreadsheets and make use of a solid foundation in computational science. The course establishes this foundation by introducing data structures and algorithms used in everyday scientific computing using examples in the python scripting language. By the end of the Semester, students will be able to navigate the Linux command-line to go from a mathematical model to a numerical solution. Best practices for working with computer code and visualizing data will also be covered. == Topics == # Languages #* bash (shell) #* python (scripting) #* stack & register-based machine languages: overview of C and Fortran syntax & compiling with gcc, ‘thread safety’ #* Shared libraries & language inter-operability (FFI) # Algorithms #* Horner’s algorithm for polynomials #* Newton’s root finding algo. #* Overview of general optimization algo-s (example: linear & nonlin. least-squares) #* Numerical integration (scripted, plus gnu ODE) #* Communication (how HTTP get/put works) # Data Structures #* Linked Lists #* Trees (file system hierarchies) #* Graphs #* Arrays (dense & sparse) example: vectors & rotations / transpositions, densities and difference operators # Presentation & visualization #* Flat CSV files (and excel) #* Working with binary data #* Python matplotlib (2D images) #* Binning histograms & weighted averages # Best Practices #* High-level code design (modularity, interface specifications, unit testing, etc.) #* Code audit: open-source libraries, ex. Gnu Scientific Library, qsort in libc, Boost #* Source code versioning (example: git or mercurial) #* gdb & execution profiling #* documentation #* Makefiles == Grading == '''Grading Scale (out of 400 points possible)''' {| class="wikitable" |- ! Grade ! Undergraduate ! Graduate |- | A+ | 269 | 323 |- | A | 258 | 310 |- | A- | 250 | 300 |- | B+ | 241 | 290 |- | B | 230 | 276 |- | B- | 222 | 266 |- | C+ | 213 | 256 |- | C | 202 | 243 |- | C- | 194 | 233 |- | D+ | 186 | 223 |- | D | 175 | 210 |- | D- | 166 | 200 |} * (280 U / 330 G) Points Possible: ** 9 homework assignments (10 points per homework) ** 14 in-class assignments / quizzes (10 points per week) ** 2 projects / competitions (50 points per project) ** Undergraduates must complete 1 project, graduates must complete 2 * Important Rules ** For maximum benefit, homework should be done on-time. However, homework will be allowed to be re-submitted at any time for full credit, but must present a unique solution to previous work from yourself or others. ** All work must cite co-group members (if any) and the source of any code snippets used online. === Grading Rationale === Homework points will only be awarded for correct, working code and correct algorithmic analysis, while the homework problems will become progressively tougher. Undergraduates should be able to pass the course with an A if they have correctly answered most of the homework, appear at class prepared and on-time, and made a strong attempt at one of the projects. Graduate students should both perform well on the homework and successfully complete one or two projects. The re-grading for homework allows making up for missed assignments, and encourages returning to core concepts at a later point in the class. Students who have put in the studying effort, completed significant portions of the homework and projects both in- and out of class have thus demonstrated introductory programming proficiency. == Projects == * Midterm Project Description [[Media:Midterm2018.pdf]] (2 Mar., 2018) ** [[Agile|Agile Development Tips & Tricks]] * Final Project Description [[Media:Final2018.pdf]] (25 Apr., 2018) == Textbooks and Resources == * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-0072-7 Beginning Python, Hetland, 2005] (eBook avail. from USF Library) * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-3238-4 Python Algorithms, Hetland, 2010] (eBook avail. from USF Library) * [http://aosabook.org/en/index.html The Architecture of Open Source Applications] * [http://docs.python.org Python Documentation] * [https://developers.google.com/edu/python/ Google Introductory Python Notes] * [http://huffman.sourceforge.net/tao/tao-of-programming.html Tao of Programming] Other (possibly useful) materials: * [http://hackersdictionary.com/html/entry/larval-stage.html The Jargon File] * Chapters 7&8 of Modelling and Simulation, Birta and Arbez, Springer 2007 (eBook avail. from USF Library). * Chapters 4-6 of Models and Algorithms for Intelligent Data Analysis, Runkler, Springer 2012 (eBook avail. from USF Library). * Guide to Scientific Computing in C++, Francis and Whiteley, Springer, 2012. (eBook avail. from USF Library) * Extra info. On the basics: ** Chapters 3 and 7 of Mathematics in Computing, Regan, Springer 2013. (eBook avail. from USF Library) ** Instant feedback graphical programming with [https://www.khanacademy.org/cs/programming/ Khan Academy] * [http://www.meetup.com/python-178/ Local PyBulls Meetings] Code: * [http://carsonfarmer.com/2013/07/essential-python-geo-libraries Python Libraries Useful for Geospatial Problems] * [[Code#Python_Libraries|Python Libraries Useful for Computational Chemistry]] (very small list at present) Interactive Interpreters: * [http://www.codewars.com CodeWars] Recommended for building experience with practice problems. * [http://codecombat.com/ CodeCombat] A very visual way to interact with your python code. * [http://exercism.io Exercism] A command-line client with a similar learn-through-challenge philosophy. * [http://repl.it repl.it] A read-eval-print loop for several computer languages. * [http://en.cppreference.com/w/cpp/language CppReference] Documentation with an online evaluator for C++ code. === Notes === * [[Media:Intro.pdf|Introduction Notes]] * [[Media:Week2.pdf|Function Syntax]] and [[Media:Week3.pdf|For-Loop Syntax]] cheat-sheets. * [[Media:PlottingMaps.pdf|Plotting Maps]] <!-- ** [[Turing Exercise]] ** [https://predictivestatmech.org/code/example.dcd Example DCD File] * [[Media:Week-5.2017.pdf|Week 5 Notes]] * [[Media:PlottingMaps.pdf|Week 6 Notes]] ** [[Code:PyTesting]] * [[Media:NumpyArrays.pdf|Week 7 Notes]] ** [http://www.labri.fr/perso/nrougier/from-python-to-numpy/ all about numpy] * Misc. Notes for Week 8 ** [[Physics:Pairs|Rundown of Pair Interactions]] ** Parameterized surfaces [[Media:param1.jpg|1]] and [[Media:param2.jpg|2]] * Notes for Compilation Lab ** [https://learnpythonthehardway.org/book/appendixa.html Command Line Crash Course] Cheat sheet for bash commands. ** USF's compute cluster documentation at [https://wiki.rc.usf.edu/index.php/Main_Page RC Wiki]. *** See especially the "Connecting to SC" and "Modules" sections ** [[Code:Compiling|Cheat-codes]] for compilation lab. * [[Media:jobs.pdf|Research Computing Batch Queue]] * [[Media:Plug-in.pdf|Plugging Into Libraries]] * [[Media:Matrix.pdf|Matrix Algorithms]] --> === In-Class Problems === * Week 1: [[Media:CalculatorProbs.pdf|Calculator Problems]] ** Solutions: [http://predictivestatmech.org/terms/term.html] ** This solution uses python list comprehensions, and shows that the slowest step is actually unit conversion! * Week 2: [[Media:Pseudocode.pdf|Pseudocode Problems]] ** We will work these in class. For practice, be sure you have python list ideas down! ** Solutions: [https://docs.google.com/document/d/1HRkSdVNsTUydY4cVx67jRHRyhi5gL6nneEj9IX89wlE/edit?usp=sharing] * Week 3: [[Media:Plotting1.pdf|Plotting 1]] ** [https://stackoverflow.com/questions/11815538/how-to-import-matplotlib-in-python#11830055 Notes on installing Matplotlib on your own computer] ** Challenge: actions vs. functions -- what does the following code do: "[ print(1) for i in range(10) ]" (python3 only) * Week 4: [[Media:Plotting2.pdf|Plotting 2]] ** Solutions: [https://docs.google.com/document/d/1AanEFQmxLxoNM-662MHxsxToY3wsqovNx6SwcPQuBIg/edit?usp=sharing] * Week 5: Read pseudocode and plotting, focusing on types and syntax. Also, re-read the end of chapter summaries for Ch. 3, 5 and 6. * Week 6: Read the following pieces on first order logic [http://bayes.wustl.edu/etj/prob/book.pdf Chapter 1 of Jaynes' Book] [http://web.cecs.pdx.edu/~cs410aph/Lectures/Smalltalk%20II/Dijkstra%20on%20Hamming%27s%20Problem.pdf Hamming's Problem], and pages 71-80 in Chapter 4 of Hetland's Algorithms book (on induction). Just skip directly to chapter 4. ** Solutions [https://docs.google.com/document/d/14QZxh2SAWl3JE-SzVyemkAv4p9TBChO-jzZ5YpT8BZs/edit?usp=sharing] * Week 7: Review Hetland, Chapters 3-7. We'll do a series of parsing problems and flex our collective induction and recursion muscles. ** [https://docs.google.com/document/d/1i04oL7zJsD3KzvsPIaHBgwaOZ78UZvz5ReRDF-PlyF0/edit?usp=sharing Week 7 Problems] * Week 8: [[Media:Minimization1.pdf|Minimization Problems!]] <source lang="python"> # Review Notes on Sequences, list comprehensions and arrays # Say you want to make a plot of the LJ function on the domain x \in [0.9, 3] # 1. You could use the following two list comprehensions to be specific: x = [ i*(3-0.9)/100.0 + 0.9 for i in range(101) ] y = [ 4*(xi**-12 - xi**-6) for xi in x] # 2. You could implement the LJ function as a python function and use MAP, def LJ(x): ix6 = x**-6 # the factoring makes this calculation more efficient return 4*ix6*(ix6 + 1.0) y = map(LJ, x) # 3. You could work on arrays, where addition, multiplication, and powers are elementwise: ax = arange(101)*(3-0.9)/100 + 0.9 ay = LJ(ax) # Mind the difference in type! type(x) type(ax) # 4. You could totally cheat, and use numpy's builtin functions. ax = linspace(0.9, 3.0, 101) # Exercise: replicate the steps above to test the finite difference computation # of the derivative against the analytical derivative of LJ. [ (y[i+1]-y[i])/(x[i+1]-x[i]) for i in ... import matplotlib.pyplot as plt plt.plot(x, y) plt.show() </source> === Homework === * Homework will be assigned through Repl.IT * Project presentations will be on Mon.-Wed., Mar 5-7 * Final Project presentations will be during exam time, Wed., May 2 93776e3143fd591fca1d989e41cc31ebf6241271 643 639 2018-03-01T05:13:19Z David M. Rogers 2 /* Projects */ wikitext text/x-wiki '''<BIG>Introduction to Scientific Computing</BIG>''' Course Info * Course Numbers CHM 4932-004/6938-010, CRN: 20438/20439 * Credit Hours: 3 * Meeting Dates: January 8 - April 25, 2018 ** No Class Jan. 15 or Mar. 12-18 * Meeting Times: Mon. and Wed., 12:30-13:45 in SCA 222 ** Midterm Project Presentations: Mon.-Wed., Mar 5 and 7. ** Final Project Presentations: Wed., May 2, 10:00am – 12:00pm (scheduled final date) ** Lab Session & Office Hours: Fri. 12:30-13:45 in IDR 214 (or SCA 222 by announcement) <pre> $ for((i=1;i<=4;i++)); do cal $i 2018; done ____ January 2018 ____ _____ March 2018 ____ | Su Mo Tu We Th Fr Sa | | Su Mo Tu We Th Fr Sa | 1 2 3 4 5 6 | | 1 (2) 3 1 | 7 8 9*10 11 12 13 | 9 | 4 (5) 6 (7) 8 9 10 2 | 14 x 16*17 18 19 20 | | x x 3 | 21*22 23 24 25 26 27 | 10 | 18*19 20 21 22 23 24 4 | 28*29 30 31 | 11 | 25*26 27 28 29 30 31 ___ February 2018 ____ _____ April 2018 ____ | Su Mo Tu We Th Fr Sa | | Su Mo Tu We Th Fr Sa | 1 2 3 | 12 | 1 *2 3 4 5 6 7 5 | 4 *5 6 7 8 9 10 | 13 | 8 *9 10 11 12 13 14 6 | 11*12 13 14 15 16 17 | 14 | 15*16 17 18 19 20 21 7 | 18*19 20 21 22 23 24 | 15 | 22*23 24(25)26 27 28 8 | 25*26 27 28 | | 29 x Week Topic 1 Calculator Form 2 Pseudocode 3 Plotting 1 (Excel) 4 Plotting 2 (Matplotlib and linear spaces) 5 Abstraction 1 (advanced functions and oo method) 6 Abstraction 2 (Booleans and logic) 7 2D transforms and iterated maps 8 Optimization 1 (Newton-Rhapson) 9 midterm project presentations 10 Optimization 2 (MD Energy) 11 ODE and SDE algorithms 12 Statistics 13 Complexity 14 Circe and Linux crash course 15 Compile & install process, ctypes </pre> == Overview == Mathematical models in the natural sciences take many shapes and forms. The moment they become more complicated than tracking a few variables over time, we have to put away our Excel spreadsheets and make use of a solid foundation in computational science. The course establishes this foundation by introducing data structures and algorithms used in everyday scientific computing using examples in the python scripting language. By the end of the Semester, students will be able to navigate the Linux command-line to go from a mathematical model to a numerical solution. Best practices for working with computer code and visualizing data will also be covered. == Topics == # Languages #* bash (shell) #* python (scripting) #* stack & register-based machine languages: overview of C and Fortran syntax & compiling with gcc, ‘thread safety’ #* Shared libraries & language inter-operability (FFI) # Algorithms #* Horner’s algorithm for polynomials #* Newton’s root finding algo. #* Overview of general optimization algo-s (example: linear & nonlin. least-squares) #* Numerical integration (scripted, plus gnu ODE) #* Communication (how HTTP get/put works) # Data Structures #* Linked Lists #* Trees (file system hierarchies) #* Graphs #* Arrays (dense & sparse) example: vectors & rotations / transpositions, densities and difference operators # Presentation & visualization #* Flat CSV files (and excel) #* Working with binary data #* Python matplotlib (2D images) #* Binning histograms & weighted averages # Best Practices #* High-level code design (modularity, interface specifications, unit testing, etc.) #* Code audit: open-source libraries, ex. Gnu Scientific Library, qsort in libc, Boost #* Source code versioning (example: git or mercurial) #* gdb & execution profiling #* documentation #* Makefiles == Grading == '''Grading Scale (out of 400 points possible)''' {| class="wikitable" |- ! Grade ! Undergraduate ! Graduate |- | A+ | 269 | 323 |- | A | 258 | 310 |- | A- | 250 | 300 |- | B+ | 241 | 290 |- | B | 230 | 276 |- | B- | 222 | 266 |- | C+ | 213 | 256 |- | C | 202 | 243 |- | C- | 194 | 233 |- | D+ | 186 | 223 |- | D | 175 | 210 |- | D- | 166 | 200 |} * (280 U / 330 G) Points Possible: ** 9 homework assignments (10 points per homework) ** 14 in-class assignments / quizzes (10 points per week) ** 2 projects / competitions (50 points per project) ** Undergraduates must complete 1 project, graduates must complete 2 * Important Rules ** For maximum benefit, homework should be done on-time. However, homework will be allowed to be re-submitted at any time for full credit, but must present a unique solution to previous work from yourself or others. ** All work must cite co-group members (if any) and the source of any code snippets used online. === Grading Rationale === Homework points will only be awarded for correct, working code and correct algorithmic analysis, while the homework problems will become progressively tougher. Undergraduates should be able to pass the course with an A if they have correctly answered most of the homework, appear at class prepared and on-time, and made a strong attempt at one of the projects. Graduate students should both perform well on the homework and successfully complete one or two projects. The re-grading for homework allows making up for missed assignments, and encourages returning to core concepts at a later point in the class. Students who have put in the studying effort, completed significant portions of the homework and projects both in- and out of class have thus demonstrated introductory programming proficiency. == Projects == * Midterm Project Description [[Media:Midterm2018.pdf]] (2 Mar., 2018) ** [[Agile|Agile Development Tips & Tricks]] <!--* Final Project Description [[Media:Final2018.pdf]] (25 Apr., 2018)--> == Textbooks and Resources == * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-0072-7 Beginning Python, Hetland, 2005] (eBook avail. from USF Library) * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-3238-4 Python Algorithms, Hetland, 2010] (eBook avail. from USF Library) * [http://aosabook.org/en/index.html The Architecture of Open Source Applications] * [http://docs.python.org Python Documentation] * [https://developers.google.com/edu/python/ Google Introductory Python Notes] * [http://huffman.sourceforge.net/tao/tao-of-programming.html Tao of Programming] Other (possibly useful) materials: * [http://hackersdictionary.com/html/entry/larval-stage.html The Jargon File] * Chapters 7&8 of Modelling and Simulation, Birta and Arbez, Springer 2007 (eBook avail. from USF Library). * Chapters 4-6 of Models and Algorithms for Intelligent Data Analysis, Runkler, Springer 2012 (eBook avail. from USF Library). * Guide to Scientific Computing in C++, Francis and Whiteley, Springer, 2012. (eBook avail. from USF Library) * Extra info. On the basics: ** Chapters 3 and 7 of Mathematics in Computing, Regan, Springer 2013. (eBook avail. from USF Library) ** Instant feedback graphical programming with [https://www.khanacademy.org/cs/programming/ Khan Academy] * [http://www.meetup.com/python-178/ Local PyBulls Meetings] Code: * [http://carsonfarmer.com/2013/07/essential-python-geo-libraries Python Libraries Useful for Geospatial Problems] * [[Code#Python_Libraries|Python Libraries Useful for Computational Chemistry]] (very small list at present) Interactive Interpreters: * [http://www.codewars.com CodeWars] Recommended for building experience with practice problems. * [http://codecombat.com/ CodeCombat] A very visual way to interact with your python code. * [http://exercism.io Exercism] A command-line client with a similar learn-through-challenge philosophy. * [http://repl.it repl.it] A read-eval-print loop for several computer languages. * [http://en.cppreference.com/w/cpp/language CppReference] Documentation with an online evaluator for C++ code. === Notes === * [[Media:Intro.pdf|Introduction Notes]] * [[Media:Week2.pdf|Function Syntax]] and [[Media:Week3.pdf|For-Loop Syntax]] cheat-sheets. * [[Media:PlottingMaps.pdf|Plotting Maps]] <!-- ** [[Turing Exercise]] ** [https://predictivestatmech.org/code/example.dcd Example DCD File] * [[Media:Week-5.2017.pdf|Week 5 Notes]] * [[Media:PlottingMaps.pdf|Week 6 Notes]] ** [[Code:PyTesting]] * [[Media:NumpyArrays.pdf|Week 7 Notes]] ** [http://www.labri.fr/perso/nrougier/from-python-to-numpy/ all about numpy] * Misc. Notes for Week 8 ** [[Physics:Pairs|Rundown of Pair Interactions]] ** Parameterized surfaces [[Media:param1.jpg|1]] and [[Media:param2.jpg|2]] * Notes for Compilation Lab ** [https://learnpythonthehardway.org/book/appendixa.html Command Line Crash Course] Cheat sheet for bash commands. ** USF's compute cluster documentation at [https://wiki.rc.usf.edu/index.php/Main_Page RC Wiki]. *** See especially the "Connecting to SC" and "Modules" sections ** [[Code:Compiling|Cheat-codes]] for compilation lab. * [[Media:jobs.pdf|Research Computing Batch Queue]] * [[Media:Plug-in.pdf|Plugging Into Libraries]] * [[Media:Matrix.pdf|Matrix Algorithms]] --> === In-Class Problems === * Week 1: [[Media:CalculatorProbs.pdf|Calculator Problems]] ** Solutions: [http://predictivestatmech.org/terms/term.html] ** This solution uses python list comprehensions, and shows that the slowest step is actually unit conversion! * Week 2: [[Media:Pseudocode.pdf|Pseudocode Problems]] ** We will work these in class. For practice, be sure you have python list ideas down! ** Solutions: [https://docs.google.com/document/d/1HRkSdVNsTUydY4cVx67jRHRyhi5gL6nneEj9IX89wlE/edit?usp=sharing] * Week 3: [[Media:Plotting1.pdf|Plotting 1]] ** [https://stackoverflow.com/questions/11815538/how-to-import-matplotlib-in-python#11830055 Notes on installing Matplotlib on your own computer] ** Challenge: actions vs. functions -- what does the following code do: "[ print(1) for i in range(10) ]" (python3 only) * Week 4: [[Media:Plotting2.pdf|Plotting 2]] ** Solutions: [https://docs.google.com/document/d/1AanEFQmxLxoNM-662MHxsxToY3wsqovNx6SwcPQuBIg/edit?usp=sharing] * Week 5: Read pseudocode and plotting, focusing on types and syntax. Also, re-read the end of chapter summaries for Ch. 3, 5 and 6. * Week 6: Read the following pieces on first order logic [http://bayes.wustl.edu/etj/prob/book.pdf Chapter 1 of Jaynes' Book] [http://web.cecs.pdx.edu/~cs410aph/Lectures/Smalltalk%20II/Dijkstra%20on%20Hamming%27s%20Problem.pdf Hamming's Problem], and pages 71-80 in Chapter 4 of Hetland's Algorithms book (on induction). Just skip directly to chapter 4. ** Solutions [https://docs.google.com/document/d/14QZxh2SAWl3JE-SzVyemkAv4p9TBChO-jzZ5YpT8BZs/edit?usp=sharing] * Week 7: Review Hetland, Chapters 3-7. We'll do a series of parsing problems and flex our collective induction and recursion muscles. ** [https://docs.google.com/document/d/1i04oL7zJsD3KzvsPIaHBgwaOZ78UZvz5ReRDF-PlyF0/edit?usp=sharing Week 7 Problems] * Week 8: [[Media:Minimization1.pdf|Minimization Problems!]] <source lang="python"> # Review Notes on Sequences, list comprehensions and arrays # Say you want to make a plot of the LJ function on the domain x \in [0.9, 3] # 1. You could use the following two list comprehensions to be specific: x = [ i*(3-0.9)/100.0 + 0.9 for i in range(101) ] y = [ 4*(xi**-12 - xi**-6) for xi in x] # 2. You could implement the LJ function as a python function and use MAP, def LJ(x): ix6 = x**-6 # the factoring makes this calculation more efficient return 4*ix6*(ix6 + 1.0) y = map(LJ, x) # 3. You could work on arrays, where addition, multiplication, and powers are elementwise: ax = arange(101)*(3-0.9)/100 + 0.9 ay = LJ(ax) # Mind the difference in type! type(x) type(ax) # 4. You could totally cheat, and use numpy's builtin functions. ax = linspace(0.9, 3.0, 101) # Exercise: replicate the steps above to test the finite difference computation # of the derivative against the analytical derivative of LJ. [ (y[i+1]-y[i])/(x[i+1]-x[i]) for i in ... import matplotlib.pyplot as plt plt.plot(x, y) plt.show() </source> === Homework === * Homework will be assigned through Repl.IT * Project presentations will be on Mon.-Wed., Mar 5-7 * Final Project presentations will be during exam time, Wed., May 2 8372052717272617dc7b713e9c41d26c64d1406c 644 643 2018-03-05T17:18:13Z David M. Rogers 2 /* Notes */ wikitext text/x-wiki '''<BIG>Introduction to Scientific Computing</BIG>''' Course Info * Course Numbers CHM 4932-004/6938-010, CRN: 20438/20439 * Credit Hours: 3 * Meeting Dates: January 8 - April 25, 2018 ** No Class Jan. 15 or Mar. 12-18 * Meeting Times: Mon. and Wed., 12:30-13:45 in SCA 222 ** Midterm Project Presentations: Mon.-Wed., Mar 5 and 7. ** Final Project Presentations: Wed., May 2, 10:00am – 12:00pm (scheduled final date) ** Lab Session & Office Hours: Fri. 12:30-13:45 in IDR 214 (or SCA 222 by announcement) <pre> $ for((i=1;i<=4;i++)); do cal $i 2018; done ____ January 2018 ____ _____ March 2018 ____ | Su Mo Tu We Th Fr Sa | | Su Mo Tu We Th Fr Sa | 1 2 3 4 5 6 | | 1 (2) 3 1 | 7 8 9*10 11 12 13 | 9 | 4 (5) 6 (7) 8 9 10 2 | 14 x 16*17 18 19 20 | | x x 3 | 21*22 23 24 25 26 27 | 10 | 18*19 20 21 22 23 24 4 | 28*29 30 31 | 11 | 25*26 27 28 29 30 31 ___ February 2018 ____ _____ April 2018 ____ | Su Mo Tu We Th Fr Sa | | Su Mo Tu We Th Fr Sa | 1 2 3 | 12 | 1 *2 3 4 5 6 7 5 | 4 *5 6 7 8 9 10 | 13 | 8 *9 10 11 12 13 14 6 | 11*12 13 14 15 16 17 | 14 | 15*16 17 18 19 20 21 7 | 18*19 20 21 22 23 24 | 15 | 22*23 24(25)26 27 28 8 | 25*26 27 28 | | 29 x Week Topic 1 Calculator Form 2 Pseudocode 3 Plotting 1 (Excel) 4 Plotting 2 (Matplotlib and linear spaces) 5 Abstraction 1 (advanced functions and oo method) 6 Abstraction 2 (Booleans and logic) 7 2D transforms and iterated maps 8 Optimization 1 (Newton-Rhapson) 9 midterm project presentations 10 Optimization 2 (MD Energy) 11 ODE and SDE algorithms 12 Statistics 13 Complexity 14 Circe and Linux crash course 15 Compile & install process, ctypes </pre> == Overview == Mathematical models in the natural sciences take many shapes and forms. The moment they become more complicated than tracking a few variables over time, we have to put away our Excel spreadsheets and make use of a solid foundation in computational science. The course establishes this foundation by introducing data structures and algorithms used in everyday scientific computing using examples in the python scripting language. By the end of the Semester, students will be able to navigate the Linux command-line to go from a mathematical model to a numerical solution. Best practices for working with computer code and visualizing data will also be covered. == Topics == # Languages #* bash (shell) #* python (scripting) #* stack & register-based machine languages: overview of C and Fortran syntax & compiling with gcc, ‘thread safety’ #* Shared libraries & language inter-operability (FFI) # Algorithms #* Horner’s algorithm for polynomials #* Newton’s root finding algo. #* Overview of general optimization algo-s (example: linear & nonlin. least-squares) #* Numerical integration (scripted, plus gnu ODE) #* Communication (how HTTP get/put works) # Data Structures #* Linked Lists #* Trees (file system hierarchies) #* Graphs #* Arrays (dense & sparse) example: vectors & rotations / transpositions, densities and difference operators # Presentation & visualization #* Flat CSV files (and excel) #* Working with binary data #* Python matplotlib (2D images) #* Binning histograms & weighted averages # Best Practices #* High-level code design (modularity, interface specifications, unit testing, etc.) #* Code audit: open-source libraries, ex. Gnu Scientific Library, qsort in libc, Boost #* Source code versioning (example: git or mercurial) #* gdb & execution profiling #* documentation #* Makefiles == Grading == '''Grading Scale (out of 400 points possible)''' {| class="wikitable" |- ! Grade ! Undergraduate ! Graduate |- | A+ | 269 | 323 |- | A | 258 | 310 |- | A- | 250 | 300 |- | B+ | 241 | 290 |- | B | 230 | 276 |- | B- | 222 | 266 |- | C+ | 213 | 256 |- | C | 202 | 243 |- | C- | 194 | 233 |- | D+ | 186 | 223 |- | D | 175 | 210 |- | D- | 166 | 200 |} * (280 U / 330 G) Points Possible: ** 9 homework assignments (10 points per homework) ** 14 in-class assignments / quizzes (10 points per week) ** 2 projects / competitions (50 points per project) ** Undergraduates must complete 1 project, graduates must complete 2 * Important Rules ** For maximum benefit, homework should be done on-time. However, homework will be allowed to be re-submitted at any time for full credit, but must present a unique solution to previous work from yourself or others. ** All work must cite co-group members (if any) and the source of any code snippets used online. === Grading Rationale === Homework points will only be awarded for correct, working code and correct algorithmic analysis, while the homework problems will become progressively tougher. Undergraduates should be able to pass the course with an A if they have correctly answered most of the homework, appear at class prepared and on-time, and made a strong attempt at one of the projects. Graduate students should both perform well on the homework and successfully complete one or two projects. The re-grading for homework allows making up for missed assignments, and encourages returning to core concepts at a later point in the class. Students who have put in the studying effort, completed significant portions of the homework and projects both in- and out of class have thus demonstrated introductory programming proficiency. == Projects == * Midterm Project Description [[Media:Midterm2018.pdf]] (2 Mar., 2018) ** [[Agile|Agile Development Tips & Tricks]] <!--* Final Project Description [[Media:Final2018.pdf]] (25 Apr., 2018)--> == Textbooks and Resources == * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-0072-7 Beginning Python, Hetland, 2005] (eBook avail. from USF Library) * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-3238-4 Python Algorithms, Hetland, 2010] (eBook avail. from USF Library) * [http://aosabook.org/en/index.html The Architecture of Open Source Applications] * [http://docs.python.org Python Documentation] * [https://developers.google.com/edu/python/ Google Introductory Python Notes] * [http://huffman.sourceforge.net/tao/tao-of-programming.html Tao of Programming] Other (possibly useful) materials: * [http://hackersdictionary.com/html/entry/larval-stage.html The Jargon File] * Chapters 7&8 of Modelling and Simulation, Birta and Arbez, Springer 2007 (eBook avail. from USF Library). * Chapters 4-6 of Models and Algorithms for Intelligent Data Analysis, Runkler, Springer 2012 (eBook avail. from USF Library). * Guide to Scientific Computing in C++, Francis and Whiteley, Springer, 2012. (eBook avail. from USF Library) * Extra info. On the basics: ** Chapters 3 and 7 of Mathematics in Computing, Regan, Springer 2013. (eBook avail. from USF Library) ** Instant feedback graphical programming with [https://www.khanacademy.org/cs/programming/ Khan Academy] * [http://www.meetup.com/python-178/ Local PyBulls Meetings] Code: * [http://carsonfarmer.com/2013/07/essential-python-geo-libraries Python Libraries Useful for Geospatial Problems] * [[Code#Python_Libraries|Python Libraries Useful for Computational Chemistry]] (very small list at present) Interactive Interpreters: * [http://www.codewars.com CodeWars] Recommended for building experience with practice problems. * [http://codecombat.com/ CodeCombat] A very visual way to interact with your python code. * [http://exercism.io Exercism] A command-line client with a similar learn-through-challenge philosophy. * [http://repl.it repl.it] A read-eval-print loop for several computer languages. * [http://en.cppreference.com/w/cpp/language CppReference] Documentation with an online evaluator for C++ code. === Notes === * [[Media:Intro.pdf|Introduction Notes]] * [[Media:Week2.pdf|Function Syntax]] and [[Media:Week3.pdf|For-Loop Syntax]] cheat-sheets. * [[Media:PlottingMaps.pdf|Plotting Maps]] <!-- ** [[Turing Exercise]] ** [https://predictivestatmech.org/code/example.dcd Example DCD File] * [[Media:Week-5.2017.pdf|Week 5 Notes]] * [[Media:PlottingMaps.pdf|Week 6 Notes]] ** [[Code:PyTesting]] * [[Media:NumpyArrays.pdf|Week 7 Notes]] ** [http://www.labri.fr/perso/nrougier/from-python-to-numpy/ all about numpy] * Misc. Notes for Week 8 ** [[Physics:Pairs|Rundown of Pair Interactions]] ** Parameterized surfaces [[Media:param1.jpg|1]] and [[Media:param2.jpg|2]] * Notes for Compilation Lab ** [https://learnpythonthehardway.org/book/appendixa.html Command Line Crash Course] Cheat sheet for bash commands. ** USF's compute cluster documentation at [https://wiki.rc.usf.edu/index.php/Main_Page RC Wiki]. *** See especially the "Connecting to SC" and "Modules" sections ** [[Code:Compiling|Cheat-codes]] for compilation lab. * [[Media:jobs.pdf|Research Computing Batch Queue]] * [[Media:Plug-in.pdf|Plugging Into Libraries]] * [[Media:Matrix.pdf|Matrix Algorithms]] --> * Midterm Projects: ** Luis & Matteo [https://drive.google.com/file/d/1tTkwRuJts2SnZcEkVlHO51ItacFfHYL3/view?usp=sharing_eil&ts=5a9d6cb2] ** Misty & Cherinee [https://docs.google.com/presentation/d/17UTtjv-2d19mTtYt9oVwrWI5eOuo7l2qg4zYsOGXTxw/edit?ts=5a9d7601#slide=id.gc6f90357f_0_0] ** Pauline [http://predictivestatmech.org/wiki/code/pauline.py] ** Daniel ** Nasha [http://predictivestatmech.org/wiki/code/nasha.py] ** Melissa, Casidy & Paul [https://docs.google.com/presentation/d/10U8loA8uPMypoEWO163e6smZ9JnrPXjyQl97Duz8Hg8/edit?usp=sharing_eip&ts=5a9d6081] === In-Class Problems === * Week 1: [[Media:CalculatorProbs.pdf|Calculator Problems]] ** Solutions: [http://predictivestatmech.org/terms/term.html] ** This solution uses python list comprehensions, and shows that the slowest step is actually unit conversion! * Week 2: [[Media:Pseudocode.pdf|Pseudocode Problems]] ** We will work these in class. For practice, be sure you have python list ideas down! ** Solutions: [https://docs.google.com/document/d/1HRkSdVNsTUydY4cVx67jRHRyhi5gL6nneEj9IX89wlE/edit?usp=sharing] * Week 3: [[Media:Plotting1.pdf|Plotting 1]] ** [https://stackoverflow.com/questions/11815538/how-to-import-matplotlib-in-python#11830055 Notes on installing Matplotlib on your own computer] ** Challenge: actions vs. functions -- what does the following code do: "[ print(1) for i in range(10) ]" (python3 only) * Week 4: [[Media:Plotting2.pdf|Plotting 2]] ** Solutions: [https://docs.google.com/document/d/1AanEFQmxLxoNM-662MHxsxToY3wsqovNx6SwcPQuBIg/edit?usp=sharing] * Week 5: Read pseudocode and plotting, focusing on types and syntax. Also, re-read the end of chapter summaries for Ch. 3, 5 and 6. * Week 6: Read the following pieces on first order logic [http://bayes.wustl.edu/etj/prob/book.pdf Chapter 1 of Jaynes' Book] [http://web.cecs.pdx.edu/~cs410aph/Lectures/Smalltalk%20II/Dijkstra%20on%20Hamming%27s%20Problem.pdf Hamming's Problem], and pages 71-80 in Chapter 4 of Hetland's Algorithms book (on induction). Just skip directly to chapter 4. ** Solutions [https://docs.google.com/document/d/14QZxh2SAWl3JE-SzVyemkAv4p9TBChO-jzZ5YpT8BZs/edit?usp=sharing] * Week 7: Review Hetland, Chapters 3-7. We'll do a series of parsing problems and flex our collective induction and recursion muscles. ** [https://docs.google.com/document/d/1i04oL7zJsD3KzvsPIaHBgwaOZ78UZvz5ReRDF-PlyF0/edit?usp=sharing Week 7 Problems] * Week 8: [[Media:Minimization1.pdf|Minimization Problems!]] <source lang="python"> # Review Notes on Sequences, list comprehensions and arrays # Say you want to make a plot of the LJ function on the domain x \in [0.9, 3] # 1. You could use the following two list comprehensions to be specific: x = [ i*(3-0.9)/100.0 + 0.9 for i in range(101) ] y = [ 4*(xi**-12 - xi**-6) for xi in x] # 2. You could implement the LJ function as a python function and use MAP, def LJ(x): ix6 = x**-6 # the factoring makes this calculation more efficient return 4*ix6*(ix6 + 1.0) y = map(LJ, x) # 3. You could work on arrays, where addition, multiplication, and powers are elementwise: ax = arange(101)*(3-0.9)/100 + 0.9 ay = LJ(ax) # Mind the difference in type! type(x) type(ax) # 4. You could totally cheat, and use numpy's builtin functions. ax = linspace(0.9, 3.0, 101) # Exercise: replicate the steps above to test the finite difference computation # of the derivative against the analytical derivative of LJ. [ (y[i+1]-y[i])/(x[i+1]-x[i]) for i in ... import matplotlib.pyplot as plt plt.plot(x, y) plt.show() </source> === Homework === * Homework will be assigned through Repl.IT * Project presentations will be on Mon.-Wed., Mar 5-7 * Final Project presentations will be during exam time, Wed., May 2 9c9872156446db056aa6a1d751732a0aac3d6e64 645 644 2018-03-05T17:19:24Z David M. Rogers 2 /* Notes */ wikitext text/x-wiki '''<BIG>Introduction to Scientific Computing</BIG>''' Course Info * Course Numbers CHM 4932-004/6938-010, CRN: 20438/20439 * Credit Hours: 3 * Meeting Dates: January 8 - April 25, 2018 ** No Class Jan. 15 or Mar. 12-18 * Meeting Times: Mon. and Wed., 12:30-13:45 in SCA 222 ** Midterm Project Presentations: Mon.-Wed., Mar 5 and 7. ** Final Project Presentations: Wed., May 2, 10:00am – 12:00pm (scheduled final date) ** Lab Session & Office Hours: Fri. 12:30-13:45 in IDR 214 (or SCA 222 by announcement) <pre> $ for((i=1;i<=4;i++)); do cal $i 2018; done ____ January 2018 ____ _____ March 2018 ____ | Su Mo Tu We Th Fr Sa | | Su Mo Tu We Th Fr Sa | 1 2 3 4 5 6 | | 1 (2) 3 1 | 7 8 9*10 11 12 13 | 9 | 4 (5) 6 (7) 8 9 10 2 | 14 x 16*17 18 19 20 | | x x 3 | 21*22 23 24 25 26 27 | 10 | 18*19 20 21 22 23 24 4 | 28*29 30 31 | 11 | 25*26 27 28 29 30 31 ___ February 2018 ____ _____ April 2018 ____ | Su Mo Tu We Th Fr Sa | | Su Mo Tu We Th Fr Sa | 1 2 3 | 12 | 1 *2 3 4 5 6 7 5 | 4 *5 6 7 8 9 10 | 13 | 8 *9 10 11 12 13 14 6 | 11*12 13 14 15 16 17 | 14 | 15*16 17 18 19 20 21 7 | 18*19 20 21 22 23 24 | 15 | 22*23 24(25)26 27 28 8 | 25*26 27 28 | | 29 x Week Topic 1 Calculator Form 2 Pseudocode 3 Plotting 1 (Excel) 4 Plotting 2 (Matplotlib and linear spaces) 5 Abstraction 1 (advanced functions and oo method) 6 Abstraction 2 (Booleans and logic) 7 2D transforms and iterated maps 8 Optimization 1 (Newton-Rhapson) 9 midterm project presentations 10 Optimization 2 (MD Energy) 11 ODE and SDE algorithms 12 Statistics 13 Complexity 14 Circe and Linux crash course 15 Compile & install process, ctypes </pre> == Overview == Mathematical models in the natural sciences take many shapes and forms. The moment they become more complicated than tracking a few variables over time, we have to put away our Excel spreadsheets and make use of a solid foundation in computational science. The course establishes this foundation by introducing data structures and algorithms used in everyday scientific computing using examples in the python scripting language. By the end of the Semester, students will be able to navigate the Linux command-line to go from a mathematical model to a numerical solution. Best practices for working with computer code and visualizing data will also be covered. == Topics == # Languages #* bash (shell) #* python (scripting) #* stack & register-based machine languages: overview of C and Fortran syntax & compiling with gcc, ‘thread safety’ #* Shared libraries & language inter-operability (FFI) # Algorithms #* Horner’s algorithm for polynomials #* Newton’s root finding algo. #* Overview of general optimization algo-s (example: linear & nonlin. least-squares) #* Numerical integration (scripted, plus gnu ODE) #* Communication (how HTTP get/put works) # Data Structures #* Linked Lists #* Trees (file system hierarchies) #* Graphs #* Arrays (dense & sparse) example: vectors & rotations / transpositions, densities and difference operators # Presentation & visualization #* Flat CSV files (and excel) #* Working with binary data #* Python matplotlib (2D images) #* Binning histograms & weighted averages # Best Practices #* High-level code design (modularity, interface specifications, unit testing, etc.) #* Code audit: open-source libraries, ex. Gnu Scientific Library, qsort in libc, Boost #* Source code versioning (example: git or mercurial) #* gdb & execution profiling #* documentation #* Makefiles == Grading == '''Grading Scale (out of 400 points possible)''' {| class="wikitable" |- ! Grade ! Undergraduate ! Graduate |- | A+ | 269 | 323 |- | A | 258 | 310 |- | A- | 250 | 300 |- | B+ | 241 | 290 |- | B | 230 | 276 |- | B- | 222 | 266 |- | C+ | 213 | 256 |- | C | 202 | 243 |- | C- | 194 | 233 |- | D+ | 186 | 223 |- | D | 175 | 210 |- | D- | 166 | 200 |} * (280 U / 330 G) Points Possible: ** 9 homework assignments (10 points per homework) ** 14 in-class assignments / quizzes (10 points per week) ** 2 projects / competitions (50 points per project) ** Undergraduates must complete 1 project, graduates must complete 2 * Important Rules ** For maximum benefit, homework should be done on-time. However, homework will be allowed to be re-submitted at any time for full credit, but must present a unique solution to previous work from yourself or others. ** All work must cite co-group members (if any) and the source of any code snippets used online. === Grading Rationale === Homework points will only be awarded for correct, working code and correct algorithmic analysis, while the homework problems will become progressively tougher. Undergraduates should be able to pass the course with an A if they have correctly answered most of the homework, appear at class prepared and on-time, and made a strong attempt at one of the projects. Graduate students should both perform well on the homework and successfully complete one or two projects. The re-grading for homework allows making up for missed assignments, and encourages returning to core concepts at a later point in the class. Students who have put in the studying effort, completed significant portions of the homework and projects both in- and out of class have thus demonstrated introductory programming proficiency. == Projects == * Midterm Project Description [[Media:Midterm2018.pdf]] (2 Mar., 2018) ** [[Agile|Agile Development Tips & Tricks]] <!--* Final Project Description [[Media:Final2018.pdf]] (25 Apr., 2018)--> == Textbooks and Resources == * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-0072-7 Beginning Python, Hetland, 2005] (eBook avail. from USF Library) * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-3238-4 Python Algorithms, Hetland, 2010] (eBook avail. from USF Library) * [http://aosabook.org/en/index.html The Architecture of Open Source Applications] * [http://docs.python.org Python Documentation] * [https://developers.google.com/edu/python/ Google Introductory Python Notes] * [http://huffman.sourceforge.net/tao/tao-of-programming.html Tao of Programming] Other (possibly useful) materials: * [http://hackersdictionary.com/html/entry/larval-stage.html The Jargon File] * Chapters 7&8 of Modelling and Simulation, Birta and Arbez, Springer 2007 (eBook avail. from USF Library). * Chapters 4-6 of Models and Algorithms for Intelligent Data Analysis, Runkler, Springer 2012 (eBook avail. from USF Library). * Guide to Scientific Computing in C++, Francis and Whiteley, Springer, 2012. (eBook avail. from USF Library) * Extra info. On the basics: ** Chapters 3 and 7 of Mathematics in Computing, Regan, Springer 2013. (eBook avail. from USF Library) ** Instant feedback graphical programming with [https://www.khanacademy.org/cs/programming/ Khan Academy] * [http://www.meetup.com/python-178/ Local PyBulls Meetings] Code: * [http://carsonfarmer.com/2013/07/essential-python-geo-libraries Python Libraries Useful for Geospatial Problems] * [[Code#Python_Libraries|Python Libraries Useful for Computational Chemistry]] (very small list at present) Interactive Interpreters: * [http://www.codewars.com CodeWars] Recommended for building experience with practice problems. * [http://codecombat.com/ CodeCombat] A very visual way to interact with your python code. * [http://exercism.io Exercism] A command-line client with a similar learn-through-challenge philosophy. * [http://repl.it repl.it] A read-eval-print loop for several computer languages. * [http://en.cppreference.com/w/cpp/language CppReference] Documentation with an online evaluator for C++ code. === Notes === * [[Media:Intro.pdf|Introduction Notes]] * [[Media:Week2.pdf|Function Syntax]] and [[Media:Week3.pdf|For-Loop Syntax]] cheat-sheets. * [[Media:PlottingMaps.pdf|Plotting Maps]] <!-- ** [[Turing Exercise]] ** [https://predictivestatmech.org/code/example.dcd Example DCD File] * [[Media:Week-5.2017.pdf|Week 5 Notes]] * [[Media:PlottingMaps.pdf|Week 6 Notes]] ** [[Code:PyTesting]] * [[Media:NumpyArrays.pdf|Week 7 Notes]] ** [http://www.labri.fr/perso/nrougier/from-python-to-numpy/ all about numpy] * Misc. Notes for Week 8 ** [[Physics:Pairs|Rundown of Pair Interactions]] ** Parameterized surfaces [[Media:param1.jpg|1]] and [[Media:param2.jpg|2]] * Notes for Compilation Lab ** [https://learnpythonthehardway.org/book/appendixa.html Command Line Crash Course] Cheat sheet for bash commands. ** USF's compute cluster documentation at [https://wiki.rc.usf.edu/index.php/Main_Page RC Wiki]. *** See especially the "Connecting to SC" and "Modules" sections ** [[Code:Compiling|Cheat-codes]] for compilation lab. * [[Media:jobs.pdf|Research Computing Batch Queue]] * [[Media:Plug-in.pdf|Plugging Into Libraries]] * [[Media:Matrix.pdf|Matrix Algorithms]] --> * Midterm Projects: ** Luis & Matteo [https://drive.google.com/file/d/1tTkwRuJts2SnZcEkVlHO51ItacFfHYL3/view?usp=sharing_eil&ts=5a9d6cb2] ** Misty & Cherinee [https://docs.google.com/presentation/d/17UTtjv-2d19mTtYt9oVwrWI5eOuo7l2qg4zYsOGXTxw/edit?ts=5a9d7601#slide=id.gc6f90357f_0_0] ** Pauline [http://predictivestatmech.org/code/pauline.py] ** Daniel ** Nasha [http://predictivestatmech.org/code/nasha.py] ** Melissa, Casidy & Paul [https://docs.google.com/presentation/d/10U8loA8uPMypoEWO163e6smZ9JnrPXjyQl97Duz8Hg8/edit?usp=sharing_eip&ts=5a9d6081] === In-Class Problems === * Week 1: [[Media:CalculatorProbs.pdf|Calculator Problems]] ** Solutions: [http://predictivestatmech.org/terms/term.html] ** This solution uses python list comprehensions, and shows that the slowest step is actually unit conversion! * Week 2: [[Media:Pseudocode.pdf|Pseudocode Problems]] ** We will work these in class. For practice, be sure you have python list ideas down! ** Solutions: [https://docs.google.com/document/d/1HRkSdVNsTUydY4cVx67jRHRyhi5gL6nneEj9IX89wlE/edit?usp=sharing] * Week 3: [[Media:Plotting1.pdf|Plotting 1]] ** [https://stackoverflow.com/questions/11815538/how-to-import-matplotlib-in-python#11830055 Notes on installing Matplotlib on your own computer] ** Challenge: actions vs. functions -- what does the following code do: "[ print(1) for i in range(10) ]" (python3 only) * Week 4: [[Media:Plotting2.pdf|Plotting 2]] ** Solutions: [https://docs.google.com/document/d/1AanEFQmxLxoNM-662MHxsxToY3wsqovNx6SwcPQuBIg/edit?usp=sharing] * Week 5: Read pseudocode and plotting, focusing on types and syntax. Also, re-read the end of chapter summaries for Ch. 3, 5 and 6. * Week 6: Read the following pieces on first order logic [http://bayes.wustl.edu/etj/prob/book.pdf Chapter 1 of Jaynes' Book] [http://web.cecs.pdx.edu/~cs410aph/Lectures/Smalltalk%20II/Dijkstra%20on%20Hamming%27s%20Problem.pdf Hamming's Problem], and pages 71-80 in Chapter 4 of Hetland's Algorithms book (on induction). Just skip directly to chapter 4. ** Solutions [https://docs.google.com/document/d/14QZxh2SAWl3JE-SzVyemkAv4p9TBChO-jzZ5YpT8BZs/edit?usp=sharing] * Week 7: Review Hetland, Chapters 3-7. We'll do a series of parsing problems and flex our collective induction and recursion muscles. ** [https://docs.google.com/document/d/1i04oL7zJsD3KzvsPIaHBgwaOZ78UZvz5ReRDF-PlyF0/edit?usp=sharing Week 7 Problems] * Week 8: [[Media:Minimization1.pdf|Minimization Problems!]] <source lang="python"> # Review Notes on Sequences, list comprehensions and arrays # Say you want to make a plot of the LJ function on the domain x \in [0.9, 3] # 1. You could use the following two list comprehensions to be specific: x = [ i*(3-0.9)/100.0 + 0.9 for i in range(101) ] y = [ 4*(xi**-12 - xi**-6) for xi in x] # 2. You could implement the LJ function as a python function and use MAP, def LJ(x): ix6 = x**-6 # the factoring makes this calculation more efficient return 4*ix6*(ix6 + 1.0) y = map(LJ, x) # 3. You could work on arrays, where addition, multiplication, and powers are elementwise: ax = arange(101)*(3-0.9)/100 + 0.9 ay = LJ(ax) # Mind the difference in type! type(x) type(ax) # 4. You could totally cheat, and use numpy's builtin functions. ax = linspace(0.9, 3.0, 101) # Exercise: replicate the steps above to test the finite difference computation # of the derivative against the analytical derivative of LJ. [ (y[i+1]-y[i])/(x[i+1]-x[i]) for i in ... import matplotlib.pyplot as plt plt.plot(x, y) plt.show() </source> === Homework === * Homework will be assigned through Repl.IT * Project presentations will be on Mon.-Wed., Mar 5-7 * Final Project presentations will be during exam time, Wed., May 2 7f296a81fabc7fb35555360623cb00bf33bd7704 646 645 2018-03-07T16:28:12Z David M. Rogers 2 /* In-Class Problems */ wikitext text/x-wiki '''<BIG>Introduction to Scientific Computing</BIG>''' Course Info * Course Numbers CHM 4932-004/6938-010, CRN: 20438/20439 * Credit Hours: 3 * Meeting Dates: January 8 - April 25, 2018 ** No Class Jan. 15 or Mar. 12-18 * Meeting Times: Mon. and Wed., 12:30-13:45 in SCA 222 ** Midterm Project Presentations: Mon.-Wed., Mar 5 and 7. ** Final Project Presentations: Wed., May 2, 10:00am – 12:00pm (scheduled final date) ** Lab Session & Office Hours: Fri. 12:30-13:45 in IDR 214 (or SCA 222 by announcement) <pre> $ for((i=1;i<=4;i++)); do cal $i 2018; done ____ January 2018 ____ _____ March 2018 ____ | Su Mo Tu We Th Fr Sa | | Su Mo Tu We Th Fr Sa | 1 2 3 4 5 6 | | 1 (2) 3 1 | 7 8 9*10 11 12 13 | 9 | 4 (5) 6 (7) 8 9 10 2 | 14 x 16*17 18 19 20 | | x x 3 | 21*22 23 24 25 26 27 | 10 | 18*19 20 21 22 23 24 4 | 28*29 30 31 | 11 | 25*26 27 28 29 30 31 ___ February 2018 ____ _____ April 2018 ____ | Su Mo Tu We Th Fr Sa | | Su Mo Tu We Th Fr Sa | 1 2 3 | 12 | 1 *2 3 4 5 6 7 5 | 4 *5 6 7 8 9 10 | 13 | 8 *9 10 11 12 13 14 6 | 11*12 13 14 15 16 17 | 14 | 15*16 17 18 19 20 21 7 | 18*19 20 21 22 23 24 | 15 | 22*23 24(25)26 27 28 8 | 25*26 27 28 | | 29 x Week Topic 1 Calculator Form 2 Pseudocode 3 Plotting 1 (Excel) 4 Plotting 2 (Matplotlib and linear spaces) 5 Abstraction 1 (advanced functions and oo method) 6 Abstraction 2 (Booleans and logic) 7 2D transforms and iterated maps 8 Optimization 1 (Newton-Rhapson) 9 midterm project presentations 10 Optimization 2 (MD Energy) 11 ODE and SDE algorithms 12 Statistics 13 Complexity 14 Circe and Linux crash course 15 Compile & install process, ctypes </pre> == Overview == Mathematical models in the natural sciences take many shapes and forms. The moment they become more complicated than tracking a few variables over time, we have to put away our Excel spreadsheets and make use of a solid foundation in computational science. The course establishes this foundation by introducing data structures and algorithms used in everyday scientific computing using examples in the python scripting language. By the end of the Semester, students will be able to navigate the Linux command-line to go from a mathematical model to a numerical solution. Best practices for working with computer code and visualizing data will also be covered. == Topics == # Languages #* bash (shell) #* python (scripting) #* stack & register-based machine languages: overview of C and Fortran syntax & compiling with gcc, ‘thread safety’ #* Shared libraries & language inter-operability (FFI) # Algorithms #* Horner’s algorithm for polynomials #* Newton’s root finding algo. #* Overview of general optimization algo-s (example: linear & nonlin. least-squares) #* Numerical integration (scripted, plus gnu ODE) #* Communication (how HTTP get/put works) # Data Structures #* Linked Lists #* Trees (file system hierarchies) #* Graphs #* Arrays (dense & sparse) example: vectors & rotations / transpositions, densities and difference operators # Presentation & visualization #* Flat CSV files (and excel) #* Working with binary data #* Python matplotlib (2D images) #* Binning histograms & weighted averages # Best Practices #* High-level code design (modularity, interface specifications, unit testing, etc.) #* Code audit: open-source libraries, ex. Gnu Scientific Library, qsort in libc, Boost #* Source code versioning (example: git or mercurial) #* gdb & execution profiling #* documentation #* Makefiles == Grading == '''Grading Scale (out of 400 points possible)''' {| class="wikitable" |- ! Grade ! Undergraduate ! Graduate |- | A+ | 269 | 323 |- | A | 258 | 310 |- | A- | 250 | 300 |- | B+ | 241 | 290 |- | B | 230 | 276 |- | B- | 222 | 266 |- | C+ | 213 | 256 |- | C | 202 | 243 |- | C- | 194 | 233 |- | D+ | 186 | 223 |- | D | 175 | 210 |- | D- | 166 | 200 |} * (280 U / 330 G) Points Possible: ** 9 homework assignments (10 points per homework) ** 14 in-class assignments / quizzes (10 points per week) ** 2 projects / competitions (50 points per project) ** Undergraduates must complete 1 project, graduates must complete 2 * Important Rules ** For maximum benefit, homework should be done on-time. However, homework will be allowed to be re-submitted at any time for full credit, but must present a unique solution to previous work from yourself or others. ** All work must cite co-group members (if any) and the source of any code snippets used online. === Grading Rationale === Homework points will only be awarded for correct, working code and correct algorithmic analysis, while the homework problems will become progressively tougher. Undergraduates should be able to pass the course with an A if they have correctly answered most of the homework, appear at class prepared and on-time, and made a strong attempt at one of the projects. Graduate students should both perform well on the homework and successfully complete one or two projects. The re-grading for homework allows making up for missed assignments, and encourages returning to core concepts at a later point in the class. Students who have put in the studying effort, completed significant portions of the homework and projects both in- and out of class have thus demonstrated introductory programming proficiency. == Projects == * Midterm Project Description [[Media:Midterm2018.pdf]] (2 Mar., 2018) ** [[Agile|Agile Development Tips & Tricks]] <!--* Final Project Description [[Media:Final2018.pdf]] (25 Apr., 2018)--> == Textbooks and Resources == * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-0072-7 Beginning Python, Hetland, 2005] (eBook avail. from USF Library) * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-3238-4 Python Algorithms, Hetland, 2010] (eBook avail. from USF Library) * [http://aosabook.org/en/index.html The Architecture of Open Source Applications] * [http://docs.python.org Python Documentation] * [https://developers.google.com/edu/python/ Google Introductory Python Notes] * [http://huffman.sourceforge.net/tao/tao-of-programming.html Tao of Programming] Other (possibly useful) materials: * [http://hackersdictionary.com/html/entry/larval-stage.html The Jargon File] * Chapters 7&8 of Modelling and Simulation, Birta and Arbez, Springer 2007 (eBook avail. from USF Library). * Chapters 4-6 of Models and Algorithms for Intelligent Data Analysis, Runkler, Springer 2012 (eBook avail. from USF Library). * Guide to Scientific Computing in C++, Francis and Whiteley, Springer, 2012. (eBook avail. from USF Library) * Extra info. On the basics: ** Chapters 3 and 7 of Mathematics in Computing, Regan, Springer 2013. (eBook avail. from USF Library) ** Instant feedback graphical programming with [https://www.khanacademy.org/cs/programming/ Khan Academy] * [http://www.meetup.com/python-178/ Local PyBulls Meetings] Code: * [http://carsonfarmer.com/2013/07/essential-python-geo-libraries Python Libraries Useful for Geospatial Problems] * [[Code#Python_Libraries|Python Libraries Useful for Computational Chemistry]] (very small list at present) Interactive Interpreters: * [http://www.codewars.com CodeWars] Recommended for building experience with practice problems. * [http://codecombat.com/ CodeCombat] A very visual way to interact with your python code. * [http://exercism.io Exercism] A command-line client with a similar learn-through-challenge philosophy. * [http://repl.it repl.it] A read-eval-print loop for several computer languages. * [http://en.cppreference.com/w/cpp/language CppReference] Documentation with an online evaluator for C++ code. === Notes === * [[Media:Intro.pdf|Introduction Notes]] * [[Media:Week2.pdf|Function Syntax]] and [[Media:Week3.pdf|For-Loop Syntax]] cheat-sheets. * [[Media:PlottingMaps.pdf|Plotting Maps]] <!-- ** [[Turing Exercise]] ** [https://predictivestatmech.org/code/example.dcd Example DCD File] * [[Media:Week-5.2017.pdf|Week 5 Notes]] * [[Media:PlottingMaps.pdf|Week 6 Notes]] ** [[Code:PyTesting]] * [[Media:NumpyArrays.pdf|Week 7 Notes]] ** [http://www.labri.fr/perso/nrougier/from-python-to-numpy/ all about numpy] * Misc. Notes for Week 8 ** [[Physics:Pairs|Rundown of Pair Interactions]] ** Parameterized surfaces [[Media:param1.jpg|1]] and [[Media:param2.jpg|2]] * Notes for Compilation Lab ** [https://learnpythonthehardway.org/book/appendixa.html Command Line Crash Course] Cheat sheet for bash commands. ** USF's compute cluster documentation at [https://wiki.rc.usf.edu/index.php/Main_Page RC Wiki]. *** See especially the "Connecting to SC" and "Modules" sections ** [[Code:Compiling|Cheat-codes]] for compilation lab. * [[Media:jobs.pdf|Research Computing Batch Queue]] * [[Media:Plug-in.pdf|Plugging Into Libraries]] * [[Media:Matrix.pdf|Matrix Algorithms]] --> * Midterm Projects: ** Luis & Matteo [https://drive.google.com/file/d/1tTkwRuJts2SnZcEkVlHO51ItacFfHYL3/view?usp=sharing_eil&ts=5a9d6cb2] ** Misty & Cherinee [https://docs.google.com/presentation/d/17UTtjv-2d19mTtYt9oVwrWI5eOuo7l2qg4zYsOGXTxw/edit?ts=5a9d7601#slide=id.gc6f90357f_0_0] ** Pauline [http://predictivestatmech.org/code/pauline.py] ** Daniel ** Nasha [http://predictivestatmech.org/code/nasha.py] ** Melissa, Casidy & Paul [https://docs.google.com/presentation/d/10U8loA8uPMypoEWO163e6smZ9JnrPXjyQl97Duz8Hg8/edit?usp=sharing_eip&ts=5a9d6081] === In-Class Problems === * Week 1: [[Media:CalculatorProbs.pdf|Calculator Problems]] ** Solutions: [http://predictivestatmech.org/terms/term.html] ** This solution uses python list comprehensions, and shows that the slowest step is actually unit conversion! * Week 2: [[Media:Pseudocode.pdf|Pseudocode Problems]] ** We will work these in class. For practice, be sure you have python list ideas down! ** Solutions: [https://docs.google.com/document/d/1HRkSdVNsTUydY4cVx67jRHRyhi5gL6nneEj9IX89wlE/edit?usp=sharing] * Week 3: [[Media:Plotting1.pdf|Plotting 1]] ** [https://stackoverflow.com/questions/11815538/how-to-import-matplotlib-in-python#11830055 Notes on installing Matplotlib on your own computer] ** Challenge: actions vs. functions -- what does the following code do: "[ print(1) for i in range(10) ]" (python3 only) * Week 4: [[Media:Plotting2.pdf|Plotting 2]] ** Solutions: [https://docs.google.com/document/d/1AanEFQmxLxoNM-662MHxsxToY3wsqovNx6SwcPQuBIg/edit?usp=sharing] * Week 5: Read pseudocode and plotting, focusing on types and syntax. Also, re-read the end of chapter summaries for Ch. 3, 5 and 6. * Week 6: Read the following pieces on first order logic [http://bayes.wustl.edu/etj/prob/book.pdf Chapter 1 of Jaynes' Book] [http://web.cecs.pdx.edu/~cs410aph/Lectures/Smalltalk%20II/Dijkstra%20on%20Hamming%27s%20Problem.pdf Hamming's Problem], and pages 71-80 in Chapter 4 of Hetland's Algorithms book (on induction). Just skip directly to chapter 4. ** Solutions [https://docs.google.com/document/d/14QZxh2SAWl3JE-SzVyemkAv4p9TBChO-jzZ5YpT8BZs/edit?usp=sharing] * Week 7: Review Hetland, Chapters 3-7. We'll do a series of parsing problems and flex our collective induction and recursion muscles. ** [https://docs.google.com/document/d/1i04oL7zJsD3KzvsPIaHBgwaOZ78UZvz5ReRDF-PlyF0/edit?usp=sharing Week 7 Problems] * Week 8: [[Media:Minimization1.pdf|Minimization Problems!]] === Review Notes on Sequences, list comprehensions and arrays === <source lang="python"> # Say you want to make a plot of the LJ function on the domain x \in [0.9, 3] # 1. You could use the following two list comprehensions to be specific: x = [ i*(3-0.9)/100.0 + 0.9 for i in range(101) ] y = [ 4*(xi**-12 - xi**-6) for xi in x] # 2. You could implement the LJ function as a python function and use MAP, def LJ(x): ix6 = x**-6 # the factoring makes this calculation more efficient return 4*ix6*(ix6 + 1.0) y = map(LJ, x) # 3. You could work on arrays, where addition, multiplication, and powers are elementwise: ax = arange(101)*(3-0.9)/100 + 0.9 ay = LJ(ax) # Mind the difference in type! type(x) type(ax) # 4. You could totally cheat, and use numpy's builtin functions. ax = linspace(0.9, 3.0, 101) # Exercise: replicate the steps above to test the finite difference computation # of the derivative against the analytical derivative of LJ. [ (y[i+1]-y[i])/(x[i+1]-x[i]) for i in ... import matplotlib.pyplot as plt plt.plot(x, y) plt.show() </source> === Review Notes on Functions with Function arguments (functionals) === <source lang="python"> # map : (a -> b), [ a ] -> [ b ] # map: map(str, [1,2,3]) --> [ "1", "2", "3" ] # ^ function (a -> b) # map(int, map(str, [1,2,3]) ) # - helpful for parsing # x = "1 2 3 4 5" # x.split() # ["1", "2", "3", "4", "5"] # map(int, x.split()) # [1,2,3,4,5] str([1,2,3]) # "[1, 2, 3]" (bad) map(str, [1,2,3]) # ["1", "2", "3"] (good) # filter: (a -> Bool), [a] -> [a] # Example filter: # '1' -> no # ' ' -> no # 'a-z' -> yes # 'A-Z' -> yes def f(x): # str -> Bool if x >= 'a' and x <= 'z': return True if x >= 'A' and x <= 'Z': return True return False filter(f, " 1 a b 2 \n") # reduce: (a,b -> a), [b], a -> a sum([1,2,3]) # -> 6 def add2(x,y): # x : int, y : int return x+y reduce(add2, [1,2,3], 0) # For an example where a != b: def append(x,y): # x : [int], y : int return x + [y] reduce(append, [1,2,3], []) # start with an empty list # Newton-Rhapson def nrhap(f, fp, x0, tol = 1e-6): y = f(x0) iter = 0 # guard against infinity while abs(y) > tol: iter += 1 if iter > 1000: raise ValueError, "Unable to converge!" x0 -= y/fp(x0) y = f(x0) return x0 # solve x^3 - 2 = 0 def f(x): return x**3 - 2 def fp(x): return 3*x**2 print( nrhap(f, fp, 1.0)**3 ) </source> === Homework === * Homework will be assigned through Repl.IT * Project presentations will be on Mon.-Wed., Mar 5-7 * Final Project presentations will be during exam time, Wed., May 2 1862b754645f9c357297335544230c06433fdc7b 647 646 2018-03-07T16:57:40Z David M. Rogers 2 /* Notes */ wikitext text/x-wiki '''<BIG>Introduction to Scientific Computing</BIG>''' Course Info * Course Numbers CHM 4932-004/6938-010, CRN: 20438/20439 * Credit Hours: 3 * Meeting Dates: January 8 - April 25, 2018 ** No Class Jan. 15 or Mar. 12-18 * Meeting Times: Mon. and Wed., 12:30-13:45 in SCA 222 ** Midterm Project Presentations: Mon.-Wed., Mar 5 and 7. ** Final Project Presentations: Wed., May 2, 10:00am – 12:00pm (scheduled final date) ** Lab Session & Office Hours: Fri. 12:30-13:45 in IDR 214 (or SCA 222 by announcement) <pre> $ for((i=1;i<=4;i++)); do cal $i 2018; done ____ January 2018 ____ _____ March 2018 ____ | Su Mo Tu We Th Fr Sa | | Su Mo Tu We Th Fr Sa | 1 2 3 4 5 6 | | 1 (2) 3 1 | 7 8 9*10 11 12 13 | 9 | 4 (5) 6 (7) 8 9 10 2 | 14 x 16*17 18 19 20 | | x x 3 | 21*22 23 24 25 26 27 | 10 | 18*19 20 21 22 23 24 4 | 28*29 30 31 | 11 | 25*26 27 28 29 30 31 ___ February 2018 ____ _____ April 2018 ____ | Su Mo Tu We Th Fr Sa | | Su Mo Tu We Th Fr Sa | 1 2 3 | 12 | 1 *2 3 4 5 6 7 5 | 4 *5 6 7 8 9 10 | 13 | 8 *9 10 11 12 13 14 6 | 11*12 13 14 15 16 17 | 14 | 15*16 17 18 19 20 21 7 | 18*19 20 21 22 23 24 | 15 | 22*23 24(25)26 27 28 8 | 25*26 27 28 | | 29 x Week Topic 1 Calculator Form 2 Pseudocode 3 Plotting 1 (Excel) 4 Plotting 2 (Matplotlib and linear spaces) 5 Abstraction 1 (advanced functions and oo method) 6 Abstraction 2 (Booleans and logic) 7 2D transforms and iterated maps 8 Optimization 1 (Newton-Rhapson) 9 midterm project presentations 10 Optimization 2 (MD Energy) 11 ODE and SDE algorithms 12 Statistics 13 Complexity 14 Circe and Linux crash course 15 Compile & install process, ctypes </pre> == Overview == Mathematical models in the natural sciences take many shapes and forms. The moment they become more complicated than tracking a few variables over time, we have to put away our Excel spreadsheets and make use of a solid foundation in computational science. The course establishes this foundation by introducing data structures and algorithms used in everyday scientific computing using examples in the python scripting language. By the end of the Semester, students will be able to navigate the Linux command-line to go from a mathematical model to a numerical solution. Best practices for working with computer code and visualizing data will also be covered. == Topics == # Languages #* bash (shell) #* python (scripting) #* stack & register-based machine languages: overview of C and Fortran syntax & compiling with gcc, ‘thread safety’ #* Shared libraries & language inter-operability (FFI) # Algorithms #* Horner’s algorithm for polynomials #* Newton’s root finding algo. #* Overview of general optimization algo-s (example: linear & nonlin. least-squares) #* Numerical integration (scripted, plus gnu ODE) #* Communication (how HTTP get/put works) # Data Structures #* Linked Lists #* Trees (file system hierarchies) #* Graphs #* Arrays (dense & sparse) example: vectors & rotations / transpositions, densities and difference operators # Presentation & visualization #* Flat CSV files (and excel) #* Working with binary data #* Python matplotlib (2D images) #* Binning histograms & weighted averages # Best Practices #* High-level code design (modularity, interface specifications, unit testing, etc.) #* Code audit: open-source libraries, ex. Gnu Scientific Library, qsort in libc, Boost #* Source code versioning (example: git or mercurial) #* gdb & execution profiling #* documentation #* Makefiles == Grading == '''Grading Scale (out of 400 points possible)''' {| class="wikitable" |- ! Grade ! Undergraduate ! Graduate |- | A+ | 269 | 323 |- | A | 258 | 310 |- | A- | 250 | 300 |- | B+ | 241 | 290 |- | B | 230 | 276 |- | B- | 222 | 266 |- | C+ | 213 | 256 |- | C | 202 | 243 |- | C- | 194 | 233 |- | D+ | 186 | 223 |- | D | 175 | 210 |- | D- | 166 | 200 |} * (280 U / 330 G) Points Possible: ** 9 homework assignments (10 points per homework) ** 14 in-class assignments / quizzes (10 points per week) ** 2 projects / competitions (50 points per project) ** Undergraduates must complete 1 project, graduates must complete 2 * Important Rules ** For maximum benefit, homework should be done on-time. However, homework will be allowed to be re-submitted at any time for full credit, but must present a unique solution to previous work from yourself or others. ** All work must cite co-group members (if any) and the source of any code snippets used online. === Grading Rationale === Homework points will only be awarded for correct, working code and correct algorithmic analysis, while the homework problems will become progressively tougher. Undergraduates should be able to pass the course with an A if they have correctly answered most of the homework, appear at class prepared and on-time, and made a strong attempt at one of the projects. Graduate students should both perform well on the homework and successfully complete one or two projects. The re-grading for homework allows making up for missed assignments, and encourages returning to core concepts at a later point in the class. Students who have put in the studying effort, completed significant portions of the homework and projects both in- and out of class have thus demonstrated introductory programming proficiency. == Projects == * Midterm Project Description [[Media:Midterm2018.pdf]] (2 Mar., 2018) ** [[Agile|Agile Development Tips & Tricks]] <!--* Final Project Description [[Media:Final2018.pdf]] (25 Apr., 2018)--> == Textbooks and Resources == * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-0072-7 Beginning Python, Hetland, 2005] (eBook avail. from USF Library) * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-3238-4 Python Algorithms, Hetland, 2010] (eBook avail. from USF Library) * [http://aosabook.org/en/index.html The Architecture of Open Source Applications] * [http://docs.python.org Python Documentation] * [https://developers.google.com/edu/python/ Google Introductory Python Notes] * [http://huffman.sourceforge.net/tao/tao-of-programming.html Tao of Programming] Other (possibly useful) materials: * [http://hackersdictionary.com/html/entry/larval-stage.html The Jargon File] * Chapters 7&8 of Modelling and Simulation, Birta and Arbez, Springer 2007 (eBook avail. from USF Library). * Chapters 4-6 of Models and Algorithms for Intelligent Data Analysis, Runkler, Springer 2012 (eBook avail. from USF Library). * Guide to Scientific Computing in C++, Francis and Whiteley, Springer, 2012. (eBook avail. from USF Library) * Extra info. On the basics: ** Chapters 3 and 7 of Mathematics in Computing, Regan, Springer 2013. (eBook avail. from USF Library) ** Instant feedback graphical programming with [https://www.khanacademy.org/cs/programming/ Khan Academy] * [http://www.meetup.com/python-178/ Local PyBulls Meetings] Code: * [http://carsonfarmer.com/2013/07/essential-python-geo-libraries Python Libraries Useful for Geospatial Problems] * [[Code#Python_Libraries|Python Libraries Useful for Computational Chemistry]] (very small list at present) Interactive Interpreters: * [http://www.codewars.com CodeWars] Recommended for building experience with practice problems. * [http://codecombat.com/ CodeCombat] A very visual way to interact with your python code. * [http://exercism.io Exercism] A command-line client with a similar learn-through-challenge philosophy. * [http://repl.it repl.it] A read-eval-print loop for several computer languages. * [http://en.cppreference.com/w/cpp/language CppReference] Documentation with an online evaluator for C++ code. === Notes === * [[Media:Intro.pdf|Introduction Notes]] * [[Media:Week2.pdf|Function Syntax]] and [[Media:Week3.pdf|For-Loop Syntax]] cheat-sheets. * [[Media:PlottingMaps.pdf|Plotting Maps]] <!-- ** [[Turing Exercise]] ** [https://predictivestatmech.org/code/example.dcd Example DCD File] * [[Media:Week-5.2017.pdf|Week 5 Notes]] * [[Media:PlottingMaps.pdf|Week 6 Notes]] ** [[Code:PyTesting]] * [[Media:NumpyArrays.pdf|Week 7 Notes]] ** [http://www.labri.fr/perso/nrougier/from-python-to-numpy/ all about numpy] * Misc. Notes for Week 8 ** [[Physics:Pairs|Rundown of Pair Interactions]] ** Parameterized surfaces [[Media:param1.jpg|1]] and [[Media:param2.jpg|2]] * Notes for Compilation Lab ** [https://learnpythonthehardway.org/book/appendixa.html Command Line Crash Course] Cheat sheet for bash commands. ** USF's compute cluster documentation at [https://wiki.rc.usf.edu/index.php/Main_Page RC Wiki]. *** See especially the "Connecting to SC" and "Modules" sections ** [[Code:Compiling|Cheat-codes]] for compilation lab. * [[Media:jobs.pdf|Research Computing Batch Queue]] * [[Media:Plug-in.pdf|Plugging Into Libraries]] * [[Media:Matrix.pdf|Matrix Algorithms]] --> * Midterm Projects: <!-- ** Luis & Matteo [https://drive.google.com/file/d/1tTkwRuJts2SnZcEkVlHO51ItacFfHYL3/view?usp=sharing_eil&ts=5a9d6cb2] ** Misty & Cherinee [https://docs.google.com/presentation/d/17UTtjv-2d19mTtYt9oVwrWI5eOuo7l2qg4zYsOGXTxw/edit?ts=5a9d7601#slide=id.gc6f90357f_0_0] ** Pauline [http://predictivestatmech.org/code/pauline.py] ** Nasha [http://predictivestatmech.org/code/nasha.py] ** Daniel [https://drive.google.com/drive/folders/1NNQEG7O8Pi1jGeMaPwcWYEBVI62BhYgD?usp=sharing] --> ** Melissa, Casidy & Paul [https://docs.google.com/presentation/d/10U8loA8uPMypoEWO163e6smZ9JnrPXjyQl97Duz8Hg8/edit?usp=sharing_eip&ts=5a9d6081] ** Shiumoy [http://predictivestatmech.org/code/shiumoy.pptx] ** Kimberly [http://predictivestatmech.org/code/kimberly.py] ** Eric ** Jovina & Jesunifemi [http://predictivestatmech.org/code/jovina-nifemi.py] ** Jakin [https://docs.google.com/presentation/d/1LFh-_n6J2jC6FBEl-X4WTJqYyhwjnVucGdMBKsUFsjU/edit?usp=sharing_eip&ts=5a9d8fa1] ** Bryan [http://predictivestatmech.org/code/bryan.py] === In-Class Problems === * Week 1: [[Media:CalculatorProbs.pdf|Calculator Problems]] ** Solutions: [http://predictivestatmech.org/terms/term.html] ** This solution uses python list comprehensions, and shows that the slowest step is actually unit conversion! * Week 2: [[Media:Pseudocode.pdf|Pseudocode Problems]] ** We will work these in class. For practice, be sure you have python list ideas down! ** Solutions: [https://docs.google.com/document/d/1HRkSdVNsTUydY4cVx67jRHRyhi5gL6nneEj9IX89wlE/edit?usp=sharing] * Week 3: [[Media:Plotting1.pdf|Plotting 1]] ** [https://stackoverflow.com/questions/11815538/how-to-import-matplotlib-in-python#11830055 Notes on installing Matplotlib on your own computer] ** Challenge: actions vs. functions -- what does the following code do: "[ print(1) for i in range(10) ]" (python3 only) * Week 4: [[Media:Plotting2.pdf|Plotting 2]] ** Solutions: [https://docs.google.com/document/d/1AanEFQmxLxoNM-662MHxsxToY3wsqovNx6SwcPQuBIg/edit?usp=sharing] * Week 5: Read pseudocode and plotting, focusing on types and syntax. Also, re-read the end of chapter summaries for Ch. 3, 5 and 6. * Week 6: Read the following pieces on first order logic [http://bayes.wustl.edu/etj/prob/book.pdf Chapter 1 of Jaynes' Book] [http://web.cecs.pdx.edu/~cs410aph/Lectures/Smalltalk%20II/Dijkstra%20on%20Hamming%27s%20Problem.pdf Hamming's Problem], and pages 71-80 in Chapter 4 of Hetland's Algorithms book (on induction). Just skip directly to chapter 4. ** Solutions [https://docs.google.com/document/d/14QZxh2SAWl3JE-SzVyemkAv4p9TBChO-jzZ5YpT8BZs/edit?usp=sharing] * Week 7: Review Hetland, Chapters 3-7. We'll do a series of parsing problems and flex our collective induction and recursion muscles. ** [https://docs.google.com/document/d/1i04oL7zJsD3KzvsPIaHBgwaOZ78UZvz5ReRDF-PlyF0/edit?usp=sharing Week 7 Problems] * Week 8: [[Media:Minimization1.pdf|Minimization Problems!]] === Review Notes on Sequences, list comprehensions and arrays === <source lang="python"> # Say you want to make a plot of the LJ function on the domain x \in [0.9, 3] # 1. You could use the following two list comprehensions to be specific: x = [ i*(3-0.9)/100.0 + 0.9 for i in range(101) ] y = [ 4*(xi**-12 - xi**-6) for xi in x] # 2. You could implement the LJ function as a python function and use MAP, def LJ(x): ix6 = x**-6 # the factoring makes this calculation more efficient return 4*ix6*(ix6 + 1.0) y = map(LJ, x) # 3. You could work on arrays, where addition, multiplication, and powers are elementwise: ax = arange(101)*(3-0.9)/100 + 0.9 ay = LJ(ax) # Mind the difference in type! type(x) type(ax) # 4. You could totally cheat, and use numpy's builtin functions. ax = linspace(0.9, 3.0, 101) # Exercise: replicate the steps above to test the finite difference computation # of the derivative against the analytical derivative of LJ. [ (y[i+1]-y[i])/(x[i+1]-x[i]) for i in ... import matplotlib.pyplot as plt plt.plot(x, y) plt.show() </source> === Review Notes on Functions with Function arguments (functionals) === <source lang="python"> # map : (a -> b), [ a ] -> [ b ] # map: map(str, [1,2,3]) --> [ "1", "2", "3" ] # ^ function (a -> b) # map(int, map(str, [1,2,3]) ) # - helpful for parsing # x = "1 2 3 4 5" # x.split() # ["1", "2", "3", "4", "5"] # map(int, x.split()) # [1,2,3,4,5] str([1,2,3]) # "[1, 2, 3]" (bad) map(str, [1,2,3]) # ["1", "2", "3"] (good) # filter: (a -> Bool), [a] -> [a] # Example filter: # '1' -> no # ' ' -> no # 'a-z' -> yes # 'A-Z' -> yes def f(x): # str -> Bool if x >= 'a' and x <= 'z': return True if x >= 'A' and x <= 'Z': return True return False filter(f, " 1 a b 2 \n") # reduce: (a,b -> a), [b], a -> a sum([1,2,3]) # -> 6 def add2(x,y): # x : int, y : int return x+y reduce(add2, [1,2,3], 0) # For an example where a != b: def append(x,y): # x : [int], y : int return x + [y] reduce(append, [1,2,3], []) # start with an empty list # Newton-Rhapson def nrhap(f, fp, x0, tol = 1e-6): y = f(x0) iter = 0 # guard against infinity while abs(y) > tol: iter += 1 if iter > 1000: raise ValueError, "Unable to converge!" x0 -= y/fp(x0) y = f(x0) return x0 # solve x^3 - 2 = 0 def f(x): return x**3 - 2 def fp(x): return 3*x**2 print( nrhap(f, fp, 1.0)**3 ) </source> === Homework === * Homework will be assigned through Repl.IT * Project presentations will be on Mon.-Wed., Mar 5-7 * Final Project presentations will be during exam time, Wed., May 2 8a50502802ae1c808b8440098644446b5b8f21db 648 647 2018-03-07T20:39:37Z David M. Rogers 2 wikitext text/x-wiki '''<BIG>Introduction to Scientific Computing</BIG>''' Course Info * Course Numbers CHM 4932-004/6938-010, CRN: 20438/20439 * Credit Hours: 3 * Meeting Dates: January 8 - April 25, 2018 ** No Class Jan. 15 or Mar. 12-18 * Meeting Times: Mon. and Wed., 12:30-13:45 in SCA 222 ** Midterm Project Presentations: Mon.-Wed., Mar 5 and 7. ** Final Project Presentations: Wed., May 2, 10:00am – 12:00pm (scheduled final date) ** Lab Session & Office Hours: Fri. 12:30-13:45 in IDR 214 (or SCA 222 by announcement) <pre> $ for((i=1;i<=4;i++)); do cal $i 2018; done ____ January 2018 ____ _____ March 2018 ____ | Su Mo Tu We Th Fr Sa | | Su Mo Tu We Th Fr Sa | 1 2 3 4 5 6 | | 1 (2) 3 1 | 7 8 9*10 11 12 13 | 9 | 4 (5) 6 (7) 8 9 10 2 | 14 x 16*17 18 19 20 | | x x 3 | 21*22 23 24 25 26 27 | 10 | 18*19 20 21 22 23 24 4 | 28*29 30 31 | 11 | 25*26 27 28 29 30 31 ___ February 2018 ____ _____ April 2018 ____ | Su Mo Tu We Th Fr Sa | | Su Mo Tu We Th Fr Sa | 1 2 3 | 12 | 1 *2 3 4 5 6 7 5 | 4 *5 6 7 8 9 10 | 13 | 8 *9 10 11 12 13 14 6 | 11*12 13 14 15 16 17 | 14 | 15*16 17 18 19 20 21 7 | 18*19 20 21 22 23 24 | 15 | 22*23 24(25)26 27 28 8 | 25*26 27 28 | | 29 x Week Topic 1 Calculator Form 2 Pseudocode 3 Plotting 1 (Excel) 4 Plotting 2 (Matplotlib and linear spaces) 5 Abstraction 1 (advanced functions and oo method) 6 Abstraction 2 (Booleans and logic) 7 2D transforms and iterated maps 8 Optimization 1 (Newton-Rhapson) 9 midterm project presentations 10 Optimization 2 (MD Energy) 11 ODE and SDE algorithms 12 Statistics 13 Complexity 14 Circe and Linux crash course 15 Compile & install process, ctypes </pre> == Overview == Mathematical models in the natural sciences take many shapes and forms. The moment they become more complicated than tracking a few variables over time, we have to put away our Excel spreadsheets and make use of a solid foundation in computational science. The course establishes this foundation by introducing data structures and algorithms used in everyday scientific computing using examples in the python scripting language. By the end of the Semester, students will be able to navigate the Linux command-line to go from a mathematical model to a numerical solution. Best practices for working with computer code and visualizing data will also be covered. == Topics == # Languages #* bash (shell) #* python (scripting) #* stack & register-based machine languages: overview of C and Fortran syntax & compiling with gcc, ‘thread safety’ #* Shared libraries & language inter-operability (FFI) # Algorithms #* Horner’s algorithm for polynomials #* Newton’s root finding algo. #* Overview of general optimization algo-s (example: linear & nonlin. least-squares) #* Numerical integration (scripted, plus gnu ODE) #* Communication (how HTTP get/put works) # Data Structures #* Linked Lists #* Trees (file system hierarchies) #* Graphs #* Arrays (dense & sparse) example: vectors & rotations / transpositions, densities and difference operators # Presentation & visualization #* Flat CSV files (and excel) #* Working with binary data #* Python matplotlib (2D images) #* Binning histograms & weighted averages # Best Practices #* High-level code design (modularity, interface specifications, unit testing, etc.) #* Code audit: open-source libraries, ex. Gnu Scientific Library, qsort in libc, Boost #* Source code versioning (example: git or mercurial) #* gdb & execution profiling #* documentation #* Makefiles == Grading == '''Grading Scale (out of 400 points possible)''' {| class="wikitable" |- ! Grade ! Undergraduate ! Graduate |- | A+ | 269 | 323 |- | A | 258 | 310 |- | A- | 250 | 300 |- | B+ | 241 | 290 |- | B | 230 | 276 |- | B- | 222 | 266 |- | C+ | 213 | 256 |- | C | 202 | 243 |- | C- | 194 | 233 |- | D+ | 186 | 223 |- | D | 175 | 210 |- | D- | 166 | 200 |} * (280 U / 330 G) Points Possible: ** 9 homework assignments (10 points per homework) ** 14 in-class assignments / quizzes (10 points per week) ** 2 projects / competitions (50 points per project) ** Undergraduates must complete 1 project, graduates must complete 2 * Important Rules ** For maximum benefit, homework should be done on-time. However, homework will be allowed to be re-submitted at any time for full credit, but must present a unique solution to previous work from yourself or others. ** All work must cite co-group members (if any) and the source of any code snippets used online. === Grading Rationale === Homework points will only be awarded for correct, working code and correct algorithmic analysis, while the homework problems will become progressively tougher. Undergraduates should be able to pass the course with an A if they have correctly answered most of the homework, appear at class prepared and on-time, and made a strong attempt at one of the projects. Graduate students should both perform well on the homework and successfully complete one or two projects. The re-grading for homework allows making up for missed assignments, and encourages returning to core concepts at a later point in the class. Students who have put in the studying effort, completed significant portions of the homework and projects both in- and out of class have thus demonstrated introductory programming proficiency. == Projects == * Midterm Project Description [[Media:Midterm2018.pdf]] (2 Mar., 2018) ** [[Agile|Agile Development Tips & Tricks]] * Midterm Projects: <!-- ** Luis & Matteo [https://drive.google.com/file/d/1tTkwRuJts2SnZcEkVlHO51ItacFfHYL3/view?usp=sharing_eil&ts=5a9d6cb2] ** Misty & Cherinee [https://docs.google.com/presentation/d/17UTtjv-2d19mTtYt9oVwrWI5eOuo7l2qg4zYsOGXTxw/edit?ts=5a9d7601#slide=id.gc6f90357f_0_0] ** Pauline [http://predictivestatmech.org/code/pauline.py] ** Nasha [http://predictivestatmech.org/code/nasha.py] ** Daniel [https://drive.google.com/drive/folders/1NNQEG7O8Pi1jGeMaPwcWYEBVI62BhYgD?usp=sharing] ** Melissa, Casidy & Paul [https://docs.google.com/presentation/d/10U8loA8uPMypoEWO163e6smZ9JnrPXjyQl97Duz8Hg8/edit?usp=sharing_eip&ts=5a9d6081] ** Kimberly [http://predictivestatmech.org/code/kimberly.py] ** Eric ** Jovina & Jesunifemi [http://predictivestatmech.org/code/jovina-nifemi.py] ** Jakin [https://docs.google.com/presentation/d/1LFh-_n6J2jC6FBEl-X4WTJqYyhwjnVucGdMBKsUFsjU/edit?usp=sharing_eip&ts=5a9d8fa1] ** Bryan [http://predictivestatmech.org/code/bryan.py] --> <!--* Final Project Description [[Media:Final2018.pdf]] (25 Apr., 2018)--> == Textbooks and Resources == * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-0072-7 Beginning Python, Hetland, 2005] (eBook avail. from USF Library) * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-3238-4 Python Algorithms, Hetland, 2010] (eBook avail. from USF Library) * [http://aosabook.org/en/index.html The Architecture of Open Source Applications] * [http://docs.python.org Python Documentation] * [https://developers.google.com/edu/python/ Google Introductory Python Notes] * [http://huffman.sourceforge.net/tao/tao-of-programming.html Tao of Programming] Other (possibly useful) materials: * [http://hackersdictionary.com/html/entry/larval-stage.html The Jargon File] * Chapters 7&8 of Modelling and Simulation, Birta and Arbez, Springer 2007 (eBook avail. from USF Library). * Chapters 4-6 of Models and Algorithms for Intelligent Data Analysis, Runkler, Springer 2012 (eBook avail. from USF Library). * Guide to Scientific Computing in C++, Francis and Whiteley, Springer, 2012. (eBook avail. from USF Library) * Extra info. On the basics: ** Chapters 3 and 7 of Mathematics in Computing, Regan, Springer 2013. (eBook avail. from USF Library) ** Instant feedback graphical programming with [https://www.khanacademy.org/cs/programming/ Khan Academy] * [http://www.meetup.com/python-178/ Local PyBulls Meetings] Code: * [http://carsonfarmer.com/2013/07/essential-python-geo-libraries Python Libraries Useful for Geospatial Problems] * [[Code#Python_Libraries|Python Libraries Useful for Computational Chemistry]] (very small list at present) Interactive Interpreters: * [http://www.codewars.com CodeWars] Recommended for building experience with practice problems. * [http://codecombat.com/ CodeCombat] A very visual way to interact with your python code. * [http://exercism.io Exercism] A command-line client with a similar learn-through-challenge philosophy. * [http://repl.it repl.it] A read-eval-print loop for several computer languages. * [http://en.cppreference.com/w/cpp/language CppReference] Documentation with an online evaluator for C++ code. === Notes === * [[Media:Intro.pdf|Introduction Notes]] * [[Media:Week2.pdf|Function Syntax]] and [[Media:Week3.pdf|For-Loop Syntax]] cheat-sheets. * [[Media:PlottingMaps.pdf|Plotting Maps]] <!-- ** [[Turing Exercise]] ** [https://predictivestatmech.org/code/example.dcd Example DCD File] * [[Media:Week-5.2017.pdf|Week 5 Notes]] * [[Media:PlottingMaps.pdf|Week 6 Notes]] ** [[Code:PyTesting]] * [[Media:NumpyArrays.pdf|Week 7 Notes]] ** [http://www.labri.fr/perso/nrougier/from-python-to-numpy/ all about numpy] * Misc. Notes for Week 8 ** [[Physics:Pairs|Rundown of Pair Interactions]] ** Parameterized surfaces [[Media:param1.jpg|1]] and [[Media:param2.jpg|2]] * Notes for Compilation Lab ** [https://learnpythonthehardway.org/book/appendixa.html Command Line Crash Course] Cheat sheet for bash commands. ** USF's compute cluster documentation at [https://wiki.rc.usf.edu/index.php/Main_Page RC Wiki]. *** See especially the "Connecting to SC" and "Modules" sections ** [[Code:Compiling|Cheat-codes]] for compilation lab. * [[Media:jobs.pdf|Research Computing Batch Queue]] * [[Media:Plug-in.pdf|Plugging Into Libraries]] * [[Media:Matrix.pdf|Matrix Algorithms]] --> === Review Notes on Sequences, list comprehensions and arrays === <source lang="python"> # Say you want to make a plot of the LJ function on the domain x \in [0.9, 3] # 1. You could use the following two list comprehensions to be specific: x = [ i*(3-0.9)/100.0 + 0.9 for i in range(101) ] y = [ 4*(xi**-12 - xi**-6) for xi in x] # 2. You could implement the LJ function as a python function and use MAP, def LJ(x): ix6 = x**-6 # the factoring makes this calculation more efficient return 4*ix6*(ix6 + 1.0) y = map(LJ, x) # 3. You could work on arrays, where addition, multiplication, and powers are elementwise: ax = arange(101)*(3-0.9)/100 + 0.9 ay = LJ(ax) # Mind the difference in type! type(x) type(ax) # 4. You could totally cheat, and use numpy's builtin functions. ax = linspace(0.9, 3.0, 101) # Exercise: replicate the steps above to test the finite difference computation # of the derivative against the analytical derivative of LJ. [ (y[i+1]-y[i])/(x[i+1]-x[i]) for i in ... import matplotlib.pyplot as plt plt.plot(x, y) plt.show() </source> === Review Notes on Functions with Function arguments (functionals) === <source lang="python"> # map : (a -> b), [ a ] -> [ b ] # map: map(str, [1,2,3]) --> [ "1", "2", "3" ] # ^ function (a -> b) # map(int, map(str, [1,2,3]) ) # - helpful for parsing # x = "1 2 3 4 5" # x.split() # ["1", "2", "3", "4", "5"] # map(int, x.split()) # [1,2,3,4,5] str([1,2,3]) # "[1, 2, 3]" (bad) map(str, [1,2,3]) # ["1", "2", "3"] (good) # filter: (a -> Bool), [a] -> [a] # Example filter: # '1' -> no # ' ' -> no # 'a-z' -> yes # 'A-Z' -> yes def f(x): # str -> Bool if x >= 'a' and x <= 'z': return True if x >= 'A' and x <= 'Z': return True return False filter(f, " 1 a b 2 \n") # reduce: (a,b -> a), [b], a -> a sum([1,2,3]) # -> 6 def add2(x,y): # x : int, y : int return x+y reduce(add2, [1,2,3], 0) # For an example where a != b: def append(x,y): # x : [int], y : int return x + [y] reduce(append, [1,2,3], []) # start with an empty list # Newton-Rhapson def nrhap(f, fp, x0, tol = 1e-6): y = f(x0) iter = 0 # guard against infinity while abs(y) > tol: iter += 1 if iter > 1000: raise ValueError, "Unable to converge!" x0 -= y/fp(x0) y = f(x0) return x0 # solve x^3 - 2 = 0 def f(x): return x**3 - 2 def fp(x): return 3*x**2 print( nrhap(f, fp, 1.0)**3 ) </source> === In-Class Problems === * Week 1: [[Media:CalculatorProbs.pdf|Calculator Problems]] ** Solutions: [http://predictivestatmech.org/terms/term.html] ** This solution uses python list comprehensions, and shows that the slowest step is actually unit conversion! * Week 2: [[Media:Pseudocode.pdf|Pseudocode Problems]] ** We will work these in class. For practice, be sure you have python list ideas down! ** Solutions: [https://docs.google.com/document/d/1HRkSdVNsTUydY4cVx67jRHRyhi5gL6nneEj9IX89wlE/edit?usp=sharing] * Week 3: [[Media:Plotting1.pdf|Plotting 1]] ** [https://stackoverflow.com/questions/11815538/how-to-import-matplotlib-in-python#11830055 Notes on installing Matplotlib on your own computer] ** Challenge: actions vs. functions -- what does the following code do: "[ print(1) for i in range(10) ]" (python3 only) * Week 4: [[Media:Plotting2.pdf|Plotting 2]] ** Solutions: [https://docs.google.com/document/d/1AanEFQmxLxoNM-662MHxsxToY3wsqovNx6SwcPQuBIg/edit?usp=sharing] * Week 5: Read pseudocode and plotting, focusing on types and syntax. Also, re-read the end of chapter summaries for Ch. 3, 5 and 6. * Week 6: Read the following pieces on first order logic [http://bayes.wustl.edu/etj/prob/book.pdf Chapter 1 of Jaynes' Book] [http://web.cecs.pdx.edu/~cs410aph/Lectures/Smalltalk%20II/Dijkstra%20on%20Hamming%27s%20Problem.pdf Hamming's Problem], and pages 71-80 in Chapter 4 of Hetland's Algorithms book (on induction). Just skip directly to chapter 4. ** Solutions [https://docs.google.com/document/d/14QZxh2SAWl3JE-SzVyemkAv4p9TBChO-jzZ5YpT8BZs/edit?usp=sharing] * Week 7: Review Hetland, Chapters 3-7. We'll do a series of parsing problems and flex our collective induction and recursion muscles. ** [https://docs.google.com/document/d/1i04oL7zJsD3KzvsPIaHBgwaOZ78UZvz5ReRDF-PlyF0/edit?usp=sharing Week 7 Problems] * Week 8: [[Media:Minimization1.pdf|Minimization Problems!]] === Homework === * Homework will be assigned through Repl.IT * Project presentations will be on Mon.-Wed., Mar 5-7 * Final Project presentations will be during exam time, Wed., May 2 cec09c4397507d226751e13ec52682b5f4b68b43 650 648 2018-03-18T18:30:21Z David M. Rogers 2 /* In-Class Problems */ wikitext text/x-wiki '''<BIG>Introduction to Scientific Computing</BIG>''' Course Info * Course Numbers CHM 4932-004/6938-010, CRN: 20438/20439 * Credit Hours: 3 * Meeting Dates: January 8 - April 25, 2018 ** No Class Jan. 15 or Mar. 12-18 * Meeting Times: Mon. and Wed., 12:30-13:45 in SCA 222 ** Midterm Project Presentations: Mon.-Wed., Mar 5 and 7. ** Final Project Presentations: Wed., May 2, 10:00am – 12:00pm (scheduled final date) ** Lab Session & Office Hours: Fri. 12:30-13:45 in IDR 214 (or SCA 222 by announcement) <pre> $ for((i=1;i<=4;i++)); do cal $i 2018; done ____ January 2018 ____ _____ March 2018 ____ | Su Mo Tu We Th Fr Sa | | Su Mo Tu We Th Fr Sa | 1 2 3 4 5 6 | | 1 (2) 3 1 | 7 8 9*10 11 12 13 | 9 | 4 (5) 6 (7) 8 9 10 2 | 14 x 16*17 18 19 20 | | x x 3 | 21*22 23 24 25 26 27 | 10 | 18*19 20 21 22 23 24 4 | 28*29 30 31 | 11 | 25*26 27 28 29 30 31 ___ February 2018 ____ _____ April 2018 ____ | Su Mo Tu We Th Fr Sa | | Su Mo Tu We Th Fr Sa | 1 2 3 | 12 | 1 *2 3 4 5 6 7 5 | 4 *5 6 7 8 9 10 | 13 | 8 *9 10 11 12 13 14 6 | 11*12 13 14 15 16 17 | 14 | 15*16 17 18 19 20 21 7 | 18*19 20 21 22 23 24 | 15 | 22*23 24(25)26 27 28 8 | 25*26 27 28 | | 29 x Week Topic 1 Calculator Form 2 Pseudocode 3 Plotting 1 (Excel) 4 Plotting 2 (Matplotlib and linear spaces) 5 Abstraction 1 (advanced functions and oo method) 6 Abstraction 2 (Booleans and logic) 7 2D transforms and iterated maps 8 Optimization 1 (Newton-Rhapson) 9 midterm project presentations 10 Optimization 2 (MD Energy) 11 ODE and SDE algorithms 12 Statistics 13 Complexity 14 Circe and Linux crash course 15 Compile & install process, ctypes </pre> == Overview == Mathematical models in the natural sciences take many shapes and forms. The moment they become more complicated than tracking a few variables over time, we have to put away our Excel spreadsheets and make use of a solid foundation in computational science. The course establishes this foundation by introducing data structures and algorithms used in everyday scientific computing using examples in the python scripting language. By the end of the Semester, students will be able to navigate the Linux command-line to go from a mathematical model to a numerical solution. Best practices for working with computer code and visualizing data will also be covered. == Topics == # Languages #* bash (shell) #* python (scripting) #* stack & register-based machine languages: overview of C and Fortran syntax & compiling with gcc, ‘thread safety’ #* Shared libraries & language inter-operability (FFI) # Algorithms #* Horner’s algorithm for polynomials #* Newton’s root finding algo. #* Overview of general optimization algo-s (example: linear & nonlin. least-squares) #* Numerical integration (scripted, plus gnu ODE) #* Communication (how HTTP get/put works) # Data Structures #* Linked Lists #* Trees (file system hierarchies) #* Graphs #* Arrays (dense & sparse) example: vectors & rotations / transpositions, densities and difference operators # Presentation & visualization #* Flat CSV files (and excel) #* Working with binary data #* Python matplotlib (2D images) #* Binning histograms & weighted averages # Best Practices #* High-level code design (modularity, interface specifications, unit testing, etc.) #* Code audit: open-source libraries, ex. Gnu Scientific Library, qsort in libc, Boost #* Source code versioning (example: git or mercurial) #* gdb & execution profiling #* documentation #* Makefiles == Grading == '''Grading Scale (out of 400 points possible)''' {| class="wikitable" |- ! Grade ! Undergraduate ! Graduate |- | A+ | 269 | 323 |- | A | 258 | 310 |- | A- | 250 | 300 |- | B+ | 241 | 290 |- | B | 230 | 276 |- | B- | 222 | 266 |- | C+ | 213 | 256 |- | C | 202 | 243 |- | C- | 194 | 233 |- | D+ | 186 | 223 |- | D | 175 | 210 |- | D- | 166 | 200 |} * (280 U / 330 G) Points Possible: ** 9 homework assignments (10 points per homework) ** 14 in-class assignments / quizzes (10 points per week) ** 2 projects / competitions (50 points per project) ** Undergraduates must complete 1 project, graduates must complete 2 * Important Rules ** For maximum benefit, homework should be done on-time. However, homework will be allowed to be re-submitted at any time for full credit, but must present a unique solution to previous work from yourself or others. ** All work must cite co-group members (if any) and the source of any code snippets used online. === Grading Rationale === Homework points will only be awarded for correct, working code and correct algorithmic analysis, while the homework problems will become progressively tougher. Undergraduates should be able to pass the course with an A if they have correctly answered most of the homework, appear at class prepared and on-time, and made a strong attempt at one of the projects. Graduate students should both perform well on the homework and successfully complete one or two projects. The re-grading for homework allows making up for missed assignments, and encourages returning to core concepts at a later point in the class. Students who have put in the studying effort, completed significant portions of the homework and projects both in- and out of class have thus demonstrated introductory programming proficiency. == Projects == * Midterm Project Description [[Media:Midterm2018.pdf]] (2 Mar., 2018) ** [[Agile|Agile Development Tips & Tricks]] * Midterm Projects: <!-- ** Luis & Matteo [https://drive.google.com/file/d/1tTkwRuJts2SnZcEkVlHO51ItacFfHYL3/view?usp=sharing_eil&ts=5a9d6cb2] ** Misty & Cherinee [https://docs.google.com/presentation/d/17UTtjv-2d19mTtYt9oVwrWI5eOuo7l2qg4zYsOGXTxw/edit?ts=5a9d7601#slide=id.gc6f90357f_0_0] ** Pauline [http://predictivestatmech.org/code/pauline.py] ** Nasha [http://predictivestatmech.org/code/nasha.py] ** Daniel [https://drive.google.com/drive/folders/1NNQEG7O8Pi1jGeMaPwcWYEBVI62BhYgD?usp=sharing] ** Melissa, Casidy & Paul [https://docs.google.com/presentation/d/10U8loA8uPMypoEWO163e6smZ9JnrPXjyQl97Duz8Hg8/edit?usp=sharing_eip&ts=5a9d6081] ** Kimberly [http://predictivestatmech.org/code/kimberly.py] ** Eric ** Jovina & Jesunifemi [http://predictivestatmech.org/code/jovina-nifemi.py] ** Jakin [https://docs.google.com/presentation/d/1LFh-_n6J2jC6FBEl-X4WTJqYyhwjnVucGdMBKsUFsjU/edit?usp=sharing_eip&ts=5a9d8fa1] ** Bryan [http://predictivestatmech.org/code/bryan.py] --> <!--* Final Project Description [[Media:Final2018.pdf]] (25 Apr., 2018)--> == Textbooks and Resources == * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-0072-7 Beginning Python, Hetland, 2005] (eBook avail. from USF Library) * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-3238-4 Python Algorithms, Hetland, 2010] (eBook avail. from USF Library) * [http://aosabook.org/en/index.html The Architecture of Open Source Applications] * [http://docs.python.org Python Documentation] * [https://developers.google.com/edu/python/ Google Introductory Python Notes] * [http://huffman.sourceforge.net/tao/tao-of-programming.html Tao of Programming] Other (possibly useful) materials: * [http://hackersdictionary.com/html/entry/larval-stage.html The Jargon File] * Chapters 7&8 of Modelling and Simulation, Birta and Arbez, Springer 2007 (eBook avail. from USF Library). * Chapters 4-6 of Models and Algorithms for Intelligent Data Analysis, Runkler, Springer 2012 (eBook avail. from USF Library). * Guide to Scientific Computing in C++, Francis and Whiteley, Springer, 2012. (eBook avail. from USF Library) * Extra info. On the basics: ** Chapters 3 and 7 of Mathematics in Computing, Regan, Springer 2013. (eBook avail. from USF Library) ** Instant feedback graphical programming with [https://www.khanacademy.org/cs/programming/ Khan Academy] * [http://www.meetup.com/python-178/ Local PyBulls Meetings] Code: * [http://carsonfarmer.com/2013/07/essential-python-geo-libraries Python Libraries Useful for Geospatial Problems] * [[Code#Python_Libraries|Python Libraries Useful for Computational Chemistry]] (very small list at present) Interactive Interpreters: * [http://www.codewars.com CodeWars] Recommended for building experience with practice problems. * [http://codecombat.com/ CodeCombat] A very visual way to interact with your python code. * [http://exercism.io Exercism] A command-line client with a similar learn-through-challenge philosophy. * [http://repl.it repl.it] A read-eval-print loop for several computer languages. * [http://en.cppreference.com/w/cpp/language CppReference] Documentation with an online evaluator for C++ code. === Notes === * [[Media:Intro.pdf|Introduction Notes]] * [[Media:Week2.pdf|Function Syntax]] and [[Media:Week3.pdf|For-Loop Syntax]] cheat-sheets. * [[Media:PlottingMaps.pdf|Plotting Maps]] <!-- ** [[Turing Exercise]] ** [https://predictivestatmech.org/code/example.dcd Example DCD File] * [[Media:Week-5.2017.pdf|Week 5 Notes]] * [[Media:PlottingMaps.pdf|Week 6 Notes]] ** [[Code:PyTesting]] * [[Media:NumpyArrays.pdf|Week 7 Notes]] ** [http://www.labri.fr/perso/nrougier/from-python-to-numpy/ all about numpy] * Misc. Notes for Week 8 ** [[Physics:Pairs|Rundown of Pair Interactions]] ** Parameterized surfaces [[Media:param1.jpg|1]] and [[Media:param2.jpg|2]] * Notes for Compilation Lab ** [https://learnpythonthehardway.org/book/appendixa.html Command Line Crash Course] Cheat sheet for bash commands. ** USF's compute cluster documentation at [https://wiki.rc.usf.edu/index.php/Main_Page RC Wiki]. *** See especially the "Connecting to SC" and "Modules" sections ** [[Code:Compiling|Cheat-codes]] for compilation lab. * [[Media:jobs.pdf|Research Computing Batch Queue]] * [[Media:Plug-in.pdf|Plugging Into Libraries]] * [[Media:Matrix.pdf|Matrix Algorithms]] --> === Review Notes on Sequences, list comprehensions and arrays === <source lang="python"> # Say you want to make a plot of the LJ function on the domain x \in [0.9, 3] # 1. You could use the following two list comprehensions to be specific: x = [ i*(3-0.9)/100.0 + 0.9 for i in range(101) ] y = [ 4*(xi**-12 - xi**-6) for xi in x] # 2. You could implement the LJ function as a python function and use MAP, def LJ(x): ix6 = x**-6 # the factoring makes this calculation more efficient return 4*ix6*(ix6 + 1.0) y = map(LJ, x) # 3. You could work on arrays, where addition, multiplication, and powers are elementwise: ax = arange(101)*(3-0.9)/100 + 0.9 ay = LJ(ax) # Mind the difference in type! type(x) type(ax) # 4. You could totally cheat, and use numpy's builtin functions. ax = linspace(0.9, 3.0, 101) # Exercise: replicate the steps above to test the finite difference computation # of the derivative against the analytical derivative of LJ. [ (y[i+1]-y[i])/(x[i+1]-x[i]) for i in ... import matplotlib.pyplot as plt plt.plot(x, y) plt.show() </source> === Review Notes on Functions with Function arguments (functionals) === <source lang="python"> # map : (a -> b), [ a ] -> [ b ] # map: map(str, [1,2,3]) --> [ "1", "2", "3" ] # ^ function (a -> b) # map(int, map(str, [1,2,3]) ) # - helpful for parsing # x = "1 2 3 4 5" # x.split() # ["1", "2", "3", "4", "5"] # map(int, x.split()) # [1,2,3,4,5] str([1,2,3]) # "[1, 2, 3]" (bad) map(str, [1,2,3]) # ["1", "2", "3"] (good) # filter: (a -> Bool), [a] -> [a] # Example filter: # '1' -> no # ' ' -> no # 'a-z' -> yes # 'A-Z' -> yes def f(x): # str -> Bool if x >= 'a' and x <= 'z': return True if x >= 'A' and x <= 'Z': return True return False filter(f, " 1 a b 2 \n") # reduce: (a,b -> a), [b], a -> a sum([1,2,3]) # -> 6 def add2(x,y): # x : int, y : int return x+y reduce(add2, [1,2,3], 0) # For an example where a != b: def append(x,y): # x : [int], y : int return x + [y] reduce(append, [1,2,3], []) # start with an empty list # Newton-Rhapson def nrhap(f, fp, x0, tol = 1e-6): y = f(x0) iter = 0 # guard against infinity while abs(y) > tol: iter += 1 if iter > 1000: raise ValueError, "Unable to converge!" x0 -= y/fp(x0) y = f(x0) return x0 # solve x^3 - 2 = 0 def f(x): return x**3 - 2 def fp(x): return 3*x**2 print( nrhap(f, fp, 1.0)**3 ) </source> === In-Class Problems === * Week 1: [[Media:CalculatorProbs.pdf|Calculator Problems]] ** Solutions: [http://predictivestatmech.org/terms/term.html] ** This solution uses python list comprehensions, and shows that the slowest step is actually unit conversion! * Week 2: [[Media:Pseudocode.pdf|Pseudocode Problems]] ** We will work these in class. For practice, be sure you have python list ideas down! ** Solutions: [https://docs.google.com/document/d/1HRkSdVNsTUydY4cVx67jRHRyhi5gL6nneEj9IX89wlE/edit?usp=sharing] * Week 3: [[Media:Plotting1.pdf|Plotting 1]] ** [https://stackoverflow.com/questions/11815538/how-to-import-matplotlib-in-python#11830055 Notes on installing Matplotlib on your own computer] ** Challenge: actions vs. functions -- what does the following code do: "[ print(1) for i in range(10) ]" (python3 only) * Week 4: [[Media:Plotting2.pdf|Plotting 2]] ** Solutions: [https://docs.google.com/document/d/1AanEFQmxLxoNM-662MHxsxToY3wsqovNx6SwcPQuBIg/edit?usp=sharing] * Week 5: Read pseudocode and plotting, focusing on types and syntax. Also, re-read the end of chapter summaries for Ch. 3, 5 and 6. * Week 6: Read the following pieces on first order logic [http://bayes.wustl.edu/etj/prob/book.pdf Chapter 1 of Jaynes' Book] [http://web.cecs.pdx.edu/~cs410aph/Lectures/Smalltalk%20II/Dijkstra%20on%20Hamming%27s%20Problem.pdf Hamming's Problem], and pages 71-80 in Chapter 4 of Hetland's Algorithms book (on induction). Just skip directly to chapter 4. ** Solutions [https://docs.google.com/document/d/14QZxh2SAWl3JE-SzVyemkAv4p9TBChO-jzZ5YpT8BZs/edit?usp=sharing] * Week 7: Review Hetland, Chapters 3-7. We'll do a series of parsing problems and flex our collective induction and recursion muscles. ** [https://docs.google.com/document/d/1i04oL7zJsD3KzvsPIaHBgwaOZ78UZvz5ReRDF-PlyF0/edit?usp=sharing Week 7 Problems] * Week 8: [[Media:Minimization1.pdf|Minimization Problems!]] * Week 10: [[Media:Minimization2.pdf|Molecular Optimization]] === Homework === * Homework will be assigned through Repl.IT * Project presentations will be on Mon.-Wed., Mar 5-7 * Final Project presentations will be during exam time, Wed., May 2 620d92340b33622a4c1549d62e813afa871c537c 653 650 2018-03-25T22:10:19Z David M. Rogers 2 /* In-Class Problems */ wikitext text/x-wiki '''<BIG>Introduction to Scientific Computing</BIG>''' Course Info * Course Numbers CHM 4932-004/6938-010, CRN: 20438/20439 * Credit Hours: 3 * Meeting Dates: January 8 - April 25, 2018 ** No Class Jan. 15 or Mar. 12-18 * Meeting Times: Mon. and Wed., 12:30-13:45 in SCA 222 ** Midterm Project Presentations: Mon.-Wed., Mar 5 and 7. ** Final Project Presentations: Wed., May 2, 10:00am – 12:00pm (scheduled final date) ** Lab Session & Office Hours: Fri. 12:30-13:45 in IDR 214 (or SCA 222 by announcement) <pre> $ for((i=1;i<=4;i++)); do cal $i 2018; done ____ January 2018 ____ _____ March 2018 ____ | Su Mo Tu We Th Fr Sa | | Su Mo Tu We Th Fr Sa | 1 2 3 4 5 6 | | 1 (2) 3 1 | 7 8 9*10 11 12 13 | 9 | 4 (5) 6 (7) 8 9 10 2 | 14 x 16*17 18 19 20 | | x x 3 | 21*22 23 24 25 26 27 | 10 | 18*19 20 21 22 23 24 4 | 28*29 30 31 | 11 | 25*26 27 28 29 30 31 ___ February 2018 ____ _____ April 2018 ____ | Su Mo Tu We Th Fr Sa | | Su Mo Tu We Th Fr Sa | 1 2 3 | 12 | 1 *2 3 4 5 6 7 5 | 4 *5 6 7 8 9 10 | 13 | 8 *9 10 11 12 13 14 6 | 11*12 13 14 15 16 17 | 14 | 15*16 17 18 19 20 21 7 | 18*19 20 21 22 23 24 | 15 | 22*23 24(25)26 27 28 8 | 25*26 27 28 | | 29 x Week Topic 1 Calculator Form 2 Pseudocode 3 Plotting 1 (Excel) 4 Plotting 2 (Matplotlib and linear spaces) 5 Abstraction 1 (advanced functions and oo method) 6 Abstraction 2 (Booleans and logic) 7 2D transforms and iterated maps 8 Optimization 1 (Newton-Rhapson) 9 midterm project presentations 10 Optimization 2 (MD Energy) 11 ODE and SDE algorithms 12 Statistics 13 Complexity 14 Circe and Linux crash course 15 Compile & install process, ctypes </pre> == Overview == Mathematical models in the natural sciences take many shapes and forms. The moment they become more complicated than tracking a few variables over time, we have to put away our Excel spreadsheets and make use of a solid foundation in computational science. The course establishes this foundation by introducing data structures and algorithms used in everyday scientific computing using examples in the python scripting language. By the end of the Semester, students will be able to navigate the Linux command-line to go from a mathematical model to a numerical solution. Best practices for working with computer code and visualizing data will also be covered. == Topics == # Languages #* bash (shell) #* python (scripting) #* stack & register-based machine languages: overview of C and Fortran syntax & compiling with gcc, ‘thread safety’ #* Shared libraries & language inter-operability (FFI) # Algorithms #* Horner’s algorithm for polynomials #* Newton’s root finding algo. #* Overview of general optimization algo-s (example: linear & nonlin. least-squares) #* Numerical integration (scripted, plus gnu ODE) #* Communication (how HTTP get/put works) # Data Structures #* Linked Lists #* Trees (file system hierarchies) #* Graphs #* Arrays (dense & sparse) example: vectors & rotations / transpositions, densities and difference operators # Presentation & visualization #* Flat CSV files (and excel) #* Working with binary data #* Python matplotlib (2D images) #* Binning histograms & weighted averages # Best Practices #* High-level code design (modularity, interface specifications, unit testing, etc.) #* Code audit: open-source libraries, ex. Gnu Scientific Library, qsort in libc, Boost #* Source code versioning (example: git or mercurial) #* gdb & execution profiling #* documentation #* Makefiles == Grading == '''Grading Scale (out of 400 points possible)''' {| class="wikitable" |- ! Grade ! Undergraduate ! Graduate |- | A+ | 269 | 323 |- | A | 258 | 310 |- | A- | 250 | 300 |- | B+ | 241 | 290 |- | B | 230 | 276 |- | B- | 222 | 266 |- | C+ | 213 | 256 |- | C | 202 | 243 |- | C- | 194 | 233 |- | D+ | 186 | 223 |- | D | 175 | 210 |- | D- | 166 | 200 |} * (280 U / 330 G) Points Possible: ** 9 homework assignments (10 points per homework) ** 14 in-class assignments / quizzes (10 points per week) ** 2 projects / competitions (50 points per project) ** Undergraduates must complete 1 project, graduates must complete 2 * Important Rules ** For maximum benefit, homework should be done on-time. However, homework will be allowed to be re-submitted at any time for full credit, but must present a unique solution to previous work from yourself or others. ** All work must cite co-group members (if any) and the source of any code snippets used online. === Grading Rationale === Homework points will only be awarded for correct, working code and correct algorithmic analysis, while the homework problems will become progressively tougher. Undergraduates should be able to pass the course with an A if they have correctly answered most of the homework, appear at class prepared and on-time, and made a strong attempt at one of the projects. Graduate students should both perform well on the homework and successfully complete one or two projects. The re-grading for homework allows making up for missed assignments, and encourages returning to core concepts at a later point in the class. Students who have put in the studying effort, completed significant portions of the homework and projects both in- and out of class have thus demonstrated introductory programming proficiency. == Projects == * Midterm Project Description [[Media:Midterm2018.pdf]] (2 Mar., 2018) ** [[Agile|Agile Development Tips & Tricks]] * Midterm Projects: <!-- ** Luis & Matteo [https://drive.google.com/file/d/1tTkwRuJts2SnZcEkVlHO51ItacFfHYL3/view?usp=sharing_eil&ts=5a9d6cb2] ** Misty & Cherinee [https://docs.google.com/presentation/d/17UTtjv-2d19mTtYt9oVwrWI5eOuo7l2qg4zYsOGXTxw/edit?ts=5a9d7601#slide=id.gc6f90357f_0_0] ** Pauline [http://predictivestatmech.org/code/pauline.py] ** Nasha [http://predictivestatmech.org/code/nasha.py] ** Daniel [https://drive.google.com/drive/folders/1NNQEG7O8Pi1jGeMaPwcWYEBVI62BhYgD?usp=sharing] ** Melissa, Casidy & Paul [https://docs.google.com/presentation/d/10U8loA8uPMypoEWO163e6smZ9JnrPXjyQl97Duz8Hg8/edit?usp=sharing_eip&ts=5a9d6081] ** Kimberly [http://predictivestatmech.org/code/kimberly.py] ** Eric ** Jovina & Jesunifemi [http://predictivestatmech.org/code/jovina-nifemi.py] ** Jakin [https://docs.google.com/presentation/d/1LFh-_n6J2jC6FBEl-X4WTJqYyhwjnVucGdMBKsUFsjU/edit?usp=sharing_eip&ts=5a9d8fa1] ** Bryan [http://predictivestatmech.org/code/bryan.py] --> <!--* Final Project Description [[Media:Final2018.pdf]] (25 Apr., 2018)--> == Textbooks and Resources == * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-0072-7 Beginning Python, Hetland, 2005] (eBook avail. from USF Library) * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-3238-4 Python Algorithms, Hetland, 2010] (eBook avail. from USF Library) * [http://aosabook.org/en/index.html The Architecture of Open Source Applications] * [http://docs.python.org Python Documentation] * [https://developers.google.com/edu/python/ Google Introductory Python Notes] * [http://huffman.sourceforge.net/tao/tao-of-programming.html Tao of Programming] Other (possibly useful) materials: * [http://hackersdictionary.com/html/entry/larval-stage.html The Jargon File] * Chapters 7&8 of Modelling and Simulation, Birta and Arbez, Springer 2007 (eBook avail. from USF Library). * Chapters 4-6 of Models and Algorithms for Intelligent Data Analysis, Runkler, Springer 2012 (eBook avail. from USF Library). * Guide to Scientific Computing in C++, Francis and Whiteley, Springer, 2012. (eBook avail. from USF Library) * Extra info. On the basics: ** Chapters 3 and 7 of Mathematics in Computing, Regan, Springer 2013. (eBook avail. from USF Library) ** Instant feedback graphical programming with [https://www.khanacademy.org/cs/programming/ Khan Academy] * [http://www.meetup.com/python-178/ Local PyBulls Meetings] Code: * [http://carsonfarmer.com/2013/07/essential-python-geo-libraries Python Libraries Useful for Geospatial Problems] * [[Code#Python_Libraries|Python Libraries Useful for Computational Chemistry]] (very small list at present) Interactive Interpreters: * [http://www.codewars.com CodeWars] Recommended for building experience with practice problems. * [http://codecombat.com/ CodeCombat] A very visual way to interact with your python code. * [http://exercism.io Exercism] A command-line client with a similar learn-through-challenge philosophy. * [http://repl.it repl.it] A read-eval-print loop for several computer languages. * [http://en.cppreference.com/w/cpp/language CppReference] Documentation with an online evaluator for C++ code. === Notes === * [[Media:Intro.pdf|Introduction Notes]] * [[Media:Week2.pdf|Function Syntax]] and [[Media:Week3.pdf|For-Loop Syntax]] cheat-sheets. * [[Media:PlottingMaps.pdf|Plotting Maps]] <!-- ** [[Turing Exercise]] ** [https://predictivestatmech.org/code/example.dcd Example DCD File] * [[Media:Week-5.2017.pdf|Week 5 Notes]] * [[Media:PlottingMaps.pdf|Week 6 Notes]] ** [[Code:PyTesting]] * [[Media:NumpyArrays.pdf|Week 7 Notes]] ** [http://www.labri.fr/perso/nrougier/from-python-to-numpy/ all about numpy] * Misc. Notes for Week 8 ** [[Physics:Pairs|Rundown of Pair Interactions]] ** Parameterized surfaces [[Media:param1.jpg|1]] and [[Media:param2.jpg|2]] * Notes for Compilation Lab ** [https://learnpythonthehardway.org/book/appendixa.html Command Line Crash Course] Cheat sheet for bash commands. ** USF's compute cluster documentation at [https://wiki.rc.usf.edu/index.php/Main_Page RC Wiki]. *** See especially the "Connecting to SC" and "Modules" sections ** [[Code:Compiling|Cheat-codes]] for compilation lab. * [[Media:jobs.pdf|Research Computing Batch Queue]] * [[Media:Plug-in.pdf|Plugging Into Libraries]] * [[Media:Matrix.pdf|Matrix Algorithms]] --> === Review Notes on Sequences, list comprehensions and arrays === <source lang="python"> # Say you want to make a plot of the LJ function on the domain x \in [0.9, 3] # 1. You could use the following two list comprehensions to be specific: x = [ i*(3-0.9)/100.0 + 0.9 for i in range(101) ] y = [ 4*(xi**-12 - xi**-6) for xi in x] # 2. You could implement the LJ function as a python function and use MAP, def LJ(x): ix6 = x**-6 # the factoring makes this calculation more efficient return 4*ix6*(ix6 + 1.0) y = map(LJ, x) # 3. You could work on arrays, where addition, multiplication, and powers are elementwise: ax = arange(101)*(3-0.9)/100 + 0.9 ay = LJ(ax) # Mind the difference in type! type(x) type(ax) # 4. You could totally cheat, and use numpy's builtin functions. ax = linspace(0.9, 3.0, 101) # Exercise: replicate the steps above to test the finite difference computation # of the derivative against the analytical derivative of LJ. [ (y[i+1]-y[i])/(x[i+1]-x[i]) for i in ... import matplotlib.pyplot as plt plt.plot(x, y) plt.show() </source> === Review Notes on Functions with Function arguments (functionals) === <source lang="python"> # map : (a -> b), [ a ] -> [ b ] # map: map(str, [1,2,3]) --> [ "1", "2", "3" ] # ^ function (a -> b) # map(int, map(str, [1,2,3]) ) # - helpful for parsing # x = "1 2 3 4 5" # x.split() # ["1", "2", "3", "4", "5"] # map(int, x.split()) # [1,2,3,4,5] str([1,2,3]) # "[1, 2, 3]" (bad) map(str, [1,2,3]) # ["1", "2", "3"] (good) # filter: (a -> Bool), [a] -> [a] # Example filter: # '1' -> no # ' ' -> no # 'a-z' -> yes # 'A-Z' -> yes def f(x): # str -> Bool if x >= 'a' and x <= 'z': return True if x >= 'A' and x <= 'Z': return True return False filter(f, " 1 a b 2 \n") # reduce: (a,b -> a), [b], a -> a sum([1,2,3]) # -> 6 def add2(x,y): # x : int, y : int return x+y reduce(add2, [1,2,3], 0) # For an example where a != b: def append(x,y): # x : [int], y : int return x + [y] reduce(append, [1,2,3], []) # start with an empty list # Newton-Rhapson def nrhap(f, fp, x0, tol = 1e-6): y = f(x0) iter = 0 # guard against infinity while abs(y) > tol: iter += 1 if iter > 1000: raise ValueError, "Unable to converge!" x0 -= y/fp(x0) y = f(x0) return x0 # solve x^3 - 2 = 0 def f(x): return x**3 - 2 def fp(x): return 3*x**2 print( nrhap(f, fp, 1.0)**3 ) </source> === In-Class Problems === * Week 1: [[Media:CalculatorProbs.pdf|Calculator Problems]] ** Solutions: [http://predictivestatmech.org/terms/term.html] ** This solution uses python list comprehensions, and shows that the slowest step is actually unit conversion! * Week 2: [[Media:Pseudocode.pdf|Pseudocode Problems]] ** We will work these in class. For practice, be sure you have python list ideas down! ** Solutions: [https://docs.google.com/document/d/1HRkSdVNsTUydY4cVx67jRHRyhi5gL6nneEj9IX89wlE/edit?usp=sharing] * Week 3: [[Media:Plotting1.pdf|Plotting 1]] ** [https://stackoverflow.com/questions/11815538/how-to-import-matplotlib-in-python#11830055 Notes on installing Matplotlib on your own computer] ** Challenge: actions vs. functions -- what does the following code do: "[ print(1) for i in range(10) ]" (python3 only) * Week 4: [[Media:Plotting2.pdf|Plotting 2]] ** Solutions: [https://docs.google.com/document/d/1AanEFQmxLxoNM-662MHxsxToY3wsqovNx6SwcPQuBIg/edit?usp=sharing] * Week 5: Read pseudocode and plotting, focusing on types and syntax. Also, re-read the end of chapter summaries for Ch. 3, 5 and 6. * Week 6: Read the following pieces on first order logic [http://bayes.wustl.edu/etj/prob/book.pdf Chapter 1 of Jaynes' Book] [http://web.cecs.pdx.edu/~cs410aph/Lectures/Smalltalk%20II/Dijkstra%20on%20Hamming%27s%20Problem.pdf Hamming's Problem], and pages 71-80 in Chapter 4 of Hetland's Algorithms book (on induction). Just skip directly to chapter 4. ** Solutions [https://docs.google.com/document/d/14QZxh2SAWl3JE-SzVyemkAv4p9TBChO-jzZ5YpT8BZs/edit?usp=sharing] * Week 7: Review Hetland, Chapters 3-7. We'll do a series of parsing problems and flex our collective induction and recursion muscles. ** [https://docs.google.com/document/d/1i04oL7zJsD3KzvsPIaHBgwaOZ78UZvz5ReRDF-PlyF0/edit?usp=sharing Week 7 Problems] * Week 8: [[Media:Minimization1.pdf|Minimization Problems!]] * Week 10: [[Media:Minimization2.pdf|Molecular Optimization]] * Week 11: [[Media:Dynamics.pdf|Dynamical Problems]] === Homework === * Homework will be assigned through Repl.IT * Project presentations will be on Mon.-Wed., Mar 5-7 * Final Project presentations will be during exam time, Wed., May 2 93f0fab11dc5d4a9bc1629569a9a78337d59da1c 655 653 2018-03-27T15:58:23Z David M. Rogers 2 /* Projects */ wikitext text/x-wiki '''<BIG>Introduction to Scientific Computing</BIG>''' Course Info * Course Numbers CHM 4932-004/6938-010, CRN: 20438/20439 * Credit Hours: 3 * Meeting Dates: January 8 - April 25, 2018 ** No Class Jan. 15 or Mar. 12-18 * Meeting Times: Mon. and Wed., 12:30-13:45 in SCA 222 ** Midterm Project Presentations: Mon.-Wed., Mar 5 and 7. ** Final Project Presentations: Wed., May 2, 10:00am – 12:00pm (scheduled final date) ** Lab Session & Office Hours: Fri. 12:30-13:45 in IDR 214 (or SCA 222 by announcement) <pre> $ for((i=1;i<=4;i++)); do cal $i 2018; done ____ January 2018 ____ _____ March 2018 ____ | Su Mo Tu We Th Fr Sa | | Su Mo Tu We Th Fr Sa | 1 2 3 4 5 6 | | 1 (2) 3 1 | 7 8 9*10 11 12 13 | 9 | 4 (5) 6 (7) 8 9 10 2 | 14 x 16*17 18 19 20 | | x x 3 | 21*22 23 24 25 26 27 | 10 | 18*19 20 21 22 23 24 4 | 28*29 30 31 | 11 | 25*26 27 28 29 30 31 ___ February 2018 ____ _____ April 2018 ____ | Su Mo Tu We Th Fr Sa | | Su Mo Tu We Th Fr Sa | 1 2 3 | 12 | 1 *2 3 4 5 6 7 5 | 4 *5 6 7 8 9 10 | 13 | 8 *9 10 11 12 13 14 6 | 11*12 13 14 15 16 17 | 14 | 15*16 17 18 19 20 21 7 | 18*19 20 21 22 23 24 | 15 | 22*23 24(25)26 27 28 8 | 25*26 27 28 | | 29 x Week Topic 1 Calculator Form 2 Pseudocode 3 Plotting 1 (Excel) 4 Plotting 2 (Matplotlib and linear spaces) 5 Abstraction 1 (advanced functions and oo method) 6 Abstraction 2 (Booleans and logic) 7 2D transforms and iterated maps 8 Optimization 1 (Newton-Rhapson) 9 midterm project presentations 10 Optimization 2 (MD Energy) 11 ODE and SDE algorithms 12 Statistics 13 Complexity 14 Circe and Linux crash course 15 Compile & install process, ctypes </pre> == Overview == Mathematical models in the natural sciences take many shapes and forms. The moment they become more complicated than tracking a few variables over time, we have to put away our Excel spreadsheets and make use of a solid foundation in computational science. The course establishes this foundation by introducing data structures and algorithms used in everyday scientific computing using examples in the python scripting language. By the end of the Semester, students will be able to navigate the Linux command-line to go from a mathematical model to a numerical solution. Best practices for working with computer code and visualizing data will also be covered. == Topics == # Languages #* bash (shell) #* python (scripting) #* stack & register-based machine languages: overview of C and Fortran syntax & compiling with gcc, ‘thread safety’ #* Shared libraries & language inter-operability (FFI) # Algorithms #* Horner’s algorithm for polynomials #* Newton’s root finding algo. #* Overview of general optimization algo-s (example: linear & nonlin. least-squares) #* Numerical integration (scripted, plus gnu ODE) #* Communication (how HTTP get/put works) # Data Structures #* Linked Lists #* Trees (file system hierarchies) #* Graphs #* Arrays (dense & sparse) example: vectors & rotations / transpositions, densities and difference operators # Presentation & visualization #* Flat CSV files (and excel) #* Working with binary data #* Python matplotlib (2D images) #* Binning histograms & weighted averages # Best Practices #* High-level code design (modularity, interface specifications, unit testing, etc.) #* Code audit: open-source libraries, ex. Gnu Scientific Library, qsort in libc, Boost #* Source code versioning (example: git or mercurial) #* gdb & execution profiling #* documentation #* Makefiles == Grading == '''Grading Scale (out of 400 points possible)''' {| class="wikitable" |- ! Grade ! Undergraduate ! Graduate |- | A+ | 269 | 323 |- | A | 258 | 310 |- | A- | 250 | 300 |- | B+ | 241 | 290 |- | B | 230 | 276 |- | B- | 222 | 266 |- | C+ | 213 | 256 |- | C | 202 | 243 |- | C- | 194 | 233 |- | D+ | 186 | 223 |- | D | 175 | 210 |- | D- | 166 | 200 |} * (280 U / 330 G) Points Possible: ** 9 homework assignments (10 points per homework) ** 14 in-class assignments / quizzes (10 points per week) ** 2 projects / competitions (50 points per project) ** Undergraduates must complete 1 project, graduates must complete 2 * Important Rules ** For maximum benefit, homework should be done on-time. However, homework will be allowed to be re-submitted at any time for full credit, but must present a unique solution to previous work from yourself or others. ** All work must cite co-group members (if any) and the source of any code snippets used online. === Grading Rationale === Homework points will only be awarded for correct, working code and correct algorithmic analysis, while the homework problems will become progressively tougher. Undergraduates should be able to pass the course with an A if they have correctly answered most of the homework, appear at class prepared and on-time, and made a strong attempt at one of the projects. Graduate students should both perform well on the homework and successfully complete one or two projects. The re-grading for homework allows making up for missed assignments, and encourages returning to core concepts at a later point in the class. Students who have put in the studying effort, completed significant portions of the homework and projects both in- and out of class have thus demonstrated introductory programming proficiency. == Projects == * Midterm Project Description [[Media:Midterm2018.pdf]] (2 Mar., 2018) ** [[Agile|Agile Development Tips & Tricks]] * Midterm Projects: <!-- ** Luis & Matteo [https://drive.google.com/file/d/1tTkwRuJts2SnZcEkVlHO51ItacFfHYL3/view?usp=sharing_eil&ts=5a9d6cb2] ** Misty & Cherinee [https://docs.google.com/presentation/d/17UTtjv-2d19mTtYt9oVwrWI5eOuo7l2qg4zYsOGXTxw/edit?ts=5a9d7601#slide=id.gc6f90357f_0_0] ** Pauline [http://predictivestatmech.org/code/pauline.py] ** Nasha [http://predictivestatmech.org/code/nasha.py] ** Daniel [https://drive.google.com/drive/folders/1NNQEG7O8Pi1jGeMaPwcWYEBVI62BhYgD?usp=sharing] ** Melissa, Casidy & Paul [https://docs.google.com/presentation/d/10U8loA8uPMypoEWO163e6smZ9JnrPXjyQl97Duz8Hg8/edit?usp=sharing_eip&ts=5a9d6081] ** Kimberly [http://predictivestatmech.org/code/kimberly.py] ** Eric ** Jovina & Jesunifemi [http://predictivestatmech.org/code/jovina-nifemi.py] ** Jakin [https://docs.google.com/presentation/d/1LFh-_n6J2jC6FBEl-X4WTJqYyhwjnVucGdMBKsUFsjU/edit?usp=sharing_eip&ts=5a9d8fa1] ** Bryan [http://predictivestatmech.org/code/bryan.py] --> * [[Final2018|Final Project Description]] (25 Apr., 2018) == Textbooks and Resources == * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-0072-7 Beginning Python, Hetland, 2005] (eBook avail. from USF Library) * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-3238-4 Python Algorithms, Hetland, 2010] (eBook avail. from USF Library) * [http://aosabook.org/en/index.html The Architecture of Open Source Applications] * [http://docs.python.org Python Documentation] * [https://developers.google.com/edu/python/ Google Introductory Python Notes] * [http://huffman.sourceforge.net/tao/tao-of-programming.html Tao of Programming] Other (possibly useful) materials: * [http://hackersdictionary.com/html/entry/larval-stage.html The Jargon File] * Chapters 7&8 of Modelling and Simulation, Birta and Arbez, Springer 2007 (eBook avail. from USF Library). * Chapters 4-6 of Models and Algorithms for Intelligent Data Analysis, Runkler, Springer 2012 (eBook avail. from USF Library). * Guide to Scientific Computing in C++, Francis and Whiteley, Springer, 2012. (eBook avail. from USF Library) * Extra info. On the basics: ** Chapters 3 and 7 of Mathematics in Computing, Regan, Springer 2013. (eBook avail. from USF Library) ** Instant feedback graphical programming with [https://www.khanacademy.org/cs/programming/ Khan Academy] * [http://www.meetup.com/python-178/ Local PyBulls Meetings] Code: * [http://carsonfarmer.com/2013/07/essential-python-geo-libraries Python Libraries Useful for Geospatial Problems] * [[Code#Python_Libraries|Python Libraries Useful for Computational Chemistry]] (very small list at present) Interactive Interpreters: * [http://www.codewars.com CodeWars] Recommended for building experience with practice problems. * [http://codecombat.com/ CodeCombat] A very visual way to interact with your python code. * [http://exercism.io Exercism] A command-line client with a similar learn-through-challenge philosophy. * [http://repl.it repl.it] A read-eval-print loop for several computer languages. * [http://en.cppreference.com/w/cpp/language CppReference] Documentation with an online evaluator for C++ code. === Notes === * [[Media:Intro.pdf|Introduction Notes]] * [[Media:Week2.pdf|Function Syntax]] and [[Media:Week3.pdf|For-Loop Syntax]] cheat-sheets. * [[Media:PlottingMaps.pdf|Plotting Maps]] <!-- ** [[Turing Exercise]] ** [https://predictivestatmech.org/code/example.dcd Example DCD File] * [[Media:Week-5.2017.pdf|Week 5 Notes]] * [[Media:PlottingMaps.pdf|Week 6 Notes]] ** [[Code:PyTesting]] * [[Media:NumpyArrays.pdf|Week 7 Notes]] ** [http://www.labri.fr/perso/nrougier/from-python-to-numpy/ all about numpy] * Misc. Notes for Week 8 ** [[Physics:Pairs|Rundown of Pair Interactions]] ** Parameterized surfaces [[Media:param1.jpg|1]] and [[Media:param2.jpg|2]] * Notes for Compilation Lab ** [https://learnpythonthehardway.org/book/appendixa.html Command Line Crash Course] Cheat sheet for bash commands. ** USF's compute cluster documentation at [https://wiki.rc.usf.edu/index.php/Main_Page RC Wiki]. *** See especially the "Connecting to SC" and "Modules" sections ** [[Code:Compiling|Cheat-codes]] for compilation lab. * [[Media:jobs.pdf|Research Computing Batch Queue]] * [[Media:Plug-in.pdf|Plugging Into Libraries]] * [[Media:Matrix.pdf|Matrix Algorithms]] --> === Review Notes on Sequences, list comprehensions and arrays === <source lang="python"> # Say you want to make a plot of the LJ function on the domain x \in [0.9, 3] # 1. You could use the following two list comprehensions to be specific: x = [ i*(3-0.9)/100.0 + 0.9 for i in range(101) ] y = [ 4*(xi**-12 - xi**-6) for xi in x] # 2. You could implement the LJ function as a python function and use MAP, def LJ(x): ix6 = x**-6 # the factoring makes this calculation more efficient return 4*ix6*(ix6 + 1.0) y = map(LJ, x) # 3. You could work on arrays, where addition, multiplication, and powers are elementwise: ax = arange(101)*(3-0.9)/100 + 0.9 ay = LJ(ax) # Mind the difference in type! type(x) type(ax) # 4. You could totally cheat, and use numpy's builtin functions. ax = linspace(0.9, 3.0, 101) # Exercise: replicate the steps above to test the finite difference computation # of the derivative against the analytical derivative of LJ. [ (y[i+1]-y[i])/(x[i+1]-x[i]) for i in ... import matplotlib.pyplot as plt plt.plot(x, y) plt.show() </source> === Review Notes on Functions with Function arguments (functionals) === <source lang="python"> # map : (a -> b), [ a ] -> [ b ] # map: map(str, [1,2,3]) --> [ "1", "2", "3" ] # ^ function (a -> b) # map(int, map(str, [1,2,3]) ) # - helpful for parsing # x = "1 2 3 4 5" # x.split() # ["1", "2", "3", "4", "5"] # map(int, x.split()) # [1,2,3,4,5] str([1,2,3]) # "[1, 2, 3]" (bad) map(str, [1,2,3]) # ["1", "2", "3"] (good) # filter: (a -> Bool), [a] -> [a] # Example filter: # '1' -> no # ' ' -> no # 'a-z' -> yes # 'A-Z' -> yes def f(x): # str -> Bool if x >= 'a' and x <= 'z': return True if x >= 'A' and x <= 'Z': return True return False filter(f, " 1 a b 2 \n") # reduce: (a,b -> a), [b], a -> a sum([1,2,3]) # -> 6 def add2(x,y): # x : int, y : int return x+y reduce(add2, [1,2,3], 0) # For an example where a != b: def append(x,y): # x : [int], y : int return x + [y] reduce(append, [1,2,3], []) # start with an empty list # Newton-Rhapson def nrhap(f, fp, x0, tol = 1e-6): y = f(x0) iter = 0 # guard against infinity while abs(y) > tol: iter += 1 if iter > 1000: raise ValueError, "Unable to converge!" x0 -= y/fp(x0) y = f(x0) return x0 # solve x^3 - 2 = 0 def f(x): return x**3 - 2 def fp(x): return 3*x**2 print( nrhap(f, fp, 1.0)**3 ) </source> === In-Class Problems === * Week 1: [[Media:CalculatorProbs.pdf|Calculator Problems]] ** Solutions: [http://predictivestatmech.org/terms/term.html] ** This solution uses python list comprehensions, and shows that the slowest step is actually unit conversion! * Week 2: [[Media:Pseudocode.pdf|Pseudocode Problems]] ** We will work these in class. For practice, be sure you have python list ideas down! ** Solutions: [https://docs.google.com/document/d/1HRkSdVNsTUydY4cVx67jRHRyhi5gL6nneEj9IX89wlE/edit?usp=sharing] * Week 3: [[Media:Plotting1.pdf|Plotting 1]] ** [https://stackoverflow.com/questions/11815538/how-to-import-matplotlib-in-python#11830055 Notes on installing Matplotlib on your own computer] ** Challenge: actions vs. functions -- what does the following code do: "[ print(1) for i in range(10) ]" (python3 only) * Week 4: [[Media:Plotting2.pdf|Plotting 2]] ** Solutions: [https://docs.google.com/document/d/1AanEFQmxLxoNM-662MHxsxToY3wsqovNx6SwcPQuBIg/edit?usp=sharing] * Week 5: Read pseudocode and plotting, focusing on types and syntax. Also, re-read the end of chapter summaries for Ch. 3, 5 and 6. * Week 6: Read the following pieces on first order logic [http://bayes.wustl.edu/etj/prob/book.pdf Chapter 1 of Jaynes' Book] [http://web.cecs.pdx.edu/~cs410aph/Lectures/Smalltalk%20II/Dijkstra%20on%20Hamming%27s%20Problem.pdf Hamming's Problem], and pages 71-80 in Chapter 4 of Hetland's Algorithms book (on induction). Just skip directly to chapter 4. ** Solutions [https://docs.google.com/document/d/14QZxh2SAWl3JE-SzVyemkAv4p9TBChO-jzZ5YpT8BZs/edit?usp=sharing] * Week 7: Review Hetland, Chapters 3-7. We'll do a series of parsing problems and flex our collective induction and recursion muscles. ** [https://docs.google.com/document/d/1i04oL7zJsD3KzvsPIaHBgwaOZ78UZvz5ReRDF-PlyF0/edit?usp=sharing Week 7 Problems] * Week 8: [[Media:Minimization1.pdf|Minimization Problems!]] * Week 10: [[Media:Minimization2.pdf|Molecular Optimization]] * Week 11: [[Media:Dynamics.pdf|Dynamical Problems]] === Homework === * Homework will be assigned through Repl.IT * Project presentations will be on Mon.-Wed., Mar 5-7 * Final Project presentations will be during exam time, Wed., May 2 cc517ee3895ff167f24d26ff8a80d7b5e46c87b2 659 655 2018-04-01T00:42:39Z David M. Rogers 2 /* In-Class Problems */ wikitext text/x-wiki '''<BIG>Introduction to Scientific Computing</BIG>''' Course Info * Course Numbers CHM 4932-004/6938-010, CRN: 20438/20439 * Credit Hours: 3 * Meeting Dates: January 8 - April 25, 2018 ** No Class Jan. 15 or Mar. 12-18 * Meeting Times: Mon. and Wed., 12:30-13:45 in SCA 222 ** Midterm Project Presentations: Mon.-Wed., Mar 5 and 7. ** Final Project Presentations: Wed., May 2, 10:00am – 12:00pm (scheduled final date) ** Lab Session & Office Hours: Fri. 12:30-13:45 in IDR 214 (or SCA 222 by announcement) <pre> $ for((i=1;i<=4;i++)); do cal $i 2018; done ____ January 2018 ____ _____ March 2018 ____ | Su Mo Tu We Th Fr Sa | | Su Mo Tu We Th Fr Sa | 1 2 3 4 5 6 | | 1 (2) 3 1 | 7 8 9*10 11 12 13 | 9 | 4 (5) 6 (7) 8 9 10 2 | 14 x 16*17 18 19 20 | | x x 3 | 21*22 23 24 25 26 27 | 10 | 18*19 20 21 22 23 24 4 | 28*29 30 31 | 11 | 25*26 27 28 29 30 31 ___ February 2018 ____ _____ April 2018 ____ | Su Mo Tu We Th Fr Sa | | Su Mo Tu We Th Fr Sa | 1 2 3 | 12 | 1 *2 3 4 5 6 7 5 | 4 *5 6 7 8 9 10 | 13 | 8 *9 10 11 12 13 14 6 | 11*12 13 14 15 16 17 | 14 | 15*16 17 18 19 20 21 7 | 18*19 20 21 22 23 24 | 15 | 22*23 24(25)26 27 28 8 | 25*26 27 28 | | 29 x Week Topic 1 Calculator Form 2 Pseudocode 3 Plotting 1 (Excel) 4 Plotting 2 (Matplotlib and linear spaces) 5 Abstraction 1 (advanced functions and oo method) 6 Abstraction 2 (Booleans and logic) 7 2D transforms and iterated maps 8 Optimization 1 (Newton-Rhapson) 9 midterm project presentations 10 Optimization 2 (MD Energy) 11 ODE and SDE algorithms 12 Statistics 13 Complexity 14 Circe and Linux crash course 15 Compile & install process, ctypes </pre> == Overview == Mathematical models in the natural sciences take many shapes and forms. The moment they become more complicated than tracking a few variables over time, we have to put away our Excel spreadsheets and make use of a solid foundation in computational science. The course establishes this foundation by introducing data structures and algorithms used in everyday scientific computing using examples in the python scripting language. By the end of the Semester, students will be able to navigate the Linux command-line to go from a mathematical model to a numerical solution. Best practices for working with computer code and visualizing data will also be covered. == Topics == # Languages #* bash (shell) #* python (scripting) #* stack & register-based machine languages: overview of C and Fortran syntax & compiling with gcc, ‘thread safety’ #* Shared libraries & language inter-operability (FFI) # Algorithms #* Horner’s algorithm for polynomials #* Newton’s root finding algo. #* Overview of general optimization algo-s (example: linear & nonlin. least-squares) #* Numerical integration (scripted, plus gnu ODE) #* Communication (how HTTP get/put works) # Data Structures #* Linked Lists #* Trees (file system hierarchies) #* Graphs #* Arrays (dense & sparse) example: vectors & rotations / transpositions, densities and difference operators # Presentation & visualization #* Flat CSV files (and excel) #* Working with binary data #* Python matplotlib (2D images) #* Binning histograms & weighted averages # Best Practices #* High-level code design (modularity, interface specifications, unit testing, etc.) #* Code audit: open-source libraries, ex. Gnu Scientific Library, qsort in libc, Boost #* Source code versioning (example: git or mercurial) #* gdb & execution profiling #* documentation #* Makefiles == Grading == '''Grading Scale (out of 400 points possible)''' {| class="wikitable" |- ! Grade ! Undergraduate ! Graduate |- | A+ | 269 | 323 |- | A | 258 | 310 |- | A- | 250 | 300 |- | B+ | 241 | 290 |- | B | 230 | 276 |- | B- | 222 | 266 |- | C+ | 213 | 256 |- | C | 202 | 243 |- | C- | 194 | 233 |- | D+ | 186 | 223 |- | D | 175 | 210 |- | D- | 166 | 200 |} * (280 U / 330 G) Points Possible: ** 9 homework assignments (10 points per homework) ** 14 in-class assignments / quizzes (10 points per week) ** 2 projects / competitions (50 points per project) ** Undergraduates must complete 1 project, graduates must complete 2 * Important Rules ** For maximum benefit, homework should be done on-time. However, homework will be allowed to be re-submitted at any time for full credit, but must present a unique solution to previous work from yourself or others. ** All work must cite co-group members (if any) and the source of any code snippets used online. === Grading Rationale === Homework points will only be awarded for correct, working code and correct algorithmic analysis, while the homework problems will become progressively tougher. Undergraduates should be able to pass the course with an A if they have correctly answered most of the homework, appear at class prepared and on-time, and made a strong attempt at one of the projects. Graduate students should both perform well on the homework and successfully complete one or two projects. The re-grading for homework allows making up for missed assignments, and encourages returning to core concepts at a later point in the class. Students who have put in the studying effort, completed significant portions of the homework and projects both in- and out of class have thus demonstrated introductory programming proficiency. == Projects == * Midterm Project Description [[Media:Midterm2018.pdf]] (2 Mar., 2018) ** [[Agile|Agile Development Tips & Tricks]] * Midterm Projects: <!-- ** Luis & Matteo [https://drive.google.com/file/d/1tTkwRuJts2SnZcEkVlHO51ItacFfHYL3/view?usp=sharing_eil&ts=5a9d6cb2] ** Misty & Cherinee [https://docs.google.com/presentation/d/17UTtjv-2d19mTtYt9oVwrWI5eOuo7l2qg4zYsOGXTxw/edit?ts=5a9d7601#slide=id.gc6f90357f_0_0] ** Pauline [http://predictivestatmech.org/code/pauline.py] ** Nasha [http://predictivestatmech.org/code/nasha.py] ** Daniel [https://drive.google.com/drive/folders/1NNQEG7O8Pi1jGeMaPwcWYEBVI62BhYgD?usp=sharing] ** Melissa, Casidy & Paul [https://docs.google.com/presentation/d/10U8loA8uPMypoEWO163e6smZ9JnrPXjyQl97Duz8Hg8/edit?usp=sharing_eip&ts=5a9d6081] ** Kimberly [http://predictivestatmech.org/code/kimberly.py] ** Eric ** Jovina & Jesunifemi [http://predictivestatmech.org/code/jovina-nifemi.py] ** Jakin [https://docs.google.com/presentation/d/1LFh-_n6J2jC6FBEl-X4WTJqYyhwjnVucGdMBKsUFsjU/edit?usp=sharing_eip&ts=5a9d8fa1] ** Bryan [http://predictivestatmech.org/code/bryan.py] --> * [[Final2018|Final Project Description]] (25 Apr., 2018) == Textbooks and Resources == * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-0072-7 Beginning Python, Hetland, 2005] (eBook avail. from USF Library) * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-3238-4 Python Algorithms, Hetland, 2010] (eBook avail. from USF Library) * [http://aosabook.org/en/index.html The Architecture of Open Source Applications] * [http://docs.python.org Python Documentation] * [https://developers.google.com/edu/python/ Google Introductory Python Notes] * [http://huffman.sourceforge.net/tao/tao-of-programming.html Tao of Programming] Other (possibly useful) materials: * [http://hackersdictionary.com/html/entry/larval-stage.html The Jargon File] * Chapters 7&8 of Modelling and Simulation, Birta and Arbez, Springer 2007 (eBook avail. from USF Library). * Chapters 4-6 of Models and Algorithms for Intelligent Data Analysis, Runkler, Springer 2012 (eBook avail. from USF Library). * Guide to Scientific Computing in C++, Francis and Whiteley, Springer, 2012. (eBook avail. from USF Library) * Extra info. On the basics: ** Chapters 3 and 7 of Mathematics in Computing, Regan, Springer 2013. (eBook avail. from USF Library) ** Instant feedback graphical programming with [https://www.khanacademy.org/cs/programming/ Khan Academy] * [http://www.meetup.com/python-178/ Local PyBulls Meetings] Code: * [http://carsonfarmer.com/2013/07/essential-python-geo-libraries Python Libraries Useful for Geospatial Problems] * [[Code#Python_Libraries|Python Libraries Useful for Computational Chemistry]] (very small list at present) Interactive Interpreters: * [http://www.codewars.com CodeWars] Recommended for building experience with practice problems. * [http://codecombat.com/ CodeCombat] A very visual way to interact with your python code. * [http://exercism.io Exercism] A command-line client with a similar learn-through-challenge philosophy. * [http://repl.it repl.it] A read-eval-print loop for several computer languages. * [http://en.cppreference.com/w/cpp/language CppReference] Documentation with an online evaluator for C++ code. === Notes === * [[Media:Intro.pdf|Introduction Notes]] * [[Media:Week2.pdf|Function Syntax]] and [[Media:Week3.pdf|For-Loop Syntax]] cheat-sheets. * [[Media:PlottingMaps.pdf|Plotting Maps]] <!-- ** [[Turing Exercise]] ** [https://predictivestatmech.org/code/example.dcd Example DCD File] * [[Media:Week-5.2017.pdf|Week 5 Notes]] * [[Media:PlottingMaps.pdf|Week 6 Notes]] ** [[Code:PyTesting]] * [[Media:NumpyArrays.pdf|Week 7 Notes]] ** [http://www.labri.fr/perso/nrougier/from-python-to-numpy/ all about numpy] * Misc. Notes for Week 8 ** [[Physics:Pairs|Rundown of Pair Interactions]] ** Parameterized surfaces [[Media:param1.jpg|1]] and [[Media:param2.jpg|2]] * Notes for Compilation Lab ** [https://learnpythonthehardway.org/book/appendixa.html Command Line Crash Course] Cheat sheet for bash commands. ** USF's compute cluster documentation at [https://wiki.rc.usf.edu/index.php/Main_Page RC Wiki]. *** See especially the "Connecting to SC" and "Modules" sections ** [[Code:Compiling|Cheat-codes]] for compilation lab. * [[Media:jobs.pdf|Research Computing Batch Queue]] * [[Media:Plug-in.pdf|Plugging Into Libraries]] * [[Media:Matrix.pdf|Matrix Algorithms]] --> === Review Notes on Sequences, list comprehensions and arrays === <source lang="python"> # Say you want to make a plot of the LJ function on the domain x \in [0.9, 3] # 1. You could use the following two list comprehensions to be specific: x = [ i*(3-0.9)/100.0 + 0.9 for i in range(101) ] y = [ 4*(xi**-12 - xi**-6) for xi in x] # 2. You could implement the LJ function as a python function and use MAP, def LJ(x): ix6 = x**-6 # the factoring makes this calculation more efficient return 4*ix6*(ix6 + 1.0) y = map(LJ, x) # 3. You could work on arrays, where addition, multiplication, and powers are elementwise: ax = arange(101)*(3-0.9)/100 + 0.9 ay = LJ(ax) # Mind the difference in type! type(x) type(ax) # 4. You could totally cheat, and use numpy's builtin functions. ax = linspace(0.9, 3.0, 101) # Exercise: replicate the steps above to test the finite difference computation # of the derivative against the analytical derivative of LJ. [ (y[i+1]-y[i])/(x[i+1]-x[i]) for i in ... import matplotlib.pyplot as plt plt.plot(x, y) plt.show() </source> === Review Notes on Functions with Function arguments (functionals) === <source lang="python"> # map : (a -> b), [ a ] -> [ b ] # map: map(str, [1,2,3]) --> [ "1", "2", "3" ] # ^ function (a -> b) # map(int, map(str, [1,2,3]) ) # - helpful for parsing # x = "1 2 3 4 5" # x.split() # ["1", "2", "3", "4", "5"] # map(int, x.split()) # [1,2,3,4,5] str([1,2,3]) # "[1, 2, 3]" (bad) map(str, [1,2,3]) # ["1", "2", "3"] (good) # filter: (a -> Bool), [a] -> [a] # Example filter: # '1' -> no # ' ' -> no # 'a-z' -> yes # 'A-Z' -> yes def f(x): # str -> Bool if x >= 'a' and x <= 'z': return True if x >= 'A' and x <= 'Z': return True return False filter(f, " 1 a b 2 \n") # reduce: (a,b -> a), [b], a -> a sum([1,2,3]) # -> 6 def add2(x,y): # x : int, y : int return x+y reduce(add2, [1,2,3], 0) # For an example where a != b: def append(x,y): # x : [int], y : int return x + [y] reduce(append, [1,2,3], []) # start with an empty list # Newton-Rhapson def nrhap(f, fp, x0, tol = 1e-6): y = f(x0) iter = 0 # guard against infinity while abs(y) > tol: iter += 1 if iter > 1000: raise ValueError, "Unable to converge!" x0 -= y/fp(x0) y = f(x0) return x0 # solve x^3 - 2 = 0 def f(x): return x**3 - 2 def fp(x): return 3*x**2 print( nrhap(f, fp, 1.0)**3 ) </source> === In-Class Problems === * Week 1: [[Media:CalculatorProbs.pdf|Calculator Problems]] ** Solutions: [http://predictivestatmech.org/terms/term.html] ** This solution uses python list comprehensions, and shows that the slowest step is actually unit conversion! * Week 2: [[Media:Pseudocode.pdf|Pseudocode Problems]] ** We will work these in class. For practice, be sure you have python list ideas down! ** Solutions: [https://docs.google.com/document/d/1HRkSdVNsTUydY4cVx67jRHRyhi5gL6nneEj9IX89wlE/edit?usp=sharing] * Week 3: [[Media:Plotting1.pdf|Plotting 1]] ** [https://stackoverflow.com/questions/11815538/how-to-import-matplotlib-in-python#11830055 Notes on installing Matplotlib on your own computer] ** Challenge: actions vs. functions -- what does the following code do: "[ print(1) for i in range(10) ]" (python3 only) * Week 4: [[Media:Plotting2.pdf|Plotting 2]] ** Solutions: [https://docs.google.com/document/d/1AanEFQmxLxoNM-662MHxsxToY3wsqovNx6SwcPQuBIg/edit?usp=sharing] * Week 5: Read pseudocode and plotting, focusing on types and syntax. Also, re-read the end of chapter summaries for Ch. 3, 5 and 6. * Week 6: Read the following pieces on first order logic [http://bayes.wustl.edu/etj/prob/book.pdf Chapter 1 of Jaynes' Book] [http://web.cecs.pdx.edu/~cs410aph/Lectures/Smalltalk%20II/Dijkstra%20on%20Hamming%27s%20Problem.pdf Hamming's Problem], and pages 71-80 in Chapter 4 of Hetland's Algorithms book (on induction). Just skip directly to chapter 4. ** Solutions [https://docs.google.com/document/d/14QZxh2SAWl3JE-SzVyemkAv4p9TBChO-jzZ5YpT8BZs/edit?usp=sharing] * Week 7: Review Hetland, Chapters 3-7. We'll do a series of parsing problems and flex our collective induction and recursion muscles. ** [https://docs.google.com/document/d/1i04oL7zJsD3KzvsPIaHBgwaOZ78UZvz5ReRDF-PlyF0/edit?usp=sharing Week 7 Problems] * Week 8: [[Media:Minimization1.pdf|Minimization Problems!]] * Week 10: [[Media:Minimization2.pdf|Molecular Optimization]] * Week 11: [[Media:Dynamics.pdf|Dynamical Problems]] * Week 12: [[Media:InvPend.pdf|Inverse Pendulum]] === Homework === * Homework will be assigned through Repl.IT * Project presentations will be on Mon.-Wed., Mar 5-7 * Final Project presentations will be during exam time, Wed., May 2 e6cabfb4044bc988fc0c140ed61cb89c106fadcb Courses 0 16 613 609 2018-01-08T17:06:41Z David M. Rogers 2 /* Courses */ wikitext text/x-wiki Here's a list of courses with useful online materials: == Courses == * [[PChemFall2017| USF Physical Chemistry I (2017)]] * [[PChemFall2016| USF Physical Chemistry I (2016)]] * [[GradQuantumFall2013| USF Graduate Quantum Mechanics I]] * [[GradQuantumSpring2014| USF Graduate Quantum Mechanics II]] * [[CompSciSpring2018|Introduction to Scientific Computing (2018)]] * [[CompSciSpring2017|Introduction to Scientific Computing (2017)]] * [[CompSciSpring2016|Introduction to Scientific Computing (2016)]] * [[CompSciFall2014|Introduction to Scientific Computing (2014)]] * [http://lambda-the-ultimate.org/classic/Courses.html Functional Programming] == Lecture Series == * [http://www.esqc.org/lectures European Summer School in Quantum Chemistry] == Tutorials == * [[HowTo:Fourier|Fourier transforms]] * [http://www.mathematica-journal.com/2012/02/evaluation-of-gaussian-molecular-integrals Evaluating Matrix Elements] * [http://www.haskell.org/tutorial/ Haskell] * [http://monads.haskell.cz/html/index.html Monads] * [http://www.yosefk.com/blog/my-history-with-forth-stack-machines.html The Forth Language] == Reference Material == * [http://dft.sandia.gov/Quest/DFT_codes.html List of DFT Codes] * [http://docs.python.org/3/tutorial/ Python Tutorial] * [http://www.nwchem-sw.org/index.php/Release62:NWChem_Documentation NWChem Documentation] * [http://www.ebi.ac.uk/pdbe-srv/pdbechem/ PDB Ligand Structures] 6c39b8ae84ae79720b5ec5cca3b07d83bf284159 File:CalculatorProbs.pdf 6 143 614 2018-01-09T21:11:07Z David M. Rogers 2 wikitext text/x-wiki da39a3ee5e6b4b0d3255bfef95601890afd80709 File:Pseudocode.pdf 6 144 619 2018-01-17T00:03:17Z David M. Rogers 2 wikitext text/x-wiki da39a3ee5e6b4b0d3255bfef95601890afd80709 620 619 2018-01-17T00:17:21Z David M. Rogers 2 David M. Rogers uploaded a new version of &quot;[[File:Pseudocode.pdf]]&quot; wikitext text/x-wiki da39a3ee5e6b4b0d3255bfef95601890afd80709 File:Plotting1.pdf 6 145 623 2018-01-22T01:22:07Z David M. Rogers 2 wikitext text/x-wiki da39a3ee5e6b4b0d3255bfef95601890afd80709 NWChem 0 33 624 114 2018-01-23T22:21:33Z David M. Rogers 2 /* Geometry Optimization */ wikitext text/x-wiki When in doubt, check the [http://www.nwchem-sw.org/index.php/Release62:NWChem_Documentation Documentation], and test! == Running NWChem == First, login to a system (e.g. circe) with nwchem installed. Next, load the NWChem module and set up a working dir. <source lang="bash"> module load apps/nwchem/6.1.1 mkdir nw-test cd nw-test </source> Then create a molecule (you can download an sdf file from the PDB ligand structure database listed in the [[Courses|course reference material]] (Search by molecule name -> Download Links (on left panel) -> Ideal Molfile). Next, paste the molecule into a file, e.g. <source lang="bash"> cat >start.sdf <<. FOR.sdf -ISIS- 3D 4 3 0 0 0 0 0 0 0 0 0 V2000 0.6070 0.0000 0.0000 C 0 0 0 0 0 -0.6000 0.0000 0.0000 O 0 0 0 0 0 1.1470 0.9350 0.0020 H 0 0 0 0 0 1.1470 -0.9350 0.0020 H 0 0 0 0 0 1 2 2 0 0 0 1 3 1 0 0 0 1 4 1 0 0 0 M END $$$$ . </source> You'll also need to paste one of the templates below (they work without changes) into an NWChem control file called '''en_scf.nw'''. Use the 'cat' command to paste into the file as above. Finally, convert '''start.sdf''' to an xyz format for NWChem and run nwchem. <source lang="bash"> babel start.sdf start.xyz nwchem en_scf.nw >en_scf.log </source> All your output will be in en_scf.log (scp/download it to your local system). In the future, use the batch queue system with <source lang="bash"> cat >en_job.sh <<. #$ -N a-test-job #$ -cwd #$ -o job-$JOB_ID.out #$ -e job-$JOB_ID.err #$ -l pcpus=4,h_rt=06:00:00 module load apps/nwchem/6.1.1 cd $HOME/nw-test mpirun `which nwchem` en_scf.nw >en_scf.log . qsub en_job.sh qstat -u $USER -t </source> This runs on 4 cpus in parallel, so it will be faster than running (as before) directly on the login node. Of course, you'll also want to change some options in the run file eventually (especially the basis set). You can also manually edit the xyz file and scan the energy vs some coordinate. See the templates below for more ideas. Note that you can also edit the files on your system and transfer, or edit locally on circe using your favorite linux editor. Nano is easy to use. <source lang="bash"> nano en_scf.nw </source> == Energy Calculation == A simple SCF energy calculation on the input file '''start.xyz''' can be done with: start en_scf title "Pople SCF energy" geometry units angstrom load start.xyz end basis # * library cc-pvdz # * library 6-31G* * library 3-21G end task scf energy == Geometry Optimization == Running a geometry optimization just requires replacing the '''task''' directive. Here, we've also added a block of parameters controlling the minimization algorithm. start opt_scf title "Pople SCF geometry optimization" geometry units angstrom load start.xyz end basis spherical # * library cc-pvdz # * library 6-31G* * library 3-21G end driver loose maxiter 150 xyz opt end task scf optimize == DFT == You can also use DFT rather than HF (SCF) by changing the appropriate keywords and adding a DFT block to specify its functional: start opt_dft title "Pople DFT geometry optimization" geometry units angstrom load start.xyz end basis # * library cc-pvdz # * library 6-31G* * library 3-21G end dft xc xpbe96 1.0 \ pw91lda local 1.0 \ cpbe96 nonlocal 1.0 direct iterations 150 grid fine disp vdw 2 end driver loose maxiter 150 xyz opt end task dft optimize The "xyz opt" causes NWChem to write out coordinate files, e.g. '''opt-001.xyz''', ... as the optimization is proceeding. == Specifying Charge and Spin == Of course, we need to be able to specify the charge and total spin for most systems as well. Here's an input example appropriate for Fe3+ (5 spin-up electrons making up a half-filled d-shell): start en_scf title "Pople SCF energy" geometry start units angstrom load start.xyz end basis # Fe library "Ahlrichs pVDZ" # better basis * library 3-21G end set geometry start charge 3 scf sextet end task scf energy == Vibrational Frequencies == At a minimum, the second derivatives of the potential energy surface with respect to the nuclear coordinates make up a 3Nx3N matrix. The eigenvectors represent vibrational 'modes,' and the eigenvalues represent their force constants. Analyzing each mode as a harmonic oscillator leads to a set of vibrational frequencies, which give thermochemical information on the molecule as well as IR spectroscopic information. From a minimized set of coordinates, all you should require is to add the appropriate task (and optionally a block of parameters) task scf frequencies == Orbital Analysis == Molecular orbital analysis is relatively easy once the HF equations have been solved, since the linear combinations of atomic orbitals that make up each of the molecular orbitals are stored in a file '''(jobname).movecs'''. To plot the total density and the contents of orbitals numbered 54 and 55 (from checking through the HF output), use: dplot title dens vectors en_scf.movecs LimitXYZ -5.0 5.0 30 -5.0 5.0 30 -5.0 5.0 30 spin total gaussian output dens.cube end task dplot dplot title homo vectors en_scf.movecs LimitXYZ -5.0 5.0 30 -5.0 5.0 30 -5.0 5.0 30 spin total orbitals view; 1; 54 gaussian output homo.cube end task dplot dplot Title lumo vectors en_scf.movecs LimitXYZ -5.0 5.0 30 -5.0 5.0 30 -5.0 5.0 30 spin total orbitals view; 1; 55 gaussian output lumo.cube end task dplot The Gaussian-format cube files can be opened with pymol and visualized by typing, e.g. isomesh mesh1, dens, 0.1, all, carve=1.6 isomesh mesh2, lumo, 0.01, all, carve=1.6 isomesh mesh3, lumo, -0.01, all, carve=1.6 to create isosurfaces at the values 0.1 for the density and <math>\pm 0.01</math> for the LUMO's wavefunction. Adam Hogan noted that (according to [http://www.nwchem-sw.org/index.php/Special:AWCforum/st/id309]) these orbitals are still associated with HF theory. To compute MP2-level quantities (natural orbitals), you instead use a matrix of derivatives of the orbitals to calculate matrix elements of an operator <math>\langle \psi | O | \psi \rangle</math>. To get those, you have to run '''task mp2 gradient''', which creates '''(jobname).mp2nos'''. You then replace '''vectors en_scf.movecs''' with '''vectors en_scf.mp2nos''' inside the '''dens''' blocks above to get the high-level densities. Here's an example of using mo2nos values to get the electrostatic potential: mp2 tight freeze atomic end task MP2 gradient set "esp:input vectors" en_scf.mp2nos esp recalculate probe 0.07 range 0.3 factor 1 spacing 0.02 end task esp 0d39e1e1fe79136d5ec7d1cf505afc466cc5e2ba 625 624 2018-01-23T22:24:21Z David M. Rogers 2 /* DFT */ wikitext text/x-wiki When in doubt, check the [http://www.nwchem-sw.org/index.php/Release62:NWChem_Documentation Documentation], and test! == Running NWChem == First, login to a system (e.g. circe) with nwchem installed. Next, load the NWChem module and set up a working dir. <source lang="bash"> module load apps/nwchem/6.1.1 mkdir nw-test cd nw-test </source> Then create a molecule (you can download an sdf file from the PDB ligand structure database listed in the [[Courses|course reference material]] (Search by molecule name -> Download Links (on left panel) -> Ideal Molfile). Next, paste the molecule into a file, e.g. <source lang="bash"> cat >start.sdf <<. FOR.sdf -ISIS- 3D 4 3 0 0 0 0 0 0 0 0 0 V2000 0.6070 0.0000 0.0000 C 0 0 0 0 0 -0.6000 0.0000 0.0000 O 0 0 0 0 0 1.1470 0.9350 0.0020 H 0 0 0 0 0 1.1470 -0.9350 0.0020 H 0 0 0 0 0 1 2 2 0 0 0 1 3 1 0 0 0 1 4 1 0 0 0 M END $$$$ . </source> You'll also need to paste one of the templates below (they work without changes) into an NWChem control file called '''en_scf.nw'''. Use the 'cat' command to paste into the file as above. Finally, convert '''start.sdf''' to an xyz format for NWChem and run nwchem. <source lang="bash"> babel start.sdf start.xyz nwchem en_scf.nw >en_scf.log </source> All your output will be in en_scf.log (scp/download it to your local system). In the future, use the batch queue system with <source lang="bash"> cat >en_job.sh <<. #$ -N a-test-job #$ -cwd #$ -o job-$JOB_ID.out #$ -e job-$JOB_ID.err #$ -l pcpus=4,h_rt=06:00:00 module load apps/nwchem/6.1.1 cd $HOME/nw-test mpirun `which nwchem` en_scf.nw >en_scf.log . qsub en_job.sh qstat -u $USER -t </source> This runs on 4 cpus in parallel, so it will be faster than running (as before) directly on the login node. Of course, you'll also want to change some options in the run file eventually (especially the basis set). You can also manually edit the xyz file and scan the energy vs some coordinate. See the templates below for more ideas. Note that you can also edit the files on your system and transfer, or edit locally on circe using your favorite linux editor. Nano is easy to use. <source lang="bash"> nano en_scf.nw </source> == Energy Calculation == A simple SCF energy calculation on the input file '''start.xyz''' can be done with: start en_scf title "Pople SCF energy" geometry units angstrom load start.xyz end basis # * library cc-pvdz # * library 6-31G* * library 3-21G end task scf energy == Geometry Optimization == Running a geometry optimization just requires replacing the '''task''' directive. Here, we've also added a block of parameters controlling the minimization algorithm. start opt_scf title "Pople SCF geometry optimization" geometry units angstrom load start.xyz end basis spherical # * library cc-pvdz # * library 6-31G* * library 3-21G end driver loose maxiter 150 xyz opt end task scf optimize == DFT == You can also use DFT rather than HF (SCF) by changing the appropriate keywords and adding a DFT block to specify its functional: start opt_dft title "Pople DFT geometry optimization" geometry units angstrom load start.xyz end basis spherical # * library cc-pvdz # * library 6-31G* * library 3-21G end dft xc xpbe96 1.0 \ pw91lda local 1.0 \ cpbe96 nonlocal 1.0 direct iterations 150 grid fine disp vdw 2 end driver loose maxiter 150 xyz opt end task dft optimize The "xyz opt" causes NWChem to write out coordinate files, e.g. '''opt-001.xyz''', ... as the optimization is proceeding. == Specifying Charge and Spin == Of course, we need to be able to specify the charge and total spin for most systems as well. Here's an input example appropriate for Fe3+ (5 spin-up electrons making up a half-filled d-shell): start en_scf title "Pople SCF energy" geometry start units angstrom load start.xyz end basis # Fe library "Ahlrichs pVDZ" # better basis * library 3-21G end set geometry start charge 3 scf sextet end task scf energy == Vibrational Frequencies == At a minimum, the second derivatives of the potential energy surface with respect to the nuclear coordinates make up a 3Nx3N matrix. The eigenvectors represent vibrational 'modes,' and the eigenvalues represent their force constants. Analyzing each mode as a harmonic oscillator leads to a set of vibrational frequencies, which give thermochemical information on the molecule as well as IR spectroscopic information. From a minimized set of coordinates, all you should require is to add the appropriate task (and optionally a block of parameters) task scf frequencies == Orbital Analysis == Molecular orbital analysis is relatively easy once the HF equations have been solved, since the linear combinations of atomic orbitals that make up each of the molecular orbitals are stored in a file '''(jobname).movecs'''. To plot the total density and the contents of orbitals numbered 54 and 55 (from checking through the HF output), use: dplot title dens vectors en_scf.movecs LimitXYZ -5.0 5.0 30 -5.0 5.0 30 -5.0 5.0 30 spin total gaussian output dens.cube end task dplot dplot title homo vectors en_scf.movecs LimitXYZ -5.0 5.0 30 -5.0 5.0 30 -5.0 5.0 30 spin total orbitals view; 1; 54 gaussian output homo.cube end task dplot dplot Title lumo vectors en_scf.movecs LimitXYZ -5.0 5.0 30 -5.0 5.0 30 -5.0 5.0 30 spin total orbitals view; 1; 55 gaussian output lumo.cube end task dplot The Gaussian-format cube files can be opened with pymol and visualized by typing, e.g. isomesh mesh1, dens, 0.1, all, carve=1.6 isomesh mesh2, lumo, 0.01, all, carve=1.6 isomesh mesh3, lumo, -0.01, all, carve=1.6 to create isosurfaces at the values 0.1 for the density and <math>\pm 0.01</math> for the LUMO's wavefunction. Adam Hogan noted that (according to [http://www.nwchem-sw.org/index.php/Special:AWCforum/st/id309]) these orbitals are still associated with HF theory. To compute MP2-level quantities (natural orbitals), you instead use a matrix of derivatives of the orbitals to calculate matrix elements of an operator <math>\langle \psi | O | \psi \rangle</math>. To get those, you have to run '''task mp2 gradient''', which creates '''(jobname).mp2nos'''. You then replace '''vectors en_scf.movecs''' with '''vectors en_scf.mp2nos''' inside the '''dens''' blocks above to get the high-level densities. Here's an example of using mo2nos values to get the electrostatic potential: mp2 tight freeze atomic end task MP2 gradient set "esp:input vectors" en_scf.mp2nos esp recalculate probe 0.07 range 0.3 factor 1 spacing 0.02 end task esp d54b6219f921d544a4cbbdd88aebb72cd54dd28a 626 625 2018-01-23T22:25:06Z David M. Rogers 2 /* Specifying Charge and Spin */ wikitext text/x-wiki When in doubt, check the [http://www.nwchem-sw.org/index.php/Release62:NWChem_Documentation Documentation], and test! == Running NWChem == First, login to a system (e.g. circe) with nwchem installed. Next, load the NWChem module and set up a working dir. <source lang="bash"> module load apps/nwchem/6.1.1 mkdir nw-test cd nw-test </source> Then create a molecule (you can download an sdf file from the PDB ligand structure database listed in the [[Courses|course reference material]] (Search by molecule name -> Download Links (on left panel) -> Ideal Molfile). Next, paste the molecule into a file, e.g. <source lang="bash"> cat >start.sdf <<. FOR.sdf -ISIS- 3D 4 3 0 0 0 0 0 0 0 0 0 V2000 0.6070 0.0000 0.0000 C 0 0 0 0 0 -0.6000 0.0000 0.0000 O 0 0 0 0 0 1.1470 0.9350 0.0020 H 0 0 0 0 0 1.1470 -0.9350 0.0020 H 0 0 0 0 0 1 2 2 0 0 0 1 3 1 0 0 0 1 4 1 0 0 0 M END $$$$ . </source> You'll also need to paste one of the templates below (they work without changes) into an NWChem control file called '''en_scf.nw'''. Use the 'cat' command to paste into the file as above. Finally, convert '''start.sdf''' to an xyz format for NWChem and run nwchem. <source lang="bash"> babel start.sdf start.xyz nwchem en_scf.nw >en_scf.log </source> All your output will be in en_scf.log (scp/download it to your local system). In the future, use the batch queue system with <source lang="bash"> cat >en_job.sh <<. #$ -N a-test-job #$ -cwd #$ -o job-$JOB_ID.out #$ -e job-$JOB_ID.err #$ -l pcpus=4,h_rt=06:00:00 module load apps/nwchem/6.1.1 cd $HOME/nw-test mpirun `which nwchem` en_scf.nw >en_scf.log . qsub en_job.sh qstat -u $USER -t </source> This runs on 4 cpus in parallel, so it will be faster than running (as before) directly on the login node. Of course, you'll also want to change some options in the run file eventually (especially the basis set). You can also manually edit the xyz file and scan the energy vs some coordinate. See the templates below for more ideas. Note that you can also edit the files on your system and transfer, or edit locally on circe using your favorite linux editor. Nano is easy to use. <source lang="bash"> nano en_scf.nw </source> == Energy Calculation == A simple SCF energy calculation on the input file '''start.xyz''' can be done with: start en_scf title "Pople SCF energy" geometry units angstrom load start.xyz end basis # * library cc-pvdz # * library 6-31G* * library 3-21G end task scf energy == Geometry Optimization == Running a geometry optimization just requires replacing the '''task''' directive. Here, we've also added a block of parameters controlling the minimization algorithm. start opt_scf title "Pople SCF geometry optimization" geometry units angstrom load start.xyz end basis spherical # * library cc-pvdz # * library 6-31G* * library 3-21G end driver loose maxiter 150 xyz opt end task scf optimize == DFT == You can also use DFT rather than HF (SCF) by changing the appropriate keywords and adding a DFT block to specify its functional: start opt_dft title "Pople DFT geometry optimization" geometry units angstrom load start.xyz end basis spherical # * library cc-pvdz # * library 6-31G* * library 3-21G end dft xc xpbe96 1.0 \ pw91lda local 1.0 \ cpbe96 nonlocal 1.0 direct iterations 150 grid fine disp vdw 2 end driver loose maxiter 150 xyz opt end task dft optimize The "xyz opt" causes NWChem to write out coordinate files, e.g. '''opt-001.xyz''', ... as the optimization is proceeding. == Specifying Charge and Spin == Of course, we need to be able to specify the charge and total spin for most systems as well. Here's an input example appropriate for Fe3+ (5 spin-up electrons making up a half-filled d-shell): start en_scf title "Pople SCF energy" geometry start units angstrom load start.xyz end basis spherical # Fe library "Ahlrichs pVDZ" # better basis * library 3-21G end set geometry start charge 3 scf sextet end task scf energy == Vibrational Frequencies == At a minimum, the second derivatives of the potential energy surface with respect to the nuclear coordinates make up a 3Nx3N matrix. The eigenvectors represent vibrational 'modes,' and the eigenvalues represent their force constants. Analyzing each mode as a harmonic oscillator leads to a set of vibrational frequencies, which give thermochemical information on the molecule as well as IR spectroscopic information. From a minimized set of coordinates, all you should require is to add the appropriate task (and optionally a block of parameters) task scf frequencies == Orbital Analysis == Molecular orbital analysis is relatively easy once the HF equations have been solved, since the linear combinations of atomic orbitals that make up each of the molecular orbitals are stored in a file '''(jobname).movecs'''. To plot the total density and the contents of orbitals numbered 54 and 55 (from checking through the HF output), use: dplot title dens vectors en_scf.movecs LimitXYZ -5.0 5.0 30 -5.0 5.0 30 -5.0 5.0 30 spin total gaussian output dens.cube end task dplot dplot title homo vectors en_scf.movecs LimitXYZ -5.0 5.0 30 -5.0 5.0 30 -5.0 5.0 30 spin total orbitals view; 1; 54 gaussian output homo.cube end task dplot dplot Title lumo vectors en_scf.movecs LimitXYZ -5.0 5.0 30 -5.0 5.0 30 -5.0 5.0 30 spin total orbitals view; 1; 55 gaussian output lumo.cube end task dplot The Gaussian-format cube files can be opened with pymol and visualized by typing, e.g. isomesh mesh1, dens, 0.1, all, carve=1.6 isomesh mesh2, lumo, 0.01, all, carve=1.6 isomesh mesh3, lumo, -0.01, all, carve=1.6 to create isosurfaces at the values 0.1 for the density and <math>\pm 0.01</math> for the LUMO's wavefunction. Adam Hogan noted that (according to [http://www.nwchem-sw.org/index.php/Special:AWCforum/st/id309]) these orbitals are still associated with HF theory. To compute MP2-level quantities (natural orbitals), you instead use a matrix of derivatives of the orbitals to calculate matrix elements of an operator <math>\langle \psi | O | \psi \rangle</math>. To get those, you have to run '''task mp2 gradient''', which creates '''(jobname).mp2nos'''. You then replace '''vectors en_scf.movecs''' with '''vectors en_scf.mp2nos''' inside the '''dens''' blocks above to get the high-level densities. Here's an example of using mo2nos values to get the electrostatic potential: mp2 tight freeze atomic end task MP2 gradient set "esp:input vectors" en_scf.mp2nos esp recalculate probe 0.07 range 0.3 factor 1 spacing 0.02 end task esp c99fc5d821d7720dba73aef005a72da4a2a6bf1d File:Libnwchem-6.5.patch.gz 6 56 628 269 2018-01-28T00:51:55Z David M. Rogers 2 David M. Rogers uploaded a new version of &quot;[[File:Libnwchem-6.5.patch.gz]]&quot; wikitext text/x-wiki Patch to nwchem 6.5 for compilation as a shared library and use with python ctypes. f8667f972204222b84dc0cc5a70cecdb95e3e8c0 629 628 2018-01-28T00:52:48Z David M. Rogers 2 David M. Rogers uploaded a new version of &quot;[[File:Libnwchem-6.5.patch.gz]]&quot; wikitext text/x-wiki Patch to nwchem 6.5 for compilation as a shared library and use with python ctypes. f8667f972204222b84dc0cc5a70cecdb95e3e8c0 File:Plotting2.pdf 6 146 631 2018-01-29T14:20:59Z David M. Rogers 2 wikitext text/x-wiki da39a3ee5e6b4b0d3255bfef95601890afd80709 File:Minimization1.pdf 6 147 640 2018-02-25T16:57:58Z David M. Rogers 2 wikitext text/x-wiki da39a3ee5e6b4b0d3255bfef95601890afd80709 File:Final2018.pdf 6 148 641 2018-03-01T05:12:01Z David M. Rogers 2 wikitext text/x-wiki da39a3ee5e6b4b0d3255bfef95601890afd80709 File:Midterm2018.pdf 6 149 642 2018-03-01T05:12:55Z David M. Rogers 2 wikitext text/x-wiki da39a3ee5e6b4b0d3255bfef95601890afd80709 Publications 0 8 649 599 2018-03-08T20:08:23Z David M. Rogers 2 wikitext text/x-wiki {| cellpadding="4" style="border: 1px solid darkgray;" |- style="border: 1px solid darkgray;" || David M. Rogers, "An information theory model for dissipation in open quantum systems." [http://iopscience.iop.org/article/10.1088/1742-6596/880/1/012039 J. Phys., Conference Series 880(1):012039, 2017]. This paper presents a new, simple ansatz for adding dissipation to arbitrary stochastic forcing of a quantum dynamical system. For Gaussian random forces, it predicts a Lindblad equation identical to the Caldeira-Leggett model up to order <math>\beta^2</math>, where the same term is present with a different prefactor. The system-centric, phase space picture here shows that the <math>\beta^2</math> term represents a quantum confinement effect. |- style="border: 1px solid darkgray;" || David M. Rogers, "Einstein-Podolsky-Rosen paradox implies a minimum achievable temperature." [http://journals.aps.org/pre/abstract/10.1103/PhysRevE.95.012149 Phys. Rev. E 95, 012149, 2017.] This paper provides measurement-based definitions of heat and work that can be realized in current laboratory setups. The first and second laws are proved despite the fact that temperature is treated completely as as a property of the interacting reservoir. Measurements of the work are subject to the famous EPR paradox because the work exchanged between two quantum systems is not defined until a measurement is performed. Based on this, we show that even an environment at absolute zero cannot lower a system's temperature below a minimum characteristic of the way the environment is coupled to the system. |- style="border: 1px solid darkgray;" || Guy W. Dayhoff II and David M. Rogers, "Driving forces in MD simulations of transition and ‘Free’ flows." [http://dx.doi.org/10.1080/08927022.2016.1273524 Mol. Sim. 43(5-6), pp. 467-477, 2017.] (special issue on Surface Chemistry) We set out to test the Joule-Thomson analysis of thermodynamics of porous flow for gasses through a nanopore and found that while local equilibrium is established in the steady-state, finite-size effects cause heat flow opposite the flow direction that violates the assumption of an adiabatic porous plug. |- style="border: 1px solid darkgray;" || David M. Rogers, "Efficient Primitives for Standard Tensor Linear Algebra." [https://doi.org/10.1145/2949550.2949580 Proc. XSEDE16 Conference on Diversity, Big Data, and Science at Scale, no. 14, 2016.] This paper introduces 3 basic functions that generalize BLAS to tensors and presents a code generation strategy for their efficient execution on GPUs that achieves peak performance on the same order of magnitude as for traditional, vendor-optimized matrix-multiplications. |- style="border: 1px solid darkgray;" || David M. Rogers, "Overcoming the Minimum Image Constraint Using the Closest Point Search." [http://dx.doi.org/10.1016/j.jmgm.2016.07.004 J. Mol. Graph. Model 68, pp. 197–205, 2016.] An elegant solution to the problem of finding periodic images in non-rectangular lattices is provided based on the closest vector problem. Related code is here: [https://github.com/frobnitzem/pbctools] |- style="border: 1px solid darkgray;" || Elisa La Bauve, Briana C. Vernon, Dongmei Ye, David M. Rogers, Cathryn M. Siegrist, Bryan Carson. Susan L. Rempe, Aihua Zheng, Margaret C. Kielian, Andrew P. Shreve, and Michael S. Kent. "Method for measuring the unbinding energy of strongly-bound membrane-associated proteins." [http://dx.doi.org/10.1016/j.bbamem.2016.07.004 BBA Biomembranes 1858(11): 2753–62, 2016.] This paper gives multiple experimental measurements of binding energy between the Dengue virus envelope protein and host membranes that largely confirm our computational predictions from 2015. I contributed all the theory for terminal velocity during sedimentation, along with a novel kinetic analysis providing the free energy and enthalpy of the dissociation barrier (all the details are at the end of the appendix). |- style="border: 1px solid darkgray;" || David M. Rogers. "Thermodynamics of Maximum Transition Entropy for Quantum Assemblies." [http://arxiv.org/abs/1503.01232 arXiv:1503.01232 submitted, 2016]. The work presents a new, general, theoretical foundation for the dynamics of open quantum systems modeled on the maximum entropy derivation of equilibrium statistical mechanics. Computational results are presented for three detailed systems to validate and reinforce the theory. It represents a significant advancement for the field, as it lucidly connects the dynamics of a single wavefunction plus environmental noise to the Caldeira-Leggett model for density matrices. |- style="border: 1px solid darkgray;" || Andriy Anishkin, Juan M. Vanegas, David M. Rogers, Philip L. Lorenzi, Wai Kin Chan, Preeti Purwaha, John N. Weinstein, Sergei Sukharev, and Susan B. Rempe. "Catalytic Role of the Substrate Defines Specificity of Therapeutic L-Asparaginase." [http://dx.doi.org/10.1016/j.jmb.2015.06.017 J. Mol. Biol. 427:2867-2885, 2015]. We present an explanation for the (until now controversial) catalytic mechanism of type 2 bacterial L-asparaginase enzymes. By using the carboxylic acid of the substrate (asparagine) as the proton acceptor, this enzyme is able to preferentially carry out deamidation on asparagine more quickly than for the competing substrate, glutamine. The hypothesis, re-discovered from our MD simulations, was first put forward years ago in contested experimental studies, and now finds additional support from our MD and QM calculations. |- style="border: 1px solid darkgray;" || David M. Rogers. "Towards a Direct, By-Need Evaluator for Dependently Typed Languages." [http://arxiv.org/abs/1509.07036 arXiv:1509.07036 submitted, 2015]. This paper describes the implementation of a new interpreted language for distributed parallel computing. It achieves its goal by maintaining pure functional semantics, allowing all terms in the language to be partially evaluated and serialized to network storage at any point during computation. |- style="border: 1px solid darkgray;" || Marielle Soniat, David M. Rogers, and Susan Rempe. "Dispersion- and Exchange-Corrected Density Functional Theory for Sodium Ion Hydration." [http://pubs.acs.org/doi/abs/10.1021/acs.jctc.5b00357 J. Chem. Theory. Comput. 142:074101, 2015]. We studied the influence of dispersion energy corrections on the free energy of formation for sodium-water clusters computed with DFT and wound up discovering that dispersion and split-range exchange functionals can somewhat counter-balance each other. The charged sodium ion pulls on the water's electrons, clearly showing which density functionals over-polarize compared to CCSD. Split-range exchange can reduce this over-polarization, but results in reduced electrostatic interaction. Dispersion can lower the binding energy again to counter-balance. So, functionals fit to experimental formation energies need both effects to avoid lowering energies by over-polarizing. |- style="border: 1px solid darkgray;" || David M. Rogers. "Real-space quadrature: a convenient, efficient representation for multipole expansions." [http://dx.doi.org/10.1063/1.4907404 J. Chem. Phys. 142:074101, 2015]. ([http://predictivestatmech.org/papers/real-poles.pdf Presentation]) I introduce sets of point charges that are able to simultaneously reproduce all multipole (spherical harmonic) expansions up to arbitrary order. The number of points is space-optimal. Translations are described from the usual harmonics and from Cartesian moments (dipole, quadrupole, etc.) on supersymmetric tensors to directional moments using the point weight distribution. Many applications are possible, including trivial implementation of multipoles in molecular mechanics and representing probability distributions over rotation space. |- style="border: 1px solid darkgray;" || David M. Rogers, Michael S. Kent, and Susan B. Rempe, "Molecular basis of endosomal-membrane association for the dengue virus envelope protein." [http://dx.doi.org/10.1016/j.bbamem.2014.12.018 BBA Biomembranes 1848(4):1041-52, 2015.] A fully atomistic potential of mean force for association of the viral envelope protein from Dengue virus was compared to a Poisson-Boltzmann electrostatic plus dispersion model. The results are consistent, showing hope for this type of combined scale simulation. |- style="border: 1px solid darkgray;" || Yaqin Fu, Binsong Li, Ying-Bing Jiang, Darren R. Dunphy, Andy Tsai, Siu-Yue Tam, Hongyou Fan, Hongxia Zhan, David Rogers, Susan Rempe, Plamen Atanassov, Joseph L. Cecchi, and C. Jeffrey Brinker "Atomic Layer Deposition of L-Alanine Polypeptide." [http://pubs.acs.org/doi/abs/10.1021/ja5043403 JACS 136(45):15821–4, 2014.] This paper with our experimental collaborators carried out blocked peptide synthesis by vapor-depositing Boc-L-alanine to create a uniform thin film of polypeptides grown on a silica substrate activated by aminopropyltrimethoxysilane. |- style="border: 1px solid darkgray;" || David M. Rogers. "Silmaril, A Functional Language for Distributed Parallel Evaluation." [http://predictivestatmech.org/sil/papers/sil.pdf Submitted version] |- style="border: 1px solid darkgray;" || Mathias B. Andersen, David M. Rogers, Junyu Mai, Benjamin Schudel, Anson V. Hatch, Susan B. Rempe and Ali Mani. "Spatiotemporal pH dynamics in concentration polarization near ion-selective membranes." [http://dx.doi.org/10.1021/la5014297 Langmuir, 30(26):7902–7912, 2014] |- style="border: 1px solid darkgray;" || W. K. Chan, P. L. Lorenzi, A. Anishkin, P. Purwaha, D. M. Rogers, S. Sukharev, S.B. Rempe, and J. N. Weinstein. "The glutaminase activity of l-asparaginase is not required for anticancer activity against ASNS-negative cells." [http://dx.doi.org/10.1182/blood-2013-10-535112 Blood. 123(23):3596-606, 2014]. |- style="border: 1px solid darkgray;" || David M. Rogers, Dian Jiao, Lawrence Pratt, and Susan B. Rempe. "Structural Models and Molecular Thermodynamics of Hydration of Ions and Small Molecules" [http://dx.doi.org/10.1016/B978-0-444-59440-2.00004-1 Annu. Rep. Comp. Chem. 8:71–127, 2012.] |- style="border: 1px solid darkgray;" || David M. Rogers and Susan B. Rempe. "Irreversible Thermodynamics." [http://dx.doi.org/10.1088/1742-6596/402/1/012014 J. Phys.: Conf. Ser. 402:012014, 2012]. |- style="border: 1px solid darkgray;" || David M. Rogers, Thomas L. Beck, and Susan B. Rempe. [[Media:Dmroge_InfoNonequ2011.pdf|"An Information Theory Approach to Nonlinear, Nonequilibrium Thermodynamics."]] [http://dx.doi.org/10.1007/s10955-011-0358-9 J. Stat. Phys. 145(2):385-409, 2011] We show how the interpretation of thermodynamic states as representing system information leads naturally to thermodynamic cycles and the first and second laws of thermodynamics as well as similar formulations for nontrivial nonequilibrium problems. The logical development of the theory also leads naturally to correct indistinguishability factors in the partition function. |- style="border: 1px solid darkgray;" || Sameer Varma, David M. Rogers, Lawrence R. Pratt, and Susan B. Rempe. "Perspectives on Ion Selectivity: Design Principles for K+ Selectivity in Membrane Transport." [http://jgp.rupress.org/content/137/6/479.full J. Gen. Physiol., 137(6):479-488, 2011.] We review the development of models for understanding the physical basis of selectivity for K+ ions over Na+, its sibling only one row behind, in membrane channels and transporters. Although the problem is subtle because of the morass of competing effects, we emphasize work analyzing the systematic influence of the environment on tipping local binding site structure toward selective configurations. |- style="border: 1px solid darkgray;" || David M. Rogers and Susan B. Rempe. [http://www.ncbi.nlm.nih.gov/pmc/articles/PMC3443978/ “Probing the Thermodynamics of Competitive Ion Binding Using Minimum Energy Structures.”] [http://dx.doi.org/10.1021/jp2012864 J. Phys. Chem. B, 115(29):9116-29, 2011]. We presented an extension of the Quasi-Chemical theory for quantifying the impact of local structure on ion complexation thermodynamics. The theory can be simply represented using a set of thermodynamic cycles involving binding site structural and compositional states as reaction intermediates. |- style="border: 1px solid darkgray;" || Susan B. Rempe and David M. Rogers; et. al. “Computational and experimental platform for understanding and optimizing water flux and salt rejection in nanoporous membranes.” [http://prod.sandia.gov/techlib/access-control.cgi/2010/106735.pdf Sandia Technical Report, SAND2010-6735, 2010.] We summarize work on designing polymer coatings for salt exclusion in water transporting nanopores. In this work, I collected available molecular dynamics results for these systems and performed a novel energy efficiency analysis able to relate atomistic and experimental scales as well as identify important design goals and chemical principles for material performance. |- style="border: 1px solid darkgray;" || David M. Rogers, [http://rave.ohiolink.edu/etdc/view?acc_num=ucin1251832030 ''''Using Bayes' Theorem for Free Energy Calculations''''], 2009. We investigated the central quantity of free energies in a Bayesian context and provide estimators for solvation free energies as well as optimal potential of mean force approximations to model polymer coarse-grained dynamics from atomistic simulations. |- style="border: 1px solid darkgray;" || Zhen Zhao, David M. Rogers and Thomas L. Beck. "Polarization and Charge Transfer in the Hydration of Chloride Ions." [http://link.aip.org/link/?JCP/132/014502/1 J. Chem. Phys., 132:014502, 2010.] Dr. Zhao's ab-initio analysis of the charge distribution in water-ion clusters highlighted the importance of many-body water-water interactions and charge transfer effects in determining cluster structural and energetic properties. These are still challenging to represent in modern polarizable forcefields and have implications for anion properties at interfaces. |- style="border: 1px solid darkgray;" || David M. Rogers and Thomas L. Beck. "Quasi-Chemical and Structural Analysis of Polarizable Anion Hydration." [http://link.aip.org/link/?JCP/132/014505/1 J. Chem. Phys., 132:014505, 2010.] The role of polarizability in forcefield-based models of ions and water was examined. Utilizing some of our recent developments on quasi-chemical theory, we have been able to quantify the tightened, asymmetric nature of the ion's local solvation waters induced by increased polarizability as well as the exact effects of polarization on the solvation free energy. The results suggest some potential problems and diagnostics for such models. |- style="border: 1px solid darkgray;" || David M. Rogers and Thomas L. Beck. [http://forcesolve.sourceforge.net/ Force Solve] (Sourceforge, Chicago IL, 2008). This force matching software implements and tests coarse-graining for general molecular systems in a mere 4000 lines of code. It is able to parametrize coarse Hamiltonians from atomic trajectory data given arbitrary definitions of coarse united-atom type models as well as carry out short Langevin Dynamics simulations on the coarse scale. The program's main drawbacks are its slow speed and high memory usage due to its simplistic design, attributable to the interpreted nature of python. |- style="border: 1px solid darkgray;" || David M. Rogers and Thomas L. Beck. "Resolution and Scale Independent Nonparametric Function Matching Using a String Energy Penalized Spline Prior." 2008. [http://arxiv.org/abs/1003.4741 arXiv:1003.4741v1] (stat.ML). Fresh insight is provided into long-standing mathematical issues surrounding computational modeling of continuous functions from a few sampled data points. The present research lays the groundwork for predicting the behavior of complicated many-body systems using advanced regression techniques. |} 89008976662164027f39c33eb5541a1ac167ab88 652 649 2018-03-19T19:26:13Z David M. Rogers 2 wikitext text/x-wiki {| cellpadding="4" style="border: 1px solid darkgray;" |- style="border: 1px solid darkgray;" || David M. Rogers, "Extension of Kirkwood-Buff theory to the canonical ensemble." [https://aip.scitation.org/doi/full/10.1063/1.5011696 J. Chem. Phys., 148:054102, 2018]. We present a way to utilize Essmann et. al.'s smooth particle mesh Ewald algorithm ([https://github.com/frobnitzem/EwaldCorrel implemented here]) to get the low-angle direct correlation function from canonical ensemble simulation data. The result avoids well-documented issues with long wavelength (small-angle scattering) modes that appear when using real-space methods. This result is combined with new estimates of finite-size effects and grand-canonical ensemble corrections to provide definitive results on the problem of extrapolating Kirkwood-Buff integrals. |- style="border: 1px solid darkgray;" || Juan M. Vanegas, Frank Heinrich, David M.Rogers, Bryan D. Carson, Sadie La Bauve, Briana C. Vernon, Bulent Akgun, Sushil Satija, Aihua Zheng, Margaret Kielian, Susan B. Rempe, and Michael S. Kent, "Insertion of Dengue E into lipid bilayers studied by neutron reflectivity and molecular dynamics simulations." [https://authors.elsevier.com/c/1WcOv1ClS9Jvp BBA 1860(5):1216-1230, 2018]. We compare neutron reflectivity experiments to molecular dynamics calculations on the orientation and binding position of the Dengue envelope protein responsible for viral escape from the host cell's endosome. In addition to the hydrophobic fusion tip, we find important roles for three positively-charged residues in the viral protein that contribute to host membrane binding. These could potentially be targeted by new anti-viral medicines. |- style="border: 1px solid darkgray;" || David M. Rogers, "An information theory model for dissipation in open quantum systems." [http://iopscience.iop.org/article/10.1088/1742-6596/880/1/012039 J. Phys., Conference Series 880(1):012039, 2017]. This paper presents a new, simple ansatz for adding dissipation to arbitrary stochastic forcing of a quantum dynamical system. For Gaussian random forces, it predicts a Lindblad equation identical to the Caldeira-Leggett model up to order <math>\beta^2</math>, where the same term is present with a different prefactor. The system-centric, phase space picture here shows that the <math>\beta^2</math> term represents a quantum confinement effect. |- style="border: 1px solid darkgray;" || David M. Rogers, "Einstein-Podolsky-Rosen paradox implies a minimum achievable temperature." [http://journals.aps.org/pre/abstract/10.1103/PhysRevE.95.012149 Phys. Rev. E 95, 012149, 2017.] This paper provides measurement-based definitions of heat and work that can be realized in current laboratory setups. The first and second laws are proved despite the fact that temperature is treated completely as as a property of the interacting reservoir. Measurements of the work are subject to the famous EPR paradox because the work exchanged between two quantum systems is not defined until a measurement is performed. Based on this, we show that even an environment at absolute zero cannot lower a system's temperature below a minimum characteristic of the way the environment is coupled to the system. |- style="border: 1px solid darkgray;" || Guy W. Dayhoff II and David M. Rogers, "Driving forces in MD simulations of transition and ‘Free’ flows." [http://dx.doi.org/10.1080/08927022.2016.1273524 Mol. Sim. 43(5-6), pp. 467-477, 2017.] (special issue on Surface Chemistry) We set out to test the Joule-Thomson analysis of thermodynamics of porous flow for gasses through a nanopore and found that while local equilibrium is established in the steady-state, finite-size effects cause heat flow opposite the flow direction that violates the assumption of an adiabatic porous plug. |- style="border: 1px solid darkgray;" || David M. Rogers, "Efficient Primitives for Standard Tensor Linear Algebra." [https://doi.org/10.1145/2949550.2949580 Proc. XSEDE16 Conference on Diversity, Big Data, and Science at Scale, no. 14, 2016.] This paper introduces 3 basic functions that generalize BLAS to tensors and presents a code generation strategy for their efficient execution on GPUs that achieves peak performance on the same order of magnitude as for traditional, vendor-optimized matrix-multiplications. |- style="border: 1px solid darkgray;" || David M. Rogers, "Overcoming the Minimum Image Constraint Using the Closest Point Search." [http://dx.doi.org/10.1016/j.jmgm.2016.07.004 J. Mol. Graph. Model 68, pp. 197–205, 2016.] An elegant solution to the problem of finding periodic images in non-rectangular lattices is provided based on the closest vector problem. Related code is here: [https://github.com/frobnitzem/pbctools] |- style="border: 1px solid darkgray;" || Elisa La Bauve, Briana C. Vernon, Dongmei Ye, David M. Rogers, Cathryn M. Siegrist, Bryan Carson. Susan L. Rempe, Aihua Zheng, Margaret C. Kielian, Andrew P. Shreve, and Michael S. Kent. "Method for measuring the unbinding energy of strongly-bound membrane-associated proteins." [http://dx.doi.org/10.1016/j.bbamem.2016.07.004 BBA Biomembranes 1858(11): 2753–62, 2016.] This paper gives multiple experimental measurements of binding energy between the Dengue virus envelope protein and host membranes that largely confirm our computational predictions from 2015. I contributed all the theory for terminal velocity during sedimentation, along with a novel kinetic analysis providing the free energy and enthalpy of the dissociation barrier (all the details are at the end of the appendix). |- style="border: 1px solid darkgray;" || David M. Rogers. "Thermodynamics of Maximum Transition Entropy for Quantum Assemblies." [http://arxiv.org/abs/1503.01232 arXiv:1503.01232 submitted, 2016]. The work presents a new, general, theoretical foundation for the dynamics of open quantum systems modeled on the maximum entropy derivation of equilibrium statistical mechanics. Computational results are presented for three detailed systems to validate and reinforce the theory. It represents a significant advancement for the field, as it lucidly connects the dynamics of a single wavefunction plus environmental noise to the Caldeira-Leggett model for density matrices. |- style="border: 1px solid darkgray;" || Andriy Anishkin, Juan M. Vanegas, David M. Rogers, Philip L. Lorenzi, Wai Kin Chan, Preeti Purwaha, John N. Weinstein, Sergei Sukharev, and Susan B. Rempe. "Catalytic Role of the Substrate Defines Specificity of Therapeutic L-Asparaginase." [http://dx.doi.org/10.1016/j.jmb.2015.06.017 J. Mol. Biol. 427:2867-2885, 2015]. We present an explanation for the (until now controversial) catalytic mechanism of type 2 bacterial L-asparaginase enzymes. By using the carboxylic acid of the substrate (asparagine) as the proton acceptor, this enzyme is able to preferentially carry out deamidation on asparagine more quickly than for the competing substrate, glutamine. The hypothesis, re-discovered from our MD simulations, was first put forward years ago in contested experimental studies, and now finds additional support from our MD and QM calculations. |- style="border: 1px solid darkgray;" || David M. Rogers. "Towards a Direct, By-Need Evaluator for Dependently Typed Languages." [http://arxiv.org/abs/1509.07036 arXiv:1509.07036 submitted, 2015]. This paper describes the implementation of a new interpreted language for distributed parallel computing. It achieves its goal by maintaining pure functional semantics, allowing all terms in the language to be partially evaluated and serialized to network storage at any point during computation. |- style="border: 1px solid darkgray;" || Marielle Soniat, David M. Rogers, and Susan Rempe. "Dispersion- and Exchange-Corrected Density Functional Theory for Sodium Ion Hydration." [http://pubs.acs.org/doi/abs/10.1021/acs.jctc.5b00357 J. Chem. Theory. Comput. 142:074101, 2015]. We studied the influence of dispersion energy corrections on the free energy of formation for sodium-water clusters computed with DFT and wound up discovering that dispersion and split-range exchange functionals can somewhat counter-balance each other. The charged sodium ion pulls on the water's electrons, clearly showing which density functionals over-polarize compared to CCSD. Split-range exchange can reduce this over-polarization, but results in reduced electrostatic interaction. Dispersion can lower the binding energy again to counter-balance. So, functionals fit to experimental formation energies need both effects to avoid lowering energies by over-polarizing. |- style="border: 1px solid darkgray;" || David M. Rogers. "Real-space quadrature: a convenient, efficient representation for multipole expansions." [http://dx.doi.org/10.1063/1.4907404 J. Chem. Phys. 142:074101, 2015]. ([http://predictivestatmech.org/papers/real-poles.pdf Presentation]) I introduce sets of point charges that are able to simultaneously reproduce all multipole (spherical harmonic) expansions up to arbitrary order. The number of points is space-optimal. Translations are described from the usual harmonics and from Cartesian moments (dipole, quadrupole, etc.) on supersymmetric tensors to directional moments using the point weight distribution. Many applications are possible, including trivial implementation of multipoles in molecular mechanics and representing probability distributions over rotation space. |- style="border: 1px solid darkgray;" || David M. Rogers, Michael S. Kent, and Susan B. Rempe, "Molecular basis of endosomal-membrane association for the dengue virus envelope protein." [http://dx.doi.org/10.1016/j.bbamem.2014.12.018 BBA Biomembranes 1848(4):1041-52, 2015.] A fully atomistic potential of mean force for association of the viral envelope protein from Dengue virus was compared to a Poisson-Boltzmann electrostatic plus dispersion model. The results are consistent, showing hope for this type of combined scale simulation. |- style="border: 1px solid darkgray;" || Yaqin Fu, Binsong Li, Ying-Bing Jiang, Darren R. Dunphy, Andy Tsai, Siu-Yue Tam, Hongyou Fan, Hongxia Zhan, David Rogers, Susan Rempe, Plamen Atanassov, Joseph L. Cecchi, and C. Jeffrey Brinker "Atomic Layer Deposition of L-Alanine Polypeptide." [http://pubs.acs.org/doi/abs/10.1021/ja5043403 JACS 136(45):15821–4, 2014.] This paper with our experimental collaborators carried out blocked peptide synthesis by vapor-depositing Boc-L-alanine to create a uniform thin film of polypeptides grown on a silica substrate activated by aminopropyltrimethoxysilane. |- style="border: 1px solid darkgray;" || David M. Rogers. "Silmaril, A Functional Language for Distributed Parallel Evaluation." [http://predictivestatmech.org/sil/papers/sil.pdf Submitted version] |- style="border: 1px solid darkgray;" || Mathias B. Andersen, David M. Rogers, Junyu Mai, Benjamin Schudel, Anson V. Hatch, Susan B. Rempe and Ali Mani. "Spatiotemporal pH dynamics in concentration polarization near ion-selective membranes." [http://dx.doi.org/10.1021/la5014297 Langmuir, 30(26):7902–7912, 2014] |- style="border: 1px solid darkgray;" || W. K. Chan, P. L. Lorenzi, A. Anishkin, P. Purwaha, D. M. Rogers, S. Sukharev, S.B. Rempe, and J. N. Weinstein. "The glutaminase activity of l-asparaginase is not required for anticancer activity against ASNS-negative cells." [http://dx.doi.org/10.1182/blood-2013-10-535112 Blood. 123(23):3596-606, 2014]. |- style="border: 1px solid darkgray;" || David M. Rogers, Dian Jiao, Lawrence Pratt, and Susan B. Rempe. "Structural Models and Molecular Thermodynamics of Hydration of Ions and Small Molecules" [http://dx.doi.org/10.1016/B978-0-444-59440-2.00004-1 Annu. Rep. Comp. Chem. 8:71–127, 2012.] |- style="border: 1px solid darkgray;" || David M. Rogers and Susan B. Rempe. "Irreversible Thermodynamics." [http://dx.doi.org/10.1088/1742-6596/402/1/012014 J. Phys.: Conf. Ser. 402:012014, 2012]. |- style="border: 1px solid darkgray;" || David M. Rogers, Thomas L. Beck, and Susan B. Rempe. [[Media:Dmroge_InfoNonequ2011.pdf|"An Information Theory Approach to Nonlinear, Nonequilibrium Thermodynamics."]] [http://dx.doi.org/10.1007/s10955-011-0358-9 J. Stat. Phys. 145(2):385-409, 2011] We show how the interpretation of thermodynamic states as representing system information leads naturally to thermodynamic cycles and the first and second laws of thermodynamics as well as similar formulations for nontrivial nonequilibrium problems. The logical development of the theory also leads naturally to correct indistinguishability factors in the partition function. |- style="border: 1px solid darkgray;" || Sameer Varma, David M. Rogers, Lawrence R. Pratt, and Susan B. Rempe. "Perspectives on Ion Selectivity: Design Principles for K+ Selectivity in Membrane Transport." [http://jgp.rupress.org/content/137/6/479.full J. Gen. Physiol., 137(6):479-488, 2011.] We review the development of models for understanding the physical basis of selectivity for K+ ions over Na+, its sibling only one row behind, in membrane channels and transporters. Although the problem is subtle because of the morass of competing effects, we emphasize work analyzing the systematic influence of the environment on tipping local binding site structure toward selective configurations. |- style="border: 1px solid darkgray;" || David M. Rogers and Susan B. Rempe. [http://www.ncbi.nlm.nih.gov/pmc/articles/PMC3443978/ “Probing the Thermodynamics of Competitive Ion Binding Using Minimum Energy Structures.”] [http://dx.doi.org/10.1021/jp2012864 J. Phys. Chem. B, 115(29):9116-29, 2011]. We presented an extension of the Quasi-Chemical theory for quantifying the impact of local structure on ion complexation thermodynamics. The theory can be simply represented using a set of thermodynamic cycles involving binding site structural and compositional states as reaction intermediates. |- style="border: 1px solid darkgray;" || Susan B. Rempe and David M. Rogers; et. al. “Computational and experimental platform for understanding and optimizing water flux and salt rejection in nanoporous membranes.” [http://prod.sandia.gov/techlib/access-control.cgi/2010/106735.pdf Sandia Technical Report, SAND2010-6735, 2010.] We summarize work on designing polymer coatings for salt exclusion in water transporting nanopores. In this work, I collected available molecular dynamics results for these systems and performed a novel energy efficiency analysis able to relate atomistic and experimental scales as well as identify important design goals and chemical principles for material performance. |- style="border: 1px solid darkgray;" || David M. Rogers, [http://rave.ohiolink.edu/etdc/view?acc_num=ucin1251832030 ''''Using Bayes' Theorem for Free Energy Calculations''''], 2009. We investigated the central quantity of free energies in a Bayesian context and provide estimators for solvation free energies as well as optimal potential of mean force approximations to model polymer coarse-grained dynamics from atomistic simulations. |- style="border: 1px solid darkgray;" || Zhen Zhao, David M. Rogers and Thomas L. Beck. "Polarization and Charge Transfer in the Hydration of Chloride Ions." [http://link.aip.org/link/?JCP/132/014502/1 J. Chem. Phys., 132:014502, 2010.] Dr. Zhao's ab-initio analysis of the charge distribution in water-ion clusters highlighted the importance of many-body water-water interactions and charge transfer effects in determining cluster structural and energetic properties. These are still challenging to represent in modern polarizable forcefields and have implications for anion properties at interfaces. |- style="border: 1px solid darkgray;" || David M. Rogers and Thomas L. Beck. "Quasi-Chemical and Structural Analysis of Polarizable Anion Hydration." [http://link.aip.org/link/?JCP/132/014505/1 J. Chem. Phys., 132:014505, 2010.] The role of polarizability in forcefield-based models of ions and water was examined. Utilizing some of our recent developments on quasi-chemical theory, we have been able to quantify the tightened, asymmetric nature of the ion's local solvation waters induced by increased polarizability as well as the exact effects of polarization on the solvation free energy. The results suggest some potential problems and diagnostics for such models. |- style="border: 1px solid darkgray;" || David M. Rogers and Thomas L. Beck. [http://forcesolve.sourceforge.net/ Force Solve] (Sourceforge, Chicago IL, 2008). This force matching software implements and tests coarse-graining for general molecular systems in a mere 4000 lines of code. It is able to parametrize coarse Hamiltonians from atomic trajectory data given arbitrary definitions of coarse united-atom type models as well as carry out short Langevin Dynamics simulations on the coarse scale. The program's main drawbacks are its slow speed and high memory usage due to its simplistic design, attributable to the interpreted nature of python. |- style="border: 1px solid darkgray;" || David M. Rogers and Thomas L. Beck. "Resolution and Scale Independent Nonparametric Function Matching Using a String Energy Penalized Spline Prior." 2008. [http://arxiv.org/abs/1003.4741 arXiv:1003.4741v1] (stat.ML). Fresh insight is provided into long-standing mathematical issues surrounding computational modeling of continuous functions from a few sampled data points. The present research lays the groundwork for predicting the behavior of complicated many-body systems using advanced regression techniques. |} == Manuscripts in Preparation/Submitted == * [https://arxiv.org/abs/1712.09427 Fluctuation Theory of Ionic Solvation Potentials] * [https://arxiv.org/abs/1503.01232 Thermodynamics of Maximum Transition Entropy for Quantum Assemblies] * [https://arxiv.org/abs/1701.01466 Maximum Entropy Closure for Flows in Transiently Driven Nonequilibrium Systems] a4ff3f5f864c0e6cb67182496d9a50a418e9867c File:Minimization2.pdf 6 150 651 2018-03-18T18:31:06Z David M. Rogers 2 wikitext text/x-wiki da39a3ee5e6b4b0d3255bfef95601890afd80709 File:Dynamics.pdf 6 151 654 2018-03-25T22:10:40Z David M. Rogers 2 wikitext text/x-wiki da39a3ee5e6b4b0d3255bfef95601890afd80709 Final2018 0 152 656 2018-03-27T16:21:42Z David M. Rogers 2 Created page with "The final project for the 2018 Intro. Scientific Computing is to reproduce all 15 figures from the paper, ``Stability and Hopf bifurcations in an inverted pendulum'' by Blackb..." wikitext text/x-wiki The final project for the 2018 Intro. Scientific Computing is to reproduce all 15 figures from the paper, ``Stability and Hopf bifurcations in an inverted pendulum'' by Blackburn, Smith, and Grønbeck-Jensen [https://aapt.scitation.org/doi/10.1119/1.17011]. Each student must hand in their own solutions for this project, but discussion groups of any size are encouraged. Note that there is an erratum published for this paper stating that the captions for Figures 5,6, and 7 were mis-placed. Caption 5 goes with Fig. 7, Caption 6 goes with Fig. 5, and Caption 7 goes with Fig. 6. Although you can use scipy's odeint, it is more appropriate to reproduce the data using the 4th order Runge-Kutta method that the original authors used. RK4 has been implemented by E. Hairer and G. Wanner from Universite de Geneve by calling from scipy.integrate import ode r = ode(f, jac).set_integrator('dopri5', method='bdf') ode.set_integrator("dopri5") before using '''scipy.integrate.ode''' [https://docs.scipy.org/doc/scipy/reference/generated/scipy.integrate.ode.html]. There is still a slight difference, since the above will use a variable time-step while the original authors used a fixed time-step. Variable time-step methods are generally better but have a different way of setting the acceptable integration error. 1454bda7b9ba318c10c712ff0a20338535b400fb 657 656 2018-03-27T16:31:57Z David M. Rogers 2 wikitext text/x-wiki The final project for the 2018 Intro. Scientific Computing is to reproduce all 15 figures from the paper, "Stability and Hopf bifurcations in an inverted pendulum" by Blackburn, Smith, and Grønbeck-Jensen [https://aapt.scitation.org/doi/10.1119/1.17011]. Each student must hand in their own solutions for this project, but discussion groups of any size are encouraged. Note that there is an erratum published for this paper stating that the captions for Figures 5,6, and 7 were mis-placed. Caption 5 goes with Fig. 7, Caption 6 goes with Fig. 5, and Caption 7 goes with Fig. 6. Although you can use scipy's odeint, it is more appropriate to reproduce the data using the 4th order Runge-Kutta method that the original authors used. It is implemented in [https://docs.scipy.org/doc/scipy/reference/generated/scipy.integrate.RK45.html#scipy.integrate.RK45 scipy.integrate.RK45]. There is still a slight difference, since the above will use a variable time-step while the original authors used a fixed time-step. Variable time-step methods are generally better but have a different way of setting the acceptable integration error. 2fdd9c2f75ec25c2d30c8d291637d585af1ee311 658 657 2018-03-29T14:01:45Z David M. Rogers 2 wikitext text/x-wiki The final project for the 2018 Intro. Scientific Computing is to reproduce figures 5 through 15 from the paper, "Stability and Hopf bifurcations in an inverted pendulum" by Blackburn, Smith, and Grønbeck-Jensen [https://aapt.scitation.org/doi/10.1119/1.17011]. Each student must hand in their own solutions for this project, but discussion groups of any size are encouraged. Note that there is an erratum published for this paper stating that the captions for Figures 5,6, and 7 were mis-placed. Caption 5 goes with Fig. 7, Caption 6 goes with Fig. 5, and Caption 7 goes with Fig. 6. Although you can use scipy's odeint, it is more appropriate to reproduce the data using the 4th order Runge-Kutta method that the original authors used. It is implemented in [https://docs.scipy.org/doc/scipy/reference/generated/scipy.integrate.RK45.html#scipy.integrate.RK45 scipy.integrate.RK45]. There is still a slight difference, since the above will use a variable time-step while the original authors used a fixed time-step. Variable time-step methods are generally better but have a different way of setting the acceptable integration error. 1ab816876861132261ae08be8c5defba2e0a9af9 File:InvPend.pdf 6 153 660 2018-04-01T00:43:11Z David M. Rogers 2 wikitext text/x-wiki da39a3ee5e6b4b0d3255bfef95601890afd80709 CompSciSpring2018 0 142 661 659 2018-04-04T17:50:46Z David M. Rogers 2 /* In-Class Problems */ wikitext text/x-wiki '''<BIG>Introduction to Scientific Computing</BIG>''' Course Info * Course Numbers CHM 4932-004/6938-010, CRN: 20438/20439 * Credit Hours: 3 * Meeting Dates: January 8 - April 25, 2018 ** No Class Jan. 15 or Mar. 12-18 * Meeting Times: Mon. and Wed., 12:30-13:45 in SCA 222 ** Midterm Project Presentations: Mon.-Wed., Mar 5 and 7. ** Final Project Presentations: Wed., May 2, 10:00am – 12:00pm (scheduled final date) ** Lab Session & Office Hours: Fri. 12:30-13:45 in IDR 214 (or SCA 222 by announcement) <pre> $ for((i=1;i<=4;i++)); do cal $i 2018; done ____ January 2018 ____ _____ March 2018 ____ | Su Mo Tu We Th Fr Sa | | Su Mo Tu We Th Fr Sa | 1 2 3 4 5 6 | | 1 (2) 3 1 | 7 8 9*10 11 12 13 | 9 | 4 (5) 6 (7) 8 9 10 2 | 14 x 16*17 18 19 20 | | x x 3 | 21*22 23 24 25 26 27 | 10 | 18*19 20 21 22 23 24 4 | 28*29 30 31 | 11 | 25*26 27 28 29 30 31 ___ February 2018 ____ _____ April 2018 ____ | Su Mo Tu We Th Fr Sa | | Su Mo Tu We Th Fr Sa | 1 2 3 | 12 | 1 *2 3 4 5 6 7 5 | 4 *5 6 7 8 9 10 | 13 | 8 *9 10 11 12 13 14 6 | 11*12 13 14 15 16 17 | 14 | 15*16 17 18 19 20 21 7 | 18*19 20 21 22 23 24 | 15 | 22*23 24(25)26 27 28 8 | 25*26 27 28 | | 29 x Week Topic 1 Calculator Form 2 Pseudocode 3 Plotting 1 (Excel) 4 Plotting 2 (Matplotlib and linear spaces) 5 Abstraction 1 (advanced functions and oo method) 6 Abstraction 2 (Booleans and logic) 7 2D transforms and iterated maps 8 Optimization 1 (Newton-Rhapson) 9 midterm project presentations 10 Optimization 2 (MD Energy) 11 ODE and SDE algorithms 12 Statistics 13 Complexity 14 Circe and Linux crash course 15 Compile & install process, ctypes </pre> == Overview == Mathematical models in the natural sciences take many shapes and forms. The moment they become more complicated than tracking a few variables over time, we have to put away our Excel spreadsheets and make use of a solid foundation in computational science. The course establishes this foundation by introducing data structures and algorithms used in everyday scientific computing using examples in the python scripting language. By the end of the Semester, students will be able to navigate the Linux command-line to go from a mathematical model to a numerical solution. Best practices for working with computer code and visualizing data will also be covered. == Topics == # Languages #* bash (shell) #* python (scripting) #* stack & register-based machine languages: overview of C and Fortran syntax & compiling with gcc, ‘thread safety’ #* Shared libraries & language inter-operability (FFI) # Algorithms #* Horner’s algorithm for polynomials #* Newton’s root finding algo. #* Overview of general optimization algo-s (example: linear & nonlin. least-squares) #* Numerical integration (scripted, plus gnu ODE) #* Communication (how HTTP get/put works) # Data Structures #* Linked Lists #* Trees (file system hierarchies) #* Graphs #* Arrays (dense & sparse) example: vectors & rotations / transpositions, densities and difference operators # Presentation & visualization #* Flat CSV files (and excel) #* Working with binary data #* Python matplotlib (2D images) #* Binning histograms & weighted averages # Best Practices #* High-level code design (modularity, interface specifications, unit testing, etc.) #* Code audit: open-source libraries, ex. Gnu Scientific Library, qsort in libc, Boost #* Source code versioning (example: git or mercurial) #* gdb & execution profiling #* documentation #* Makefiles == Grading == '''Grading Scale (out of 400 points possible)''' {| class="wikitable" |- ! Grade ! Undergraduate ! Graduate |- | A+ | 269 | 323 |- | A | 258 | 310 |- | A- | 250 | 300 |- | B+ | 241 | 290 |- | B | 230 | 276 |- | B- | 222 | 266 |- | C+ | 213 | 256 |- | C | 202 | 243 |- | C- | 194 | 233 |- | D+ | 186 | 223 |- | D | 175 | 210 |- | D- | 166 | 200 |} * (280 U / 330 G) Points Possible: ** 9 homework assignments (10 points per homework) ** 14 in-class assignments / quizzes (10 points per week) ** 2 projects / competitions (50 points per project) ** Undergraduates must complete 1 project, graduates must complete 2 * Important Rules ** For maximum benefit, homework should be done on-time. However, homework will be allowed to be re-submitted at any time for full credit, but must present a unique solution to previous work from yourself or others. ** All work must cite co-group members (if any) and the source of any code snippets used online. === Grading Rationale === Homework points will only be awarded for correct, working code and correct algorithmic analysis, while the homework problems will become progressively tougher. Undergraduates should be able to pass the course with an A if they have correctly answered most of the homework, appear at class prepared and on-time, and made a strong attempt at one of the projects. Graduate students should both perform well on the homework and successfully complete one or two projects. The re-grading for homework allows making up for missed assignments, and encourages returning to core concepts at a later point in the class. Students who have put in the studying effort, completed significant portions of the homework and projects both in- and out of class have thus demonstrated introductory programming proficiency. == Projects == * Midterm Project Description [[Media:Midterm2018.pdf]] (2 Mar., 2018) ** [[Agile|Agile Development Tips & Tricks]] * Midterm Projects: <!-- ** Luis & Matteo [https://drive.google.com/file/d/1tTkwRuJts2SnZcEkVlHO51ItacFfHYL3/view?usp=sharing_eil&ts=5a9d6cb2] ** Misty & Cherinee [https://docs.google.com/presentation/d/17UTtjv-2d19mTtYt9oVwrWI5eOuo7l2qg4zYsOGXTxw/edit?ts=5a9d7601#slide=id.gc6f90357f_0_0] ** Pauline [http://predictivestatmech.org/code/pauline.py] ** Nasha [http://predictivestatmech.org/code/nasha.py] ** Daniel [https://drive.google.com/drive/folders/1NNQEG7O8Pi1jGeMaPwcWYEBVI62BhYgD?usp=sharing] ** Melissa, Casidy & Paul [https://docs.google.com/presentation/d/10U8loA8uPMypoEWO163e6smZ9JnrPXjyQl97Duz8Hg8/edit?usp=sharing_eip&ts=5a9d6081] ** Kimberly [http://predictivestatmech.org/code/kimberly.py] ** Eric ** Jovina & Jesunifemi [http://predictivestatmech.org/code/jovina-nifemi.py] ** Jakin [https://docs.google.com/presentation/d/1LFh-_n6J2jC6FBEl-X4WTJqYyhwjnVucGdMBKsUFsjU/edit?usp=sharing_eip&ts=5a9d8fa1] ** Bryan [http://predictivestatmech.org/code/bryan.py] --> * [[Final2018|Final Project Description]] (25 Apr., 2018) == Textbooks and Resources == * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-0072-7 Beginning Python, Hetland, 2005] (eBook avail. from USF Library) * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-3238-4 Python Algorithms, Hetland, 2010] (eBook avail. from USF Library) * [http://aosabook.org/en/index.html The Architecture of Open Source Applications] * [http://docs.python.org Python Documentation] * [https://developers.google.com/edu/python/ Google Introductory Python Notes] * [http://huffman.sourceforge.net/tao/tao-of-programming.html Tao of Programming] Other (possibly useful) materials: * [http://hackersdictionary.com/html/entry/larval-stage.html The Jargon File] * Chapters 7&8 of Modelling and Simulation, Birta and Arbez, Springer 2007 (eBook avail. from USF Library). * Chapters 4-6 of Models and Algorithms for Intelligent Data Analysis, Runkler, Springer 2012 (eBook avail. from USF Library). * Guide to Scientific Computing in C++, Francis and Whiteley, Springer, 2012. (eBook avail. from USF Library) * Extra info. On the basics: ** Chapters 3 and 7 of Mathematics in Computing, Regan, Springer 2013. (eBook avail. from USF Library) ** Instant feedback graphical programming with [https://www.khanacademy.org/cs/programming/ Khan Academy] * [http://www.meetup.com/python-178/ Local PyBulls Meetings] Code: * [http://carsonfarmer.com/2013/07/essential-python-geo-libraries Python Libraries Useful for Geospatial Problems] * [[Code#Python_Libraries|Python Libraries Useful for Computational Chemistry]] (very small list at present) Interactive Interpreters: * [http://www.codewars.com CodeWars] Recommended for building experience with practice problems. * [http://codecombat.com/ CodeCombat] A very visual way to interact with your python code. * [http://exercism.io Exercism] A command-line client with a similar learn-through-challenge philosophy. * [http://repl.it repl.it] A read-eval-print loop for several computer languages. * [http://en.cppreference.com/w/cpp/language CppReference] Documentation with an online evaluator for C++ code. === Notes === * [[Media:Intro.pdf|Introduction Notes]] * [[Media:Week2.pdf|Function Syntax]] and [[Media:Week3.pdf|For-Loop Syntax]] cheat-sheets. * [[Media:PlottingMaps.pdf|Plotting Maps]] <!-- ** [[Turing Exercise]] ** [https://predictivestatmech.org/code/example.dcd Example DCD File] * [[Media:Week-5.2017.pdf|Week 5 Notes]] * [[Media:PlottingMaps.pdf|Week 6 Notes]] ** [[Code:PyTesting]] * [[Media:NumpyArrays.pdf|Week 7 Notes]] ** [http://www.labri.fr/perso/nrougier/from-python-to-numpy/ all about numpy] * Misc. Notes for Week 8 ** [[Physics:Pairs|Rundown of Pair Interactions]] ** Parameterized surfaces [[Media:param1.jpg|1]] and [[Media:param2.jpg|2]] * Notes for Compilation Lab ** [https://learnpythonthehardway.org/book/appendixa.html Command Line Crash Course] Cheat sheet for bash commands. ** USF's compute cluster documentation at [https://wiki.rc.usf.edu/index.php/Main_Page RC Wiki]. *** See especially the "Connecting to SC" and "Modules" sections ** [[Code:Compiling|Cheat-codes]] for compilation lab. * [[Media:jobs.pdf|Research Computing Batch Queue]] * [[Media:Plug-in.pdf|Plugging Into Libraries]] * [[Media:Matrix.pdf|Matrix Algorithms]] --> === Review Notes on Sequences, list comprehensions and arrays === <source lang="python"> # Say you want to make a plot of the LJ function on the domain x \in [0.9, 3] # 1. You could use the following two list comprehensions to be specific: x = [ i*(3-0.9)/100.0 + 0.9 for i in range(101) ] y = [ 4*(xi**-12 - xi**-6) for xi in x] # 2. You could implement the LJ function as a python function and use MAP, def LJ(x): ix6 = x**-6 # the factoring makes this calculation more efficient return 4*ix6*(ix6 + 1.0) y = map(LJ, x) # 3. You could work on arrays, where addition, multiplication, and powers are elementwise: ax = arange(101)*(3-0.9)/100 + 0.9 ay = LJ(ax) # Mind the difference in type! type(x) type(ax) # 4. You could totally cheat, and use numpy's builtin functions. ax = linspace(0.9, 3.0, 101) # Exercise: replicate the steps above to test the finite difference computation # of the derivative against the analytical derivative of LJ. [ (y[i+1]-y[i])/(x[i+1]-x[i]) for i in ... import matplotlib.pyplot as plt plt.plot(x, y) plt.show() </source> === Review Notes on Functions with Function arguments (functionals) === <source lang="python"> # map : (a -> b), [ a ] -> [ b ] # map: map(str, [1,2,3]) --> [ "1", "2", "3" ] # ^ function (a -> b) # map(int, map(str, [1,2,3]) ) # - helpful for parsing # x = "1 2 3 4 5" # x.split() # ["1", "2", "3", "4", "5"] # map(int, x.split()) # [1,2,3,4,5] str([1,2,3]) # "[1, 2, 3]" (bad) map(str, [1,2,3]) # ["1", "2", "3"] (good) # filter: (a -> Bool), [a] -> [a] # Example filter: # '1' -> no # ' ' -> no # 'a-z' -> yes # 'A-Z' -> yes def f(x): # str -> Bool if x >= 'a' and x <= 'z': return True if x >= 'A' and x <= 'Z': return True return False filter(f, " 1 a b 2 \n") # reduce: (a,b -> a), [b], a -> a sum([1,2,3]) # -> 6 def add2(x,y): # x : int, y : int return x+y reduce(add2, [1,2,3], 0) # For an example where a != b: def append(x,y): # x : [int], y : int return x + [y] reduce(append, [1,2,3], []) # start with an empty list # Newton-Rhapson def nrhap(f, fp, x0, tol = 1e-6): y = f(x0) iter = 0 # guard against infinity while abs(y) > tol: iter += 1 if iter > 1000: raise ValueError, "Unable to converge!" x0 -= y/fp(x0) y = f(x0) return x0 # solve x^3 - 2 = 0 def f(x): return x**3 - 2 def fp(x): return 3*x**2 print( nrhap(f, fp, 1.0)**3 ) </source> === In-Class Problems === * Week 1: [[Media:CalculatorProbs.pdf|Calculator Problems]] ** Solutions: [http://predictivestatmech.org/terms/term.html] ** This solution uses python list comprehensions, and shows that the slowest step is actually unit conversion! * Week 2: [[Media:Pseudocode.pdf|Pseudocode Problems]] ** We will work these in class. For practice, be sure you have python list ideas down! ** Solutions: [https://docs.google.com/document/d/1HRkSdVNsTUydY4cVx67jRHRyhi5gL6nneEj9IX89wlE/edit?usp=sharing] * Week 3: [[Media:Plotting1.pdf|Plotting 1]] ** [https://stackoverflow.com/questions/11815538/how-to-import-matplotlib-in-python#11830055 Notes on installing Matplotlib on your own computer] ** Challenge: actions vs. functions -- what does the following code do: "[ print(1) for i in range(10) ]" (python3 only) * Week 4: [[Media:Plotting2.pdf|Plotting 2]] ** Solutions: [https://docs.google.com/document/d/1AanEFQmxLxoNM-662MHxsxToY3wsqovNx6SwcPQuBIg/edit?usp=sharing] * Week 5: Read pseudocode and plotting, focusing on types and syntax. Also, re-read the end of chapter summaries for Ch. 3, 5 and 6. * Week 6: Read the following pieces on first order logic [http://bayes.wustl.edu/etj/prob/book.pdf Chapter 1 of Jaynes' Book] [http://web.cecs.pdx.edu/~cs410aph/Lectures/Smalltalk%20II/Dijkstra%20on%20Hamming%27s%20Problem.pdf Hamming's Problem], and pages 71-80 in Chapter 4 of Hetland's Algorithms book (on induction). Just skip directly to chapter 4. ** Solutions [https://docs.google.com/document/d/14QZxh2SAWl3JE-SzVyemkAv4p9TBChO-jzZ5YpT8BZs/edit?usp=sharing] * Week 7: Review Hetland, Chapters 3-7. We'll do a series of parsing problems and flex our collective induction and recursion muscles. ** [https://docs.google.com/document/d/1i04oL7zJsD3KzvsPIaHBgwaOZ78UZvz5ReRDF-PlyF0/edit?usp=sharing Week 7 Problems] * Week 8: [[Media:Minimization1.pdf|Minimization Problems!]] * Week 10: [[Media:Minimization2.pdf|Molecular Optimization]] * Week 11: [[Media:Dynamics.pdf|Dynamical Problems]] * Week 12: [[Media:InvPend.pdf|Inverse Pendulum]] ** [[Simulating Rule 110]] === Homework === * Homework will be assigned through Repl.IT * Project presentations will be on Mon.-Wed., Mar 5-7 * Final Project presentations will be during exam time, Wed., May 2 534f7c16f7cdcc8310cd63015b8a5072dbf04933 664 661 2018-04-09T02:24:06Z David M. Rogers 2 /* In-Class Problems */ wikitext text/x-wiki '''<BIG>Introduction to Scientific Computing</BIG>''' Course Info * Course Numbers CHM 4932-004/6938-010, CRN: 20438/20439 * Credit Hours: 3 * Meeting Dates: January 8 - April 25, 2018 ** No Class Jan. 15 or Mar. 12-18 * Meeting Times: Mon. and Wed., 12:30-13:45 in SCA 222 ** Midterm Project Presentations: Mon.-Wed., Mar 5 and 7. ** Final Project Presentations: Wed., May 2, 10:00am – 12:00pm (scheduled final date) ** Lab Session & Office Hours: Fri. 12:30-13:45 in IDR 214 (or SCA 222 by announcement) <pre> $ for((i=1;i<=4;i++)); do cal $i 2018; done ____ January 2018 ____ _____ March 2018 ____ | Su Mo Tu We Th Fr Sa | | Su Mo Tu We Th Fr Sa | 1 2 3 4 5 6 | | 1 (2) 3 1 | 7 8 9*10 11 12 13 | 9 | 4 (5) 6 (7) 8 9 10 2 | 14 x 16*17 18 19 20 | | x x 3 | 21*22 23 24 25 26 27 | 10 | 18*19 20 21 22 23 24 4 | 28*29 30 31 | 11 | 25*26 27 28 29 30 31 ___ February 2018 ____ _____ April 2018 ____ | Su Mo Tu We Th Fr Sa | | Su Mo Tu We Th Fr Sa | 1 2 3 | 12 | 1 *2 3 4 5 6 7 5 | 4 *5 6 7 8 9 10 | 13 | 8 *9 10 11 12 13 14 6 | 11*12 13 14 15 16 17 | 14 | 15*16 17 18 19 20 21 7 | 18*19 20 21 22 23 24 | 15 | 22*23 24(25)26 27 28 8 | 25*26 27 28 | | 29 x Week Topic 1 Calculator Form 2 Pseudocode 3 Plotting 1 (Excel) 4 Plotting 2 (Matplotlib and linear spaces) 5 Abstraction 1 (advanced functions and oo method) 6 Abstraction 2 (Booleans and logic) 7 2D transforms and iterated maps 8 Optimization 1 (Newton-Rhapson) 9 midterm project presentations 10 Optimization 2 (MD Energy) 11 ODE and SDE algorithms 12 Statistics 13 Complexity 14 Circe and Linux crash course 15 Compile & install process, ctypes </pre> == Overview == Mathematical models in the natural sciences take many shapes and forms. The moment they become more complicated than tracking a few variables over time, we have to put away our Excel spreadsheets and make use of a solid foundation in computational science. The course establishes this foundation by introducing data structures and algorithms used in everyday scientific computing using examples in the python scripting language. By the end of the Semester, students will be able to navigate the Linux command-line to go from a mathematical model to a numerical solution. Best practices for working with computer code and visualizing data will also be covered. == Topics == # Languages #* bash (shell) #* python (scripting) #* stack & register-based machine languages: overview of C and Fortran syntax & compiling with gcc, ‘thread safety’ #* Shared libraries & language inter-operability (FFI) # Algorithms #* Horner’s algorithm for polynomials #* Newton’s root finding algo. #* Overview of general optimization algo-s (example: linear & nonlin. least-squares) #* Numerical integration (scripted, plus gnu ODE) #* Communication (how HTTP get/put works) # Data Structures #* Linked Lists #* Trees (file system hierarchies) #* Graphs #* Arrays (dense & sparse) example: vectors & rotations / transpositions, densities and difference operators # Presentation & visualization #* Flat CSV files (and excel) #* Working with binary data #* Python matplotlib (2D images) #* Binning histograms & weighted averages # Best Practices #* High-level code design (modularity, interface specifications, unit testing, etc.) #* Code audit: open-source libraries, ex. Gnu Scientific Library, qsort in libc, Boost #* Source code versioning (example: git or mercurial) #* gdb & execution profiling #* documentation #* Makefiles == Grading == '''Grading Scale (out of 400 points possible)''' {| class="wikitable" |- ! Grade ! Undergraduate ! Graduate |- | A+ | 269 | 323 |- | A | 258 | 310 |- | A- | 250 | 300 |- | B+ | 241 | 290 |- | B | 230 | 276 |- | B- | 222 | 266 |- | C+ | 213 | 256 |- | C | 202 | 243 |- | C- | 194 | 233 |- | D+ | 186 | 223 |- | D | 175 | 210 |- | D- | 166 | 200 |} * (280 U / 330 G) Points Possible: ** 9 homework assignments (10 points per homework) ** 14 in-class assignments / quizzes (10 points per week) ** 2 projects / competitions (50 points per project) ** Undergraduates must complete 1 project, graduates must complete 2 * Important Rules ** For maximum benefit, homework should be done on-time. However, homework will be allowed to be re-submitted at any time for full credit, but must present a unique solution to previous work from yourself or others. ** All work must cite co-group members (if any) and the source of any code snippets used online. === Grading Rationale === Homework points will only be awarded for correct, working code and correct algorithmic analysis, while the homework problems will become progressively tougher. Undergraduates should be able to pass the course with an A if they have correctly answered most of the homework, appear at class prepared and on-time, and made a strong attempt at one of the projects. Graduate students should both perform well on the homework and successfully complete one or two projects. The re-grading for homework allows making up for missed assignments, and encourages returning to core concepts at a later point in the class. Students who have put in the studying effort, completed significant portions of the homework and projects both in- and out of class have thus demonstrated introductory programming proficiency. == Projects == * Midterm Project Description [[Media:Midterm2018.pdf]] (2 Mar., 2018) ** [[Agile|Agile Development Tips & Tricks]] * Midterm Projects: <!-- ** Luis & Matteo [https://drive.google.com/file/d/1tTkwRuJts2SnZcEkVlHO51ItacFfHYL3/view?usp=sharing_eil&ts=5a9d6cb2] ** Misty & Cherinee [https://docs.google.com/presentation/d/17UTtjv-2d19mTtYt9oVwrWI5eOuo7l2qg4zYsOGXTxw/edit?ts=5a9d7601#slide=id.gc6f90357f_0_0] ** Pauline [http://predictivestatmech.org/code/pauline.py] ** Nasha [http://predictivestatmech.org/code/nasha.py] ** Daniel [https://drive.google.com/drive/folders/1NNQEG7O8Pi1jGeMaPwcWYEBVI62BhYgD?usp=sharing] ** Melissa, Casidy & Paul [https://docs.google.com/presentation/d/10U8loA8uPMypoEWO163e6smZ9JnrPXjyQl97Duz8Hg8/edit?usp=sharing_eip&ts=5a9d6081] ** Kimberly [http://predictivestatmech.org/code/kimberly.py] ** Eric ** Jovina & Jesunifemi [http://predictivestatmech.org/code/jovina-nifemi.py] ** Jakin [https://docs.google.com/presentation/d/1LFh-_n6J2jC6FBEl-X4WTJqYyhwjnVucGdMBKsUFsjU/edit?usp=sharing_eip&ts=5a9d8fa1] ** Bryan [http://predictivestatmech.org/code/bryan.py] --> * [[Final2018|Final Project Description]] (25 Apr., 2018) == Textbooks and Resources == * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-0072-7 Beginning Python, Hetland, 2005] (eBook avail. from USF Library) * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-3238-4 Python Algorithms, Hetland, 2010] (eBook avail. from USF Library) * [http://aosabook.org/en/index.html The Architecture of Open Source Applications] * [http://docs.python.org Python Documentation] * [https://developers.google.com/edu/python/ Google Introductory Python Notes] * [http://huffman.sourceforge.net/tao/tao-of-programming.html Tao of Programming] Other (possibly useful) materials: * [http://hackersdictionary.com/html/entry/larval-stage.html The Jargon File] * Chapters 7&8 of Modelling and Simulation, Birta and Arbez, Springer 2007 (eBook avail. from USF Library). * Chapters 4-6 of Models and Algorithms for Intelligent Data Analysis, Runkler, Springer 2012 (eBook avail. from USF Library). * Guide to Scientific Computing in C++, Francis and Whiteley, Springer, 2012. (eBook avail. from USF Library) * Extra info. On the basics: ** Chapters 3 and 7 of Mathematics in Computing, Regan, Springer 2013. (eBook avail. from USF Library) ** Instant feedback graphical programming with [https://www.khanacademy.org/cs/programming/ Khan Academy] * [http://www.meetup.com/python-178/ Local PyBulls Meetings] Code: * [http://carsonfarmer.com/2013/07/essential-python-geo-libraries Python Libraries Useful for Geospatial Problems] * [[Code#Python_Libraries|Python Libraries Useful for Computational Chemistry]] (very small list at present) Interactive Interpreters: * [http://www.codewars.com CodeWars] Recommended for building experience with practice problems. * [http://codecombat.com/ CodeCombat] A very visual way to interact with your python code. * [http://exercism.io Exercism] A command-line client with a similar learn-through-challenge philosophy. * [http://repl.it repl.it] A read-eval-print loop for several computer languages. * [http://en.cppreference.com/w/cpp/language CppReference] Documentation with an online evaluator for C++ code. === Notes === * [[Media:Intro.pdf|Introduction Notes]] * [[Media:Week2.pdf|Function Syntax]] and [[Media:Week3.pdf|For-Loop Syntax]] cheat-sheets. * [[Media:PlottingMaps.pdf|Plotting Maps]] <!-- ** [[Turing Exercise]] ** [https://predictivestatmech.org/code/example.dcd Example DCD File] * [[Media:Week-5.2017.pdf|Week 5 Notes]] * [[Media:PlottingMaps.pdf|Week 6 Notes]] ** [[Code:PyTesting]] * [[Media:NumpyArrays.pdf|Week 7 Notes]] ** [http://www.labri.fr/perso/nrougier/from-python-to-numpy/ all about numpy] * Misc. Notes for Week 8 ** [[Physics:Pairs|Rundown of Pair Interactions]] ** Parameterized surfaces [[Media:param1.jpg|1]] and [[Media:param2.jpg|2]] * Notes for Compilation Lab ** [https://learnpythonthehardway.org/book/appendixa.html Command Line Crash Course] Cheat sheet for bash commands. ** USF's compute cluster documentation at [https://wiki.rc.usf.edu/index.php/Main_Page RC Wiki]. *** See especially the "Connecting to SC" and "Modules" sections ** [[Code:Compiling|Cheat-codes]] for compilation lab. * [[Media:jobs.pdf|Research Computing Batch Queue]] * [[Media:Plug-in.pdf|Plugging Into Libraries]] * [[Media:Matrix.pdf|Matrix Algorithms]] --> === Review Notes on Sequences, list comprehensions and arrays === <source lang="python"> # Say you want to make a plot of the LJ function on the domain x \in [0.9, 3] # 1. You could use the following two list comprehensions to be specific: x = [ i*(3-0.9)/100.0 + 0.9 for i in range(101) ] y = [ 4*(xi**-12 - xi**-6) for xi in x] # 2. You could implement the LJ function as a python function and use MAP, def LJ(x): ix6 = x**-6 # the factoring makes this calculation more efficient return 4*ix6*(ix6 + 1.0) y = map(LJ, x) # 3. You could work on arrays, where addition, multiplication, and powers are elementwise: ax = arange(101)*(3-0.9)/100 + 0.9 ay = LJ(ax) # Mind the difference in type! type(x) type(ax) # 4. You could totally cheat, and use numpy's builtin functions. ax = linspace(0.9, 3.0, 101) # Exercise: replicate the steps above to test the finite difference computation # of the derivative against the analytical derivative of LJ. [ (y[i+1]-y[i])/(x[i+1]-x[i]) for i in ... import matplotlib.pyplot as plt plt.plot(x, y) plt.show() </source> === Review Notes on Functions with Function arguments (functionals) === <source lang="python"> # map : (a -> b), [ a ] -> [ b ] # map: map(str, [1,2,3]) --> [ "1", "2", "3" ] # ^ function (a -> b) # map(int, map(str, [1,2,3]) ) # - helpful for parsing # x = "1 2 3 4 5" # x.split() # ["1", "2", "3", "4", "5"] # map(int, x.split()) # [1,2,3,4,5] str([1,2,3]) # "[1, 2, 3]" (bad) map(str, [1,2,3]) # ["1", "2", "3"] (good) # filter: (a -> Bool), [a] -> [a] # Example filter: # '1' -> no # ' ' -> no # 'a-z' -> yes # 'A-Z' -> yes def f(x): # str -> Bool if x >= 'a' and x <= 'z': return True if x >= 'A' and x <= 'Z': return True return False filter(f, " 1 a b 2 \n") # reduce: (a,b -> a), [b], a -> a sum([1,2,3]) # -> 6 def add2(x,y): # x : int, y : int return x+y reduce(add2, [1,2,3], 0) # For an example where a != b: def append(x,y): # x : [int], y : int return x + [y] reduce(append, [1,2,3], []) # start with an empty list # Newton-Rhapson def nrhap(f, fp, x0, tol = 1e-6): y = f(x0) iter = 0 # guard against infinity while abs(y) > tol: iter += 1 if iter > 1000: raise ValueError, "Unable to converge!" x0 -= y/fp(x0) y = f(x0) return x0 # solve x^3 - 2 = 0 def f(x): return x**3 - 2 def fp(x): return 3*x**2 print( nrhap(f, fp, 1.0)**3 ) </source> === In-Class Problems === * Week 1: [[Media:CalculatorProbs.pdf|Calculator Problems]] ** Solutions: [http://predictivestatmech.org/terms/term.html] ** This solution uses python list comprehensions, and shows that the slowest step is actually unit conversion! * Week 2: [[Media:Pseudocode.pdf|Pseudocode Problems]] ** We will work these in class. For practice, be sure you have python list ideas down! ** Solutions: [https://docs.google.com/document/d/1HRkSdVNsTUydY4cVx67jRHRyhi5gL6nneEj9IX89wlE/edit?usp=sharing] * Week 3: [[Media:Plotting1.pdf|Plotting 1]] ** [https://stackoverflow.com/questions/11815538/how-to-import-matplotlib-in-python#11830055 Notes on installing Matplotlib on your own computer] ** Challenge: actions vs. functions -- what does the following code do: "[ print(1) for i in range(10) ]" (python3 only) * Week 4: [[Media:Plotting2.pdf|Plotting 2]] ** Solutions: [https://docs.google.com/document/d/1AanEFQmxLxoNM-662MHxsxToY3wsqovNx6SwcPQuBIg/edit?usp=sharing] * Week 5: Read pseudocode and plotting, focusing on types and syntax. Also, re-read the end of chapter summaries for Ch. 3, 5 and 6. * Week 6: Read the following pieces on first order logic [http://bayes.wustl.edu/etj/prob/book.pdf Chapter 1 of Jaynes' Book] [http://web.cecs.pdx.edu/~cs410aph/Lectures/Smalltalk%20II/Dijkstra%20on%20Hamming%27s%20Problem.pdf Hamming's Problem], and pages 71-80 in Chapter 4 of Hetland's Algorithms book (on induction). Just skip directly to chapter 4. ** Solutions [https://docs.google.com/document/d/14QZxh2SAWl3JE-SzVyemkAv4p9TBChO-jzZ5YpT8BZs/edit?usp=sharing] * Week 7: Review Hetland, Chapters 3-7. We'll do a series of parsing problems and flex our collective induction and recursion muscles. ** [https://docs.google.com/document/d/1i04oL7zJsD3KzvsPIaHBgwaOZ78UZvz5ReRDF-PlyF0/edit?usp=sharing Week 7 Problems] * Week 8: [[Media:Minimization1.pdf|Minimization Problems!]] * Week 10: [[Media:Minimization2.pdf|Molecular Optimization]] * Week 11: [[Media:Dynamics.pdf|Dynamical Problems]] * Week 12: [[Media:InvPend.pdf|Inverse Pendulum]] ** [[Simulating Rule 110]] * Week 13: No reading, simulate dynamics in the final project, scale up Rule 110 simulation and calculate histograms of local densities. === Homework === * Homework will be assigned through Repl.IT * Project presentations will be on Mon.-Wed., Mar 5-7 * Final Project presentations will be during exam time, Wed., May 2 8577f6d79217cee47c6a8a13934edca68bb2c505 665 664 2018-04-16T16:03:35Z David M. Rogers 2 /* Notes */ wikitext text/x-wiki '''<BIG>Introduction to Scientific Computing</BIG>''' Course Info * Course Numbers CHM 4932-004/6938-010, CRN: 20438/20439 * Credit Hours: 3 * Meeting Dates: January 8 - April 25, 2018 ** No Class Jan. 15 or Mar. 12-18 * Meeting Times: Mon. and Wed., 12:30-13:45 in SCA 222 ** Midterm Project Presentations: Mon.-Wed., Mar 5 and 7. ** Final Project Presentations: Wed., May 2, 10:00am – 12:00pm (scheduled final date) ** Lab Session & Office Hours: Fri. 12:30-13:45 in IDR 214 (or SCA 222 by announcement) <pre> $ for((i=1;i<=4;i++)); do cal $i 2018; done ____ January 2018 ____ _____ March 2018 ____ | Su Mo Tu We Th Fr Sa | | Su Mo Tu We Th Fr Sa | 1 2 3 4 5 6 | | 1 (2) 3 1 | 7 8 9*10 11 12 13 | 9 | 4 (5) 6 (7) 8 9 10 2 | 14 x 16*17 18 19 20 | | x x 3 | 21*22 23 24 25 26 27 | 10 | 18*19 20 21 22 23 24 4 | 28*29 30 31 | 11 | 25*26 27 28 29 30 31 ___ February 2018 ____ _____ April 2018 ____ | Su Mo Tu We Th Fr Sa | | Su Mo Tu We Th Fr Sa | 1 2 3 | 12 | 1 *2 3 4 5 6 7 5 | 4 *5 6 7 8 9 10 | 13 | 8 *9 10 11 12 13 14 6 | 11*12 13 14 15 16 17 | 14 | 15*16 17 18 19 20 21 7 | 18*19 20 21 22 23 24 | 15 | 22*23 24(25)26 27 28 8 | 25*26 27 28 | | 29 x Week Topic 1 Calculator Form 2 Pseudocode 3 Plotting 1 (Excel) 4 Plotting 2 (Matplotlib and linear spaces) 5 Abstraction 1 (advanced functions and oo method) 6 Abstraction 2 (Booleans and logic) 7 2D transforms and iterated maps 8 Optimization 1 (Newton-Rhapson) 9 midterm project presentations 10 Optimization 2 (MD Energy) 11 ODE and SDE algorithms 12 Statistics 13 Complexity 14 Circe and Linux crash course 15 Compile & install process, ctypes </pre> == Overview == Mathematical models in the natural sciences take many shapes and forms. The moment they become more complicated than tracking a few variables over time, we have to put away our Excel spreadsheets and make use of a solid foundation in computational science. The course establishes this foundation by introducing data structures and algorithms used in everyday scientific computing using examples in the python scripting language. By the end of the Semester, students will be able to navigate the Linux command-line to go from a mathematical model to a numerical solution. Best practices for working with computer code and visualizing data will also be covered. == Topics == # Languages #* bash (shell) #* python (scripting) #* stack & register-based machine languages: overview of C and Fortran syntax & compiling with gcc, ‘thread safety’ #* Shared libraries & language inter-operability (FFI) # Algorithms #* Horner’s algorithm for polynomials #* Newton’s root finding algo. #* Overview of general optimization algo-s (example: linear & nonlin. least-squares) #* Numerical integration (scripted, plus gnu ODE) #* Communication (how HTTP get/put works) # Data Structures #* Linked Lists #* Trees (file system hierarchies) #* Graphs #* Arrays (dense & sparse) example: vectors & rotations / transpositions, densities and difference operators # Presentation & visualization #* Flat CSV files (and excel) #* Working with binary data #* Python matplotlib (2D images) #* Binning histograms & weighted averages # Best Practices #* High-level code design (modularity, interface specifications, unit testing, etc.) #* Code audit: open-source libraries, ex. Gnu Scientific Library, qsort in libc, Boost #* Source code versioning (example: git or mercurial) #* gdb & execution profiling #* documentation #* Makefiles == Grading == '''Grading Scale (out of 400 points possible)''' {| class="wikitable" |- ! Grade ! Undergraduate ! Graduate |- | A+ | 269 | 323 |- | A | 258 | 310 |- | A- | 250 | 300 |- | B+ | 241 | 290 |- | B | 230 | 276 |- | B- | 222 | 266 |- | C+ | 213 | 256 |- | C | 202 | 243 |- | C- | 194 | 233 |- | D+ | 186 | 223 |- | D | 175 | 210 |- | D- | 166 | 200 |} * (280 U / 330 G) Points Possible: ** 9 homework assignments (10 points per homework) ** 14 in-class assignments / quizzes (10 points per week) ** 2 projects / competitions (50 points per project) ** Undergraduates must complete 1 project, graduates must complete 2 * Important Rules ** For maximum benefit, homework should be done on-time. However, homework will be allowed to be re-submitted at any time for full credit, but must present a unique solution to previous work from yourself or others. ** All work must cite co-group members (if any) and the source of any code snippets used online. === Grading Rationale === Homework points will only be awarded for correct, working code and correct algorithmic analysis, while the homework problems will become progressively tougher. Undergraduates should be able to pass the course with an A if they have correctly answered most of the homework, appear at class prepared and on-time, and made a strong attempt at one of the projects. Graduate students should both perform well on the homework and successfully complete one or two projects. The re-grading for homework allows making up for missed assignments, and encourages returning to core concepts at a later point in the class. Students who have put in the studying effort, completed significant portions of the homework and projects both in- and out of class have thus demonstrated introductory programming proficiency. == Projects == * Midterm Project Description [[Media:Midterm2018.pdf]] (2 Mar., 2018) ** [[Agile|Agile Development Tips & Tricks]] * Midterm Projects: <!-- ** Luis & Matteo [https://drive.google.com/file/d/1tTkwRuJts2SnZcEkVlHO51ItacFfHYL3/view?usp=sharing_eil&ts=5a9d6cb2] ** Misty & Cherinee [https://docs.google.com/presentation/d/17UTtjv-2d19mTtYt9oVwrWI5eOuo7l2qg4zYsOGXTxw/edit?ts=5a9d7601#slide=id.gc6f90357f_0_0] ** Pauline [http://predictivestatmech.org/code/pauline.py] ** Nasha [http://predictivestatmech.org/code/nasha.py] ** Daniel [https://drive.google.com/drive/folders/1NNQEG7O8Pi1jGeMaPwcWYEBVI62BhYgD?usp=sharing] ** Melissa, Casidy & Paul [https://docs.google.com/presentation/d/10U8loA8uPMypoEWO163e6smZ9JnrPXjyQl97Duz8Hg8/edit?usp=sharing_eip&ts=5a9d6081] ** Kimberly [http://predictivestatmech.org/code/kimberly.py] ** Eric ** Jovina & Jesunifemi [http://predictivestatmech.org/code/jovina-nifemi.py] ** Jakin [https://docs.google.com/presentation/d/1LFh-_n6J2jC6FBEl-X4WTJqYyhwjnVucGdMBKsUFsjU/edit?usp=sharing_eip&ts=5a9d8fa1] ** Bryan [http://predictivestatmech.org/code/bryan.py] --> * [[Final2018|Final Project Description]] (25 Apr., 2018) == Textbooks and Resources == * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-0072-7 Beginning Python, Hetland, 2005] (eBook avail. from USF Library) * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-3238-4 Python Algorithms, Hetland, 2010] (eBook avail. from USF Library) * [http://aosabook.org/en/index.html The Architecture of Open Source Applications] * [http://docs.python.org Python Documentation] * [https://developers.google.com/edu/python/ Google Introductory Python Notes] * [http://huffman.sourceforge.net/tao/tao-of-programming.html Tao of Programming] Other (possibly useful) materials: * [http://hackersdictionary.com/html/entry/larval-stage.html The Jargon File] * Chapters 7&8 of Modelling and Simulation, Birta and Arbez, Springer 2007 (eBook avail. from USF Library). * Chapters 4-6 of Models and Algorithms for Intelligent Data Analysis, Runkler, Springer 2012 (eBook avail. from USF Library). * Guide to Scientific Computing in C++, Francis and Whiteley, Springer, 2012. (eBook avail. from USF Library) * Extra info. On the basics: ** Chapters 3 and 7 of Mathematics in Computing, Regan, Springer 2013. (eBook avail. from USF Library) ** Instant feedback graphical programming with [https://www.khanacademy.org/cs/programming/ Khan Academy] * [http://www.meetup.com/python-178/ Local PyBulls Meetings] Code: * [http://carsonfarmer.com/2013/07/essential-python-geo-libraries Python Libraries Useful for Geospatial Problems] * [[Code#Python_Libraries|Python Libraries Useful for Computational Chemistry]] (very small list at present) Interactive Interpreters: * [http://www.codewars.com CodeWars] Recommended for building experience with practice problems. * [http://codecombat.com/ CodeCombat] A very visual way to interact with your python code. * [http://exercism.io Exercism] A command-line client with a similar learn-through-challenge philosophy. * [http://repl.it repl.it] A read-eval-print loop for several computer languages. * [http://en.cppreference.com/w/cpp/language CppReference] Documentation with an online evaluator for C++ code. === Notes === * [[Media:Intro.pdf|Introduction Notes]] * [[Media:Week2.pdf|Function Syntax]] and [[Media:Week3.pdf|For-Loop Syntax]] cheat-sheets. * [[Media:PlottingMaps.pdf|Plotting Maps]] * [https://m3challenge.siam.org/sites/default/files/uploads/siam-guidebook-final-press.pdf SIAM Notes on Mathematical Modeling] * [[Code:libxdrfile|libxdrfile]] * The simple, yet amazing harmonic oscillator ** [http://hyperphysics.phy-astr.gsu.edu/hbase/shm.html Classical Oscillator] ** [http://hyperphysics.phy-astr.gsu.edu/hbase/quantum/hosc.html Quantum Oscillator] ** [http://hyperphysics.phy-astr.gsu.edu/hbase/quantum/hosc6.html#c2 Probabilities] <!-- ** [[Turing Exercise]] ** [https://predictivestatmech.org/code/example.dcd Example DCD File] * [[Media:Week-5.2017.pdf|Week 5 Notes]] ** [[Code:PyTesting]] * [[Media:NumpyArrays.pdf|Week 7 Notes]] ** [http://www.labri.fr/perso/nrougier/from-python-to-numpy/ all about numpy] * Misc. Notes for Week 8 ** [[Physics:Pairs|Rundown of Pair Interactions]] ** Parameterized surfaces [[Media:param1.jpg|1]] and [[Media:param2.jpg|2]] * Notes for Compilation Lab ** [https://learnpythonthehardway.org/book/appendixa.html Command Line Crash Course] Cheat sheet for bash commands. ** USF's compute cluster documentation at [https://wiki.rc.usf.edu/index.php/Main_Page RC Wiki]. *** See especially the "Connecting to SC" and "Modules" sections ** [[Code:Compiling|Cheat-codes]] for compilation lab. * [[Media:jobs.pdf|Research Computing Batch Queue]] * [[Media:Plug-in.pdf|Plugging Into Libraries]] * [[Media:Matrix.pdf|Matrix Algorithms]] --> === Review Notes on Sequences, list comprehensions and arrays === <source lang="python"> # Say you want to make a plot of the LJ function on the domain x \in [0.9, 3] # 1. You could use the following two list comprehensions to be specific: x = [ i*(3-0.9)/100.0 + 0.9 for i in range(101) ] y = [ 4*(xi**-12 - xi**-6) for xi in x] # 2. You could implement the LJ function as a python function and use MAP, def LJ(x): ix6 = x**-6 # the factoring makes this calculation more efficient return 4*ix6*(ix6 + 1.0) y = map(LJ, x) # 3. You could work on arrays, where addition, multiplication, and powers are elementwise: ax = arange(101)*(3-0.9)/100 + 0.9 ay = LJ(ax) # Mind the difference in type! type(x) type(ax) # 4. You could totally cheat, and use numpy's builtin functions. ax = linspace(0.9, 3.0, 101) # Exercise: replicate the steps above to test the finite difference computation # of the derivative against the analytical derivative of LJ. [ (y[i+1]-y[i])/(x[i+1]-x[i]) for i in ... import matplotlib.pyplot as plt plt.plot(x, y) plt.show() </source> === Review Notes on Functions with Function arguments (functionals) === <source lang="python"> # map : (a -> b), [ a ] -> [ b ] # map: map(str, [1,2,3]) --> [ "1", "2", "3" ] # ^ function (a -> b) # map(int, map(str, [1,2,3]) ) # - helpful for parsing # x = "1 2 3 4 5" # x.split() # ["1", "2", "3", "4", "5"] # map(int, x.split()) # [1,2,3,4,5] str([1,2,3]) # "[1, 2, 3]" (bad) map(str, [1,2,3]) # ["1", "2", "3"] (good) # filter: (a -> Bool), [a] -> [a] # Example filter: # '1' -> no # ' ' -> no # 'a-z' -> yes # 'A-Z' -> yes def f(x): # str -> Bool if x >= 'a' and x <= 'z': return True if x >= 'A' and x <= 'Z': return True return False filter(f, " 1 a b 2 \n") # reduce: (a,b -> a), [b], a -> a sum([1,2,3]) # -> 6 def add2(x,y): # x : int, y : int return x+y reduce(add2, [1,2,3], 0) # For an example where a != b: def append(x,y): # x : [int], y : int return x + [y] reduce(append, [1,2,3], []) # start with an empty list # Newton-Rhapson def nrhap(f, fp, x0, tol = 1e-6): y = f(x0) iter = 0 # guard against infinity while abs(y) > tol: iter += 1 if iter > 1000: raise ValueError, "Unable to converge!" x0 -= y/fp(x0) y = f(x0) return x0 # solve x^3 - 2 = 0 def f(x): return x**3 - 2 def fp(x): return 3*x**2 print( nrhap(f, fp, 1.0)**3 ) </source> === In-Class Problems === * Week 1: [[Media:CalculatorProbs.pdf|Calculator Problems]] ** Solutions: [http://predictivestatmech.org/terms/term.html] ** This solution uses python list comprehensions, and shows that the slowest step is actually unit conversion! * Week 2: [[Media:Pseudocode.pdf|Pseudocode Problems]] ** We will work these in class. For practice, be sure you have python list ideas down! ** Solutions: [https://docs.google.com/document/d/1HRkSdVNsTUydY4cVx67jRHRyhi5gL6nneEj9IX89wlE/edit?usp=sharing] * Week 3: [[Media:Plotting1.pdf|Plotting 1]] ** [https://stackoverflow.com/questions/11815538/how-to-import-matplotlib-in-python#11830055 Notes on installing Matplotlib on your own computer] ** Challenge: actions vs. functions -- what does the following code do: "[ print(1) for i in range(10) ]" (python3 only) * Week 4: [[Media:Plotting2.pdf|Plotting 2]] ** Solutions: [https://docs.google.com/document/d/1AanEFQmxLxoNM-662MHxsxToY3wsqovNx6SwcPQuBIg/edit?usp=sharing] * Week 5: Read pseudocode and plotting, focusing on types and syntax. Also, re-read the end of chapter summaries for Ch. 3, 5 and 6. * Week 6: Read the following pieces on first order logic [http://bayes.wustl.edu/etj/prob/book.pdf Chapter 1 of Jaynes' Book] [http://web.cecs.pdx.edu/~cs410aph/Lectures/Smalltalk%20II/Dijkstra%20on%20Hamming%27s%20Problem.pdf Hamming's Problem], and pages 71-80 in Chapter 4 of Hetland's Algorithms book (on induction). Just skip directly to chapter 4. ** Solutions [https://docs.google.com/document/d/14QZxh2SAWl3JE-SzVyemkAv4p9TBChO-jzZ5YpT8BZs/edit?usp=sharing] * Week 7: Review Hetland, Chapters 3-7. We'll do a series of parsing problems and flex our collective induction and recursion muscles. ** [https://docs.google.com/document/d/1i04oL7zJsD3KzvsPIaHBgwaOZ78UZvz5ReRDF-PlyF0/edit?usp=sharing Week 7 Problems] * Week 8: [[Media:Minimization1.pdf|Minimization Problems!]] * Week 10: [[Media:Minimization2.pdf|Molecular Optimization]] * Week 11: [[Media:Dynamics.pdf|Dynamical Problems]] * Week 12: [[Media:InvPend.pdf|Inverse Pendulum]] ** [[Simulating Rule 110]] * Week 13: No reading, simulate dynamics in the final project, scale up Rule 110 simulation and calculate histograms of local densities. === Homework === * Homework will be assigned through Repl.IT * Project presentations will be on Mon.-Wed., Mar 5-7 * Final Project presentations will be during exam time, Wed., May 2 8c4eebcacfb851be489df3255c01cce8af22c30e 666 665 2018-04-17T04:55:46Z David M. Rogers 2 /* Homework */ wikitext text/x-wiki '''<BIG>Introduction to Scientific Computing</BIG>''' Course Info * Course Numbers CHM 4932-004/6938-010, CRN: 20438/20439 * Credit Hours: 3 * Meeting Dates: January 8 - April 25, 2018 ** No Class Jan. 15 or Mar. 12-18 * Meeting Times: Mon. and Wed., 12:30-13:45 in SCA 222 ** Midterm Project Presentations: Mon.-Wed., Mar 5 and 7. ** Final Project Presentations: Wed., May 2, 10:00am – 12:00pm (scheduled final date) ** Lab Session & Office Hours: Fri. 12:30-13:45 in IDR 214 (or SCA 222 by announcement) <pre> $ for((i=1;i<=4;i++)); do cal $i 2018; done ____ January 2018 ____ _____ March 2018 ____ | Su Mo Tu We Th Fr Sa | | Su Mo Tu We Th Fr Sa | 1 2 3 4 5 6 | | 1 (2) 3 1 | 7 8 9*10 11 12 13 | 9 | 4 (5) 6 (7) 8 9 10 2 | 14 x 16*17 18 19 20 | | x x 3 | 21*22 23 24 25 26 27 | 10 | 18*19 20 21 22 23 24 4 | 28*29 30 31 | 11 | 25*26 27 28 29 30 31 ___ February 2018 ____ _____ April 2018 ____ | Su Mo Tu We Th Fr Sa | | Su Mo Tu We Th Fr Sa | 1 2 3 | 12 | 1 *2 3 4 5 6 7 5 | 4 *5 6 7 8 9 10 | 13 | 8 *9 10 11 12 13 14 6 | 11*12 13 14 15 16 17 | 14 | 15*16 17 18 19 20 21 7 | 18*19 20 21 22 23 24 | 15 | 22*23 24(25)26 27 28 8 | 25*26 27 28 | | 29 x Week Topic 1 Calculator Form 2 Pseudocode 3 Plotting 1 (Excel) 4 Plotting 2 (Matplotlib and linear spaces) 5 Abstraction 1 (advanced functions and oo method) 6 Abstraction 2 (Booleans and logic) 7 2D transforms and iterated maps 8 Optimization 1 (Newton-Rhapson) 9 midterm project presentations 10 Optimization 2 (MD Energy) 11 ODE and SDE algorithms 12 Statistics 13 Complexity 14 Circe and Linux crash course 15 Compile & install process, ctypes </pre> == Overview == Mathematical models in the natural sciences take many shapes and forms. The moment they become more complicated than tracking a few variables over time, we have to put away our Excel spreadsheets and make use of a solid foundation in computational science. The course establishes this foundation by introducing data structures and algorithms used in everyday scientific computing using examples in the python scripting language. By the end of the Semester, students will be able to navigate the Linux command-line to go from a mathematical model to a numerical solution. Best practices for working with computer code and visualizing data will also be covered. == Topics == # Languages #* bash (shell) #* python (scripting) #* stack & register-based machine languages: overview of C and Fortran syntax & compiling with gcc, ‘thread safety’ #* Shared libraries & language inter-operability (FFI) # Algorithms #* Horner’s algorithm for polynomials #* Newton’s root finding algo. #* Overview of general optimization algo-s (example: linear & nonlin. least-squares) #* Numerical integration (scripted, plus gnu ODE) #* Communication (how HTTP get/put works) # Data Structures #* Linked Lists #* Trees (file system hierarchies) #* Graphs #* Arrays (dense & sparse) example: vectors & rotations / transpositions, densities and difference operators # Presentation & visualization #* Flat CSV files (and excel) #* Working with binary data #* Python matplotlib (2D images) #* Binning histograms & weighted averages # Best Practices #* High-level code design (modularity, interface specifications, unit testing, etc.) #* Code audit: open-source libraries, ex. Gnu Scientific Library, qsort in libc, Boost #* Source code versioning (example: git or mercurial) #* gdb & execution profiling #* documentation #* Makefiles == Grading == '''Grading Scale (out of 400 points possible)''' {| class="wikitable" |- ! Grade ! Undergraduate ! Graduate |- | A+ | 269 | 323 |- | A | 258 | 310 |- | A- | 250 | 300 |- | B+ | 241 | 290 |- | B | 230 | 276 |- | B- | 222 | 266 |- | C+ | 213 | 256 |- | C | 202 | 243 |- | C- | 194 | 233 |- | D+ | 186 | 223 |- | D | 175 | 210 |- | D- | 166 | 200 |} * (280 U / 330 G) Points Possible: ** 9 homework assignments (10 points per homework) ** 14 in-class assignments / quizzes (10 points per week) ** 2 projects / competitions (50 points per project) ** Undergraduates must complete 1 project, graduates must complete 2 * Important Rules ** For maximum benefit, homework should be done on-time. However, homework will be allowed to be re-submitted at any time for full credit, but must present a unique solution to previous work from yourself or others. ** All work must cite co-group members (if any) and the source of any code snippets used online. === Grading Rationale === Homework points will only be awarded for correct, working code and correct algorithmic analysis, while the homework problems will become progressively tougher. Undergraduates should be able to pass the course with an A if they have correctly answered most of the homework, appear at class prepared and on-time, and made a strong attempt at one of the projects. Graduate students should both perform well on the homework and successfully complete one or two projects. The re-grading for homework allows making up for missed assignments, and encourages returning to core concepts at a later point in the class. Students who have put in the studying effort, completed significant portions of the homework and projects both in- and out of class have thus demonstrated introductory programming proficiency. == Projects == * Midterm Project Description [[Media:Midterm2018.pdf]] (2 Mar., 2018) ** [[Agile|Agile Development Tips & Tricks]] * Midterm Projects: <!-- ** Luis & Matteo [https://drive.google.com/file/d/1tTkwRuJts2SnZcEkVlHO51ItacFfHYL3/view?usp=sharing_eil&ts=5a9d6cb2] ** Misty & Cherinee [https://docs.google.com/presentation/d/17UTtjv-2d19mTtYt9oVwrWI5eOuo7l2qg4zYsOGXTxw/edit?ts=5a9d7601#slide=id.gc6f90357f_0_0] ** Pauline [http://predictivestatmech.org/code/pauline.py] ** Nasha [http://predictivestatmech.org/code/nasha.py] ** Daniel [https://drive.google.com/drive/folders/1NNQEG7O8Pi1jGeMaPwcWYEBVI62BhYgD?usp=sharing] ** Melissa, Casidy & Paul [https://docs.google.com/presentation/d/10U8loA8uPMypoEWO163e6smZ9JnrPXjyQl97Duz8Hg8/edit?usp=sharing_eip&ts=5a9d6081] ** Kimberly [http://predictivestatmech.org/code/kimberly.py] ** Eric ** Jovina & Jesunifemi [http://predictivestatmech.org/code/jovina-nifemi.py] ** Jakin [https://docs.google.com/presentation/d/1LFh-_n6J2jC6FBEl-X4WTJqYyhwjnVucGdMBKsUFsjU/edit?usp=sharing_eip&ts=5a9d8fa1] ** Bryan [http://predictivestatmech.org/code/bryan.py] --> * [[Final2018|Final Project Description]] (25 Apr., 2018) == Textbooks and Resources == * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-0072-7 Beginning Python, Hetland, 2005] (eBook avail. from USF Library) * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-3238-4 Python Algorithms, Hetland, 2010] (eBook avail. from USF Library) * [http://aosabook.org/en/index.html The Architecture of Open Source Applications] * [http://docs.python.org Python Documentation] * [https://developers.google.com/edu/python/ Google Introductory Python Notes] * [http://huffman.sourceforge.net/tao/tao-of-programming.html Tao of Programming] Other (possibly useful) materials: * [http://hackersdictionary.com/html/entry/larval-stage.html The Jargon File] * Chapters 7&8 of Modelling and Simulation, Birta and Arbez, Springer 2007 (eBook avail. from USF Library). * Chapters 4-6 of Models and Algorithms for Intelligent Data Analysis, Runkler, Springer 2012 (eBook avail. from USF Library). * Guide to Scientific Computing in C++, Francis and Whiteley, Springer, 2012. (eBook avail. from USF Library) * Extra info. On the basics: ** Chapters 3 and 7 of Mathematics in Computing, Regan, Springer 2013. (eBook avail. from USF Library) ** Instant feedback graphical programming with [https://www.khanacademy.org/cs/programming/ Khan Academy] * [http://www.meetup.com/python-178/ Local PyBulls Meetings] Code: * [http://carsonfarmer.com/2013/07/essential-python-geo-libraries Python Libraries Useful for Geospatial Problems] * [[Code#Python_Libraries|Python Libraries Useful for Computational Chemistry]] (very small list at present) Interactive Interpreters: * [http://www.codewars.com CodeWars] Recommended for building experience with practice problems. * [http://codecombat.com/ CodeCombat] A very visual way to interact with your python code. * [http://exercism.io Exercism] A command-line client with a similar learn-through-challenge philosophy. * [http://repl.it repl.it] A read-eval-print loop for several computer languages. * [http://en.cppreference.com/w/cpp/language CppReference] Documentation with an online evaluator for C++ code. === Notes === * [[Media:Intro.pdf|Introduction Notes]] * [[Media:Week2.pdf|Function Syntax]] and [[Media:Week3.pdf|For-Loop Syntax]] cheat-sheets. * [[Media:PlottingMaps.pdf|Plotting Maps]] * [https://m3challenge.siam.org/sites/default/files/uploads/siam-guidebook-final-press.pdf SIAM Notes on Mathematical Modeling] * [[Code:libxdrfile|libxdrfile]] * The simple, yet amazing harmonic oscillator ** [http://hyperphysics.phy-astr.gsu.edu/hbase/shm.html Classical Oscillator] ** [http://hyperphysics.phy-astr.gsu.edu/hbase/quantum/hosc.html Quantum Oscillator] ** [http://hyperphysics.phy-astr.gsu.edu/hbase/quantum/hosc6.html#c2 Probabilities] <!-- ** [[Turing Exercise]] ** [https://predictivestatmech.org/code/example.dcd Example DCD File] * [[Media:Week-5.2017.pdf|Week 5 Notes]] ** [[Code:PyTesting]] * [[Media:NumpyArrays.pdf|Week 7 Notes]] ** [http://www.labri.fr/perso/nrougier/from-python-to-numpy/ all about numpy] * Misc. Notes for Week 8 ** [[Physics:Pairs|Rundown of Pair Interactions]] ** Parameterized surfaces [[Media:param1.jpg|1]] and [[Media:param2.jpg|2]] * Notes for Compilation Lab ** [https://learnpythonthehardway.org/book/appendixa.html Command Line Crash Course] Cheat sheet for bash commands. ** USF's compute cluster documentation at [https://wiki.rc.usf.edu/index.php/Main_Page RC Wiki]. *** See especially the "Connecting to SC" and "Modules" sections ** [[Code:Compiling|Cheat-codes]] for compilation lab. * [[Media:jobs.pdf|Research Computing Batch Queue]] * [[Media:Plug-in.pdf|Plugging Into Libraries]] * [[Media:Matrix.pdf|Matrix Algorithms]] --> === Review Notes on Sequences, list comprehensions and arrays === <source lang="python"> # Say you want to make a plot of the LJ function on the domain x \in [0.9, 3] # 1. You could use the following two list comprehensions to be specific: x = [ i*(3-0.9)/100.0 + 0.9 for i in range(101) ] y = [ 4*(xi**-12 - xi**-6) for xi in x] # 2. You could implement the LJ function as a python function and use MAP, def LJ(x): ix6 = x**-6 # the factoring makes this calculation more efficient return 4*ix6*(ix6 + 1.0) y = map(LJ, x) # 3. You could work on arrays, where addition, multiplication, and powers are elementwise: ax = arange(101)*(3-0.9)/100 + 0.9 ay = LJ(ax) # Mind the difference in type! type(x) type(ax) # 4. You could totally cheat, and use numpy's builtin functions. ax = linspace(0.9, 3.0, 101) # Exercise: replicate the steps above to test the finite difference computation # of the derivative against the analytical derivative of LJ. [ (y[i+1]-y[i])/(x[i+1]-x[i]) for i in ... import matplotlib.pyplot as plt plt.plot(x, y) plt.show() </source> === Review Notes on Functions with Function arguments (functionals) === <source lang="python"> # map : (a -> b), [ a ] -> [ b ] # map: map(str, [1,2,3]) --> [ "1", "2", "3" ] # ^ function (a -> b) # map(int, map(str, [1,2,3]) ) # - helpful for parsing # x = "1 2 3 4 5" # x.split() # ["1", "2", "3", "4", "5"] # map(int, x.split()) # [1,2,3,4,5] str([1,2,3]) # "[1, 2, 3]" (bad) map(str, [1,2,3]) # ["1", "2", "3"] (good) # filter: (a -> Bool), [a] -> [a] # Example filter: # '1' -> no # ' ' -> no # 'a-z' -> yes # 'A-Z' -> yes def f(x): # str -> Bool if x >= 'a' and x <= 'z': return True if x >= 'A' and x <= 'Z': return True return False filter(f, " 1 a b 2 \n") # reduce: (a,b -> a), [b], a -> a sum([1,2,3]) # -> 6 def add2(x,y): # x : int, y : int return x+y reduce(add2, [1,2,3], 0) # For an example where a != b: def append(x,y): # x : [int], y : int return x + [y] reduce(append, [1,2,3], []) # start with an empty list # Newton-Rhapson def nrhap(f, fp, x0, tol = 1e-6): y = f(x0) iter = 0 # guard against infinity while abs(y) > tol: iter += 1 if iter > 1000: raise ValueError, "Unable to converge!" x0 -= y/fp(x0) y = f(x0) return x0 # solve x^3 - 2 = 0 def f(x): return x**3 - 2 def fp(x): return 3*x**2 print( nrhap(f, fp, 1.0)**3 ) </source> === In-Class Problems === * Week 1: [[Media:CalculatorProbs.pdf|Calculator Problems]] ** Solutions: [http://predictivestatmech.org/terms/term.html] ** This solution uses python list comprehensions, and shows that the slowest step is actually unit conversion! * Week 2: [[Media:Pseudocode.pdf|Pseudocode Problems]] ** We will work these in class. For practice, be sure you have python list ideas down! ** Solutions: [https://docs.google.com/document/d/1HRkSdVNsTUydY4cVx67jRHRyhi5gL6nneEj9IX89wlE/edit?usp=sharing] * Week 3: [[Media:Plotting1.pdf|Plotting 1]] ** [https://stackoverflow.com/questions/11815538/how-to-import-matplotlib-in-python#11830055 Notes on installing Matplotlib on your own computer] ** Challenge: actions vs. functions -- what does the following code do: "[ print(1) for i in range(10) ]" (python3 only) * Week 4: [[Media:Plotting2.pdf|Plotting 2]] ** Solutions: [https://docs.google.com/document/d/1AanEFQmxLxoNM-662MHxsxToY3wsqovNx6SwcPQuBIg/edit?usp=sharing] * Week 5: Read pseudocode and plotting, focusing on types and syntax. Also, re-read the end of chapter summaries for Ch. 3, 5 and 6. * Week 6: Read the following pieces on first order logic [http://bayes.wustl.edu/etj/prob/book.pdf Chapter 1 of Jaynes' Book] [http://web.cecs.pdx.edu/~cs410aph/Lectures/Smalltalk%20II/Dijkstra%20on%20Hamming%27s%20Problem.pdf Hamming's Problem], and pages 71-80 in Chapter 4 of Hetland's Algorithms book (on induction). Just skip directly to chapter 4. ** Solutions [https://docs.google.com/document/d/14QZxh2SAWl3JE-SzVyemkAv4p9TBChO-jzZ5YpT8BZs/edit?usp=sharing] * Week 7: Review Hetland, Chapters 3-7. We'll do a series of parsing problems and flex our collective induction and recursion muscles. ** [https://docs.google.com/document/d/1i04oL7zJsD3KzvsPIaHBgwaOZ78UZvz5ReRDF-PlyF0/edit?usp=sharing Week 7 Problems] * Week 8: [[Media:Minimization1.pdf|Minimization Problems!]] * Week 10: [[Media:Minimization2.pdf|Molecular Optimization]] * Week 11: [[Media:Dynamics.pdf|Dynamical Problems]] * Week 12: [[Media:InvPend.pdf|Inverse Pendulum]] ** [[Simulating Rule 110]] * Week 13: No reading, simulate dynamics in the final project, scale up Rule 110 simulation and calculate histograms of local densities. === Homework === * Homework will be assigned through Repl.IT ** Homework 6 is described below * Project presentations will be on Mon.-Wed., Mar 5-7 * Final Projects are due by the end of the last week of classes. '''HW6''' (hand in on Wednesday, April 18) <blockquote> After reading through the SIAM guide on mathematical modeling, formulate an interesting question about the chemical behavior of mixed solvent systems. Don't be too constrained by what can and can't be simulated with MD, but do create a well-designed problem statement, list some possible assumptions that could help narrow down the problem scope, and clearly explain any quantitative variables that can be defined. It will help to reference chemical literature, including textbooks from your past courses. </blockquote> 624bab692911e98812f18960fc53efc904f89f27 667 666 2018-04-18T16:08:02Z David M. Rogers 2 /* Notes */ wikitext text/x-wiki '''<BIG>Introduction to Scientific Computing</BIG>''' Course Info * Course Numbers CHM 4932-004/6938-010, CRN: 20438/20439 * Credit Hours: 3 * Meeting Dates: January 8 - April 25, 2018 ** No Class Jan. 15 or Mar. 12-18 * Meeting Times: Mon. and Wed., 12:30-13:45 in SCA 222 ** Midterm Project Presentations: Mon.-Wed., Mar 5 and 7. ** Final Project Presentations: Wed., May 2, 10:00am – 12:00pm (scheduled final date) ** Lab Session & Office Hours: Fri. 12:30-13:45 in IDR 214 (or SCA 222 by announcement) <pre> $ for((i=1;i<=4;i++)); do cal $i 2018; done ____ January 2018 ____ _____ March 2018 ____ | Su Mo Tu We Th Fr Sa | | Su Mo Tu We Th Fr Sa | 1 2 3 4 5 6 | | 1 (2) 3 1 | 7 8 9*10 11 12 13 | 9 | 4 (5) 6 (7) 8 9 10 2 | 14 x 16*17 18 19 20 | | x x 3 | 21*22 23 24 25 26 27 | 10 | 18*19 20 21 22 23 24 4 | 28*29 30 31 | 11 | 25*26 27 28 29 30 31 ___ February 2018 ____ _____ April 2018 ____ | Su Mo Tu We Th Fr Sa | | Su Mo Tu We Th Fr Sa | 1 2 3 | 12 | 1 *2 3 4 5 6 7 5 | 4 *5 6 7 8 9 10 | 13 | 8 *9 10 11 12 13 14 6 | 11*12 13 14 15 16 17 | 14 | 15*16 17 18 19 20 21 7 | 18*19 20 21 22 23 24 | 15 | 22*23 24(25)26 27 28 8 | 25*26 27 28 | | 29 x Week Topic 1 Calculator Form 2 Pseudocode 3 Plotting 1 (Excel) 4 Plotting 2 (Matplotlib and linear spaces) 5 Abstraction 1 (advanced functions and oo method) 6 Abstraction 2 (Booleans and logic) 7 2D transforms and iterated maps 8 Optimization 1 (Newton-Rhapson) 9 midterm project presentations 10 Optimization 2 (MD Energy) 11 ODE and SDE algorithms 12 Statistics 13 Complexity 14 Circe and Linux crash course 15 Compile & install process, ctypes </pre> == Overview == Mathematical models in the natural sciences take many shapes and forms. The moment they become more complicated than tracking a few variables over time, we have to put away our Excel spreadsheets and make use of a solid foundation in computational science. The course establishes this foundation by introducing data structures and algorithms used in everyday scientific computing using examples in the python scripting language. By the end of the Semester, students will be able to navigate the Linux command-line to go from a mathematical model to a numerical solution. Best practices for working with computer code and visualizing data will also be covered. == Topics == # Languages #* bash (shell) #* python (scripting) #* stack & register-based machine languages: overview of C and Fortran syntax & compiling with gcc, ‘thread safety’ #* Shared libraries & language inter-operability (FFI) # Algorithms #* Horner’s algorithm for polynomials #* Newton’s root finding algo. #* Overview of general optimization algo-s (example: linear & nonlin. least-squares) #* Numerical integration (scripted, plus gnu ODE) #* Communication (how HTTP get/put works) # Data Structures #* Linked Lists #* Trees (file system hierarchies) #* Graphs #* Arrays (dense & sparse) example: vectors & rotations / transpositions, densities and difference operators # Presentation & visualization #* Flat CSV files (and excel) #* Working with binary data #* Python matplotlib (2D images) #* Binning histograms & weighted averages # Best Practices #* High-level code design (modularity, interface specifications, unit testing, etc.) #* Code audit: open-source libraries, ex. Gnu Scientific Library, qsort in libc, Boost #* Source code versioning (example: git or mercurial) #* gdb & execution profiling #* documentation #* Makefiles == Grading == '''Grading Scale (out of 400 points possible)''' {| class="wikitable" |- ! Grade ! Undergraduate ! Graduate |- | A+ | 269 | 323 |- | A | 258 | 310 |- | A- | 250 | 300 |- | B+ | 241 | 290 |- | B | 230 | 276 |- | B- | 222 | 266 |- | C+ | 213 | 256 |- | C | 202 | 243 |- | C- | 194 | 233 |- | D+ | 186 | 223 |- | D | 175 | 210 |- | D- | 166 | 200 |} * (280 U / 330 G) Points Possible: ** 9 homework assignments (10 points per homework) ** 14 in-class assignments / quizzes (10 points per week) ** 2 projects / competitions (50 points per project) ** Undergraduates must complete 1 project, graduates must complete 2 * Important Rules ** For maximum benefit, homework should be done on-time. However, homework will be allowed to be re-submitted at any time for full credit, but must present a unique solution to previous work from yourself or others. ** All work must cite co-group members (if any) and the source of any code snippets used online. === Grading Rationale === Homework points will only be awarded for correct, working code and correct algorithmic analysis, while the homework problems will become progressively tougher. Undergraduates should be able to pass the course with an A if they have correctly answered most of the homework, appear at class prepared and on-time, and made a strong attempt at one of the projects. Graduate students should both perform well on the homework and successfully complete one or two projects. The re-grading for homework allows making up for missed assignments, and encourages returning to core concepts at a later point in the class. Students who have put in the studying effort, completed significant portions of the homework and projects both in- and out of class have thus demonstrated introductory programming proficiency. == Projects == * Midterm Project Description [[Media:Midterm2018.pdf]] (2 Mar., 2018) ** [[Agile|Agile Development Tips & Tricks]] * Midterm Projects: <!-- ** Luis & Matteo [https://drive.google.com/file/d/1tTkwRuJts2SnZcEkVlHO51ItacFfHYL3/view?usp=sharing_eil&ts=5a9d6cb2] ** Misty & Cherinee [https://docs.google.com/presentation/d/17UTtjv-2d19mTtYt9oVwrWI5eOuo7l2qg4zYsOGXTxw/edit?ts=5a9d7601#slide=id.gc6f90357f_0_0] ** Pauline [http://predictivestatmech.org/code/pauline.py] ** Nasha [http://predictivestatmech.org/code/nasha.py] ** Daniel [https://drive.google.com/drive/folders/1NNQEG7O8Pi1jGeMaPwcWYEBVI62BhYgD?usp=sharing] ** Melissa, Casidy & Paul [https://docs.google.com/presentation/d/10U8loA8uPMypoEWO163e6smZ9JnrPXjyQl97Duz8Hg8/edit?usp=sharing_eip&ts=5a9d6081] ** Kimberly [http://predictivestatmech.org/code/kimberly.py] ** Eric ** Jovina & Jesunifemi [http://predictivestatmech.org/code/jovina-nifemi.py] ** Jakin [https://docs.google.com/presentation/d/1LFh-_n6J2jC6FBEl-X4WTJqYyhwjnVucGdMBKsUFsjU/edit?usp=sharing_eip&ts=5a9d8fa1] ** Bryan [http://predictivestatmech.org/code/bryan.py] --> * [[Final2018|Final Project Description]] (25 Apr., 2018) == Textbooks and Resources == * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-0072-7 Beginning Python, Hetland, 2005] (eBook avail. from USF Library) * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-3238-4 Python Algorithms, Hetland, 2010] (eBook avail. from USF Library) * [http://aosabook.org/en/index.html The Architecture of Open Source Applications] * [http://docs.python.org Python Documentation] * [https://developers.google.com/edu/python/ Google Introductory Python Notes] * [http://huffman.sourceforge.net/tao/tao-of-programming.html Tao of Programming] Other (possibly useful) materials: * [http://hackersdictionary.com/html/entry/larval-stage.html The Jargon File] * Chapters 7&8 of Modelling and Simulation, Birta and Arbez, Springer 2007 (eBook avail. from USF Library). * Chapters 4-6 of Models and Algorithms for Intelligent Data Analysis, Runkler, Springer 2012 (eBook avail. from USF Library). * Guide to Scientific Computing in C++, Francis and Whiteley, Springer, 2012. (eBook avail. from USF Library) * Extra info. On the basics: ** Chapters 3 and 7 of Mathematics in Computing, Regan, Springer 2013. (eBook avail. from USF Library) ** Instant feedback graphical programming with [https://www.khanacademy.org/cs/programming/ Khan Academy] * [http://www.meetup.com/python-178/ Local PyBulls Meetings] Code: * [http://carsonfarmer.com/2013/07/essential-python-geo-libraries Python Libraries Useful for Geospatial Problems] * [[Code#Python_Libraries|Python Libraries Useful for Computational Chemistry]] (very small list at present) Interactive Interpreters: * [http://www.codewars.com CodeWars] Recommended for building experience with practice problems. * [http://codecombat.com/ CodeCombat] A very visual way to interact with your python code. * [http://exercism.io Exercism] A command-line client with a similar learn-through-challenge philosophy. * [http://repl.it repl.it] A read-eval-print loop for several computer languages. * [http://en.cppreference.com/w/cpp/language CppReference] Documentation with an online evaluator for C++ code. === Notes === * [[Media:Intro.pdf|Introduction Notes]] * [[Media:Week2.pdf|Function Syntax]] and [[Media:Week3.pdf|For-Loop Syntax]] cheat-sheets. * [[Media:PlottingMaps.pdf|Plotting Maps]] * [https://m3challenge.siam.org/sites/default/files/uploads/siam-guidebook-final-press.pdf SIAM Notes on Mathematical Modeling] * [[Code:libxdrfile|libxdrfile]] * The simple, yet amazing harmonic oscillator ** [http://hyperphysics.phy-astr.gsu.edu/hbase/shm.html Classical Oscillator] ** [http://hyperphysics.phy-astr.gsu.edu/hbase/quantum/hosc.html Quantum Oscillator] ** [http://hyperphysics.phy-astr.gsu.edu/hbase/quantum/hosc6.html#c2 Probabilities] * [[Code:MDIntro]] <!-- ** [[Turing Exercise]] ** [https://predictivestatmech.org/code/example.dcd Example DCD File] * [[Media:Week-5.2017.pdf|Week 5 Notes]] ** [[Code:PyTesting]] * [[Media:NumpyArrays.pdf|Week 7 Notes]] ** [http://www.labri.fr/perso/nrougier/from-python-to-numpy/ all about numpy] * Misc. Notes for Week 8 ** [[Physics:Pairs|Rundown of Pair Interactions]] ** Parameterized surfaces [[Media:param1.jpg|1]] and [[Media:param2.jpg|2]] * Notes for Compilation Lab ** [https://learnpythonthehardway.org/book/appendixa.html Command Line Crash Course] Cheat sheet for bash commands. ** USF's compute cluster documentation at [https://wiki.rc.usf.edu/index.php/Main_Page RC Wiki]. *** See especially the "Connecting to SC" and "Modules" sections ** [[Code:Compiling|Cheat-codes]] for compilation lab. * [[Media:jobs.pdf|Research Computing Batch Queue]] * [[Media:Plug-in.pdf|Plugging Into Libraries]] * [[Media:Matrix.pdf|Matrix Algorithms]] --> === Review Notes on Sequences, list comprehensions and arrays === <source lang="python"> # Say you want to make a plot of the LJ function on the domain x \in [0.9, 3] # 1. You could use the following two list comprehensions to be specific: x = [ i*(3-0.9)/100.0 + 0.9 for i in range(101) ] y = [ 4*(xi**-12 - xi**-6) for xi in x] # 2. You could implement the LJ function as a python function and use MAP, def LJ(x): ix6 = x**-6 # the factoring makes this calculation more efficient return 4*ix6*(ix6 + 1.0) y = map(LJ, x) # 3. You could work on arrays, where addition, multiplication, and powers are elementwise: ax = arange(101)*(3-0.9)/100 + 0.9 ay = LJ(ax) # Mind the difference in type! type(x) type(ax) # 4. You could totally cheat, and use numpy's builtin functions. ax = linspace(0.9, 3.0, 101) # Exercise: replicate the steps above to test the finite difference computation # of the derivative against the analytical derivative of LJ. [ (y[i+1]-y[i])/(x[i+1]-x[i]) for i in ... import matplotlib.pyplot as plt plt.plot(x, y) plt.show() </source> === Review Notes on Functions with Function arguments (functionals) === <source lang="python"> # map : (a -> b), [ a ] -> [ b ] # map: map(str, [1,2,3]) --> [ "1", "2", "3" ] # ^ function (a -> b) # map(int, map(str, [1,2,3]) ) # - helpful for parsing # x = "1 2 3 4 5" # x.split() # ["1", "2", "3", "4", "5"] # map(int, x.split()) # [1,2,3,4,5] str([1,2,3]) # "[1, 2, 3]" (bad) map(str, [1,2,3]) # ["1", "2", "3"] (good) # filter: (a -> Bool), [a] -> [a] # Example filter: # '1' -> no # ' ' -> no # 'a-z' -> yes # 'A-Z' -> yes def f(x): # str -> Bool if x >= 'a' and x <= 'z': return True if x >= 'A' and x <= 'Z': return True return False filter(f, " 1 a b 2 \n") # reduce: (a,b -> a), [b], a -> a sum([1,2,3]) # -> 6 def add2(x,y): # x : int, y : int return x+y reduce(add2, [1,2,3], 0) # For an example where a != b: def append(x,y): # x : [int], y : int return x + [y] reduce(append, [1,2,3], []) # start with an empty list # Newton-Rhapson def nrhap(f, fp, x0, tol = 1e-6): y = f(x0) iter = 0 # guard against infinity while abs(y) > tol: iter += 1 if iter > 1000: raise ValueError, "Unable to converge!" x0 -= y/fp(x0) y = f(x0) return x0 # solve x^3 - 2 = 0 def f(x): return x**3 - 2 def fp(x): return 3*x**2 print( nrhap(f, fp, 1.0)**3 ) </source> === In-Class Problems === * Week 1: [[Media:CalculatorProbs.pdf|Calculator Problems]] ** Solutions: [http://predictivestatmech.org/terms/term.html] ** This solution uses python list comprehensions, and shows that the slowest step is actually unit conversion! * Week 2: [[Media:Pseudocode.pdf|Pseudocode Problems]] ** We will work these in class. For practice, be sure you have python list ideas down! ** Solutions: [https://docs.google.com/document/d/1HRkSdVNsTUydY4cVx67jRHRyhi5gL6nneEj9IX89wlE/edit?usp=sharing] * Week 3: [[Media:Plotting1.pdf|Plotting 1]] ** [https://stackoverflow.com/questions/11815538/how-to-import-matplotlib-in-python#11830055 Notes on installing Matplotlib on your own computer] ** Challenge: actions vs. functions -- what does the following code do: "[ print(1) for i in range(10) ]" (python3 only) * Week 4: [[Media:Plotting2.pdf|Plotting 2]] ** Solutions: [https://docs.google.com/document/d/1AanEFQmxLxoNM-662MHxsxToY3wsqovNx6SwcPQuBIg/edit?usp=sharing] * Week 5: Read pseudocode and plotting, focusing on types and syntax. Also, re-read the end of chapter summaries for Ch. 3, 5 and 6. * Week 6: Read the following pieces on first order logic [http://bayes.wustl.edu/etj/prob/book.pdf Chapter 1 of Jaynes' Book] [http://web.cecs.pdx.edu/~cs410aph/Lectures/Smalltalk%20II/Dijkstra%20on%20Hamming%27s%20Problem.pdf Hamming's Problem], and pages 71-80 in Chapter 4 of Hetland's Algorithms book (on induction). Just skip directly to chapter 4. ** Solutions [https://docs.google.com/document/d/14QZxh2SAWl3JE-SzVyemkAv4p9TBChO-jzZ5YpT8BZs/edit?usp=sharing] * Week 7: Review Hetland, Chapters 3-7. We'll do a series of parsing problems and flex our collective induction and recursion muscles. ** [https://docs.google.com/document/d/1i04oL7zJsD3KzvsPIaHBgwaOZ78UZvz5ReRDF-PlyF0/edit?usp=sharing Week 7 Problems] * Week 8: [[Media:Minimization1.pdf|Minimization Problems!]] * Week 10: [[Media:Minimization2.pdf|Molecular Optimization]] * Week 11: [[Media:Dynamics.pdf|Dynamical Problems]] * Week 12: [[Media:InvPend.pdf|Inverse Pendulum]] ** [[Simulating Rule 110]] * Week 13: No reading, simulate dynamics in the final project, scale up Rule 110 simulation and calculate histograms of local densities. === Homework === * Homework will be assigned through Repl.IT ** Homework 6 is described below * Project presentations will be on Mon.-Wed., Mar 5-7 * Final Projects are due by the end of the last week of classes. '''HW6''' (hand in on Wednesday, April 18) <blockquote> After reading through the SIAM guide on mathematical modeling, formulate an interesting question about the chemical behavior of mixed solvent systems. Don't be too constrained by what can and can't be simulated with MD, but do create a well-designed problem statement, list some possible assumptions that could help narrow down the problem scope, and clearly explain any quantitative variables that can be defined. It will help to reference chemical literature, including textbooks from your past courses. </blockquote> 59890ed1e06697d4f3500813474988f3ccf7ee3c 670 667 2018-04-20T13:19:09Z David M. Rogers 2 /* Homework */ wikitext text/x-wiki '''<BIG>Introduction to Scientific Computing</BIG>''' Course Info * Course Numbers CHM 4932-004/6938-010, CRN: 20438/20439 * Credit Hours: 3 * Meeting Dates: January 8 - April 25, 2018 ** No Class Jan. 15 or Mar. 12-18 * Meeting Times: Mon. and Wed., 12:30-13:45 in SCA 222 ** Midterm Project Presentations: Mon.-Wed., Mar 5 and 7. ** Final Project Presentations: Wed., May 2, 10:00am – 12:00pm (scheduled final date) ** Lab Session & Office Hours: Fri. 12:30-13:45 in IDR 214 (or SCA 222 by announcement) <pre> $ for((i=1;i<=4;i++)); do cal $i 2018; done ____ January 2018 ____ _____ March 2018 ____ | Su Mo Tu We Th Fr Sa | | Su Mo Tu We Th Fr Sa | 1 2 3 4 5 6 | | 1 (2) 3 1 | 7 8 9*10 11 12 13 | 9 | 4 (5) 6 (7) 8 9 10 2 | 14 x 16*17 18 19 20 | | x x 3 | 21*22 23 24 25 26 27 | 10 | 18*19 20 21 22 23 24 4 | 28*29 30 31 | 11 | 25*26 27 28 29 30 31 ___ February 2018 ____ _____ April 2018 ____ | Su Mo Tu We Th Fr Sa | | Su Mo Tu We Th Fr Sa | 1 2 3 | 12 | 1 *2 3 4 5 6 7 5 | 4 *5 6 7 8 9 10 | 13 | 8 *9 10 11 12 13 14 6 | 11*12 13 14 15 16 17 | 14 | 15*16 17 18 19 20 21 7 | 18*19 20 21 22 23 24 | 15 | 22*23 24(25)26 27 28 8 | 25*26 27 28 | | 29 x Week Topic 1 Calculator Form 2 Pseudocode 3 Plotting 1 (Excel) 4 Plotting 2 (Matplotlib and linear spaces) 5 Abstraction 1 (advanced functions and oo method) 6 Abstraction 2 (Booleans and logic) 7 2D transforms and iterated maps 8 Optimization 1 (Newton-Rhapson) 9 midterm project presentations 10 Optimization 2 (MD Energy) 11 ODE and SDE algorithms 12 Statistics 13 Complexity 14 Circe and Linux crash course 15 Compile & install process, ctypes </pre> == Overview == Mathematical models in the natural sciences take many shapes and forms. The moment they become more complicated than tracking a few variables over time, we have to put away our Excel spreadsheets and make use of a solid foundation in computational science. The course establishes this foundation by introducing data structures and algorithms used in everyday scientific computing using examples in the python scripting language. By the end of the Semester, students will be able to navigate the Linux command-line to go from a mathematical model to a numerical solution. Best practices for working with computer code and visualizing data will also be covered. == Topics == # Languages #* bash (shell) #* python (scripting) #* stack & register-based machine languages: overview of C and Fortran syntax & compiling with gcc, ‘thread safety’ #* Shared libraries & language inter-operability (FFI) # Algorithms #* Horner’s algorithm for polynomials #* Newton’s root finding algo. #* Overview of general optimization algo-s (example: linear & nonlin. least-squares) #* Numerical integration (scripted, plus gnu ODE) #* Communication (how HTTP get/put works) # Data Structures #* Linked Lists #* Trees (file system hierarchies) #* Graphs #* Arrays (dense & sparse) example: vectors & rotations / transpositions, densities and difference operators # Presentation & visualization #* Flat CSV files (and excel) #* Working with binary data #* Python matplotlib (2D images) #* Binning histograms & weighted averages # Best Practices #* High-level code design (modularity, interface specifications, unit testing, etc.) #* Code audit: open-source libraries, ex. Gnu Scientific Library, qsort in libc, Boost #* Source code versioning (example: git or mercurial) #* gdb & execution profiling #* documentation #* Makefiles == Grading == '''Grading Scale (out of 400 points possible)''' {| class="wikitable" |- ! Grade ! Undergraduate ! Graduate |- | A+ | 269 | 323 |- | A | 258 | 310 |- | A- | 250 | 300 |- | B+ | 241 | 290 |- | B | 230 | 276 |- | B- | 222 | 266 |- | C+ | 213 | 256 |- | C | 202 | 243 |- | C- | 194 | 233 |- | D+ | 186 | 223 |- | D | 175 | 210 |- | D- | 166 | 200 |} * (280 U / 330 G) Points Possible: ** 9 homework assignments (10 points per homework) ** 14 in-class assignments / quizzes (10 points per week) ** 2 projects / competitions (50 points per project) ** Undergraduates must complete 1 project, graduates must complete 2 * Important Rules ** For maximum benefit, homework should be done on-time. However, homework will be allowed to be re-submitted at any time for full credit, but must present a unique solution to previous work from yourself or others. ** All work must cite co-group members (if any) and the source of any code snippets used online. === Grading Rationale === Homework points will only be awarded for correct, working code and correct algorithmic analysis, while the homework problems will become progressively tougher. Undergraduates should be able to pass the course with an A if they have correctly answered most of the homework, appear at class prepared and on-time, and made a strong attempt at one of the projects. Graduate students should both perform well on the homework and successfully complete one or two projects. The re-grading for homework allows making up for missed assignments, and encourages returning to core concepts at a later point in the class. Students who have put in the studying effort, completed significant portions of the homework and projects both in- and out of class have thus demonstrated introductory programming proficiency. == Projects == * Midterm Project Description [[Media:Midterm2018.pdf]] (2 Mar., 2018) ** [[Agile|Agile Development Tips & Tricks]] * Midterm Projects: <!-- ** Luis & Matteo [https://drive.google.com/file/d/1tTkwRuJts2SnZcEkVlHO51ItacFfHYL3/view?usp=sharing_eil&ts=5a9d6cb2] ** Misty & Cherinee [https://docs.google.com/presentation/d/17UTtjv-2d19mTtYt9oVwrWI5eOuo7l2qg4zYsOGXTxw/edit?ts=5a9d7601#slide=id.gc6f90357f_0_0] ** Pauline [http://predictivestatmech.org/code/pauline.py] ** Nasha [http://predictivestatmech.org/code/nasha.py] ** Daniel [https://drive.google.com/drive/folders/1NNQEG7O8Pi1jGeMaPwcWYEBVI62BhYgD?usp=sharing] ** Melissa, Casidy & Paul [https://docs.google.com/presentation/d/10U8loA8uPMypoEWO163e6smZ9JnrPXjyQl97Duz8Hg8/edit?usp=sharing_eip&ts=5a9d6081] ** Kimberly [http://predictivestatmech.org/code/kimberly.py] ** Eric ** Jovina & Jesunifemi [http://predictivestatmech.org/code/jovina-nifemi.py] ** Jakin [https://docs.google.com/presentation/d/1LFh-_n6J2jC6FBEl-X4WTJqYyhwjnVucGdMBKsUFsjU/edit?usp=sharing_eip&ts=5a9d8fa1] ** Bryan [http://predictivestatmech.org/code/bryan.py] --> * [[Final2018|Final Project Description]] (25 Apr., 2018) == Textbooks and Resources == * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-0072-7 Beginning Python, Hetland, 2005] (eBook avail. from USF Library) * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-3238-4 Python Algorithms, Hetland, 2010] (eBook avail. from USF Library) * [http://aosabook.org/en/index.html The Architecture of Open Source Applications] * [http://docs.python.org Python Documentation] * [https://developers.google.com/edu/python/ Google Introductory Python Notes] * [http://huffman.sourceforge.net/tao/tao-of-programming.html Tao of Programming] Other (possibly useful) materials: * [http://hackersdictionary.com/html/entry/larval-stage.html The Jargon File] * Chapters 7&8 of Modelling and Simulation, Birta and Arbez, Springer 2007 (eBook avail. from USF Library). * Chapters 4-6 of Models and Algorithms for Intelligent Data Analysis, Runkler, Springer 2012 (eBook avail. from USF Library). * Guide to Scientific Computing in C++, Francis and Whiteley, Springer, 2012. (eBook avail. from USF Library) * Extra info. On the basics: ** Chapters 3 and 7 of Mathematics in Computing, Regan, Springer 2013. (eBook avail. from USF Library) ** Instant feedback graphical programming with [https://www.khanacademy.org/cs/programming/ Khan Academy] * [http://www.meetup.com/python-178/ Local PyBulls Meetings] Code: * [http://carsonfarmer.com/2013/07/essential-python-geo-libraries Python Libraries Useful for Geospatial Problems] * [[Code#Python_Libraries|Python Libraries Useful for Computational Chemistry]] (very small list at present) Interactive Interpreters: * [http://www.codewars.com CodeWars] Recommended for building experience with practice problems. * [http://codecombat.com/ CodeCombat] A very visual way to interact with your python code. * [http://exercism.io Exercism] A command-line client with a similar learn-through-challenge philosophy. * [http://repl.it repl.it] A read-eval-print loop for several computer languages. * [http://en.cppreference.com/w/cpp/language CppReference] Documentation with an online evaluator for C++ code. === Notes === * [[Media:Intro.pdf|Introduction Notes]] * [[Media:Week2.pdf|Function Syntax]] and [[Media:Week3.pdf|For-Loop Syntax]] cheat-sheets. * [[Media:PlottingMaps.pdf|Plotting Maps]] * [https://m3challenge.siam.org/sites/default/files/uploads/siam-guidebook-final-press.pdf SIAM Notes on Mathematical Modeling] * [[Code:libxdrfile|libxdrfile]] * The simple, yet amazing harmonic oscillator ** [http://hyperphysics.phy-astr.gsu.edu/hbase/shm.html Classical Oscillator] ** [http://hyperphysics.phy-astr.gsu.edu/hbase/quantum/hosc.html Quantum Oscillator] ** [http://hyperphysics.phy-astr.gsu.edu/hbase/quantum/hosc6.html#c2 Probabilities] * [[Code:MDIntro]] <!-- ** [[Turing Exercise]] ** [https://predictivestatmech.org/code/example.dcd Example DCD File] * [[Media:Week-5.2017.pdf|Week 5 Notes]] ** [[Code:PyTesting]] * [[Media:NumpyArrays.pdf|Week 7 Notes]] ** [http://www.labri.fr/perso/nrougier/from-python-to-numpy/ all about numpy] * Misc. Notes for Week 8 ** [[Physics:Pairs|Rundown of Pair Interactions]] ** Parameterized surfaces [[Media:param1.jpg|1]] and [[Media:param2.jpg|2]] * Notes for Compilation Lab ** [https://learnpythonthehardway.org/book/appendixa.html Command Line Crash Course] Cheat sheet for bash commands. ** USF's compute cluster documentation at [https://wiki.rc.usf.edu/index.php/Main_Page RC Wiki]. *** See especially the "Connecting to SC" and "Modules" sections ** [[Code:Compiling|Cheat-codes]] for compilation lab. * [[Media:jobs.pdf|Research Computing Batch Queue]] * [[Media:Plug-in.pdf|Plugging Into Libraries]] * [[Media:Matrix.pdf|Matrix Algorithms]] --> === Review Notes on Sequences, list comprehensions and arrays === <source lang="python"> # Say you want to make a plot of the LJ function on the domain x \in [0.9, 3] # 1. You could use the following two list comprehensions to be specific: x = [ i*(3-0.9)/100.0 + 0.9 for i in range(101) ] y = [ 4*(xi**-12 - xi**-6) for xi in x] # 2. You could implement the LJ function as a python function and use MAP, def LJ(x): ix6 = x**-6 # the factoring makes this calculation more efficient return 4*ix6*(ix6 + 1.0) y = map(LJ, x) # 3. You could work on arrays, where addition, multiplication, and powers are elementwise: ax = arange(101)*(3-0.9)/100 + 0.9 ay = LJ(ax) # Mind the difference in type! type(x) type(ax) # 4. You could totally cheat, and use numpy's builtin functions. ax = linspace(0.9, 3.0, 101) # Exercise: replicate the steps above to test the finite difference computation # of the derivative against the analytical derivative of LJ. [ (y[i+1]-y[i])/(x[i+1]-x[i]) for i in ... import matplotlib.pyplot as plt plt.plot(x, y) plt.show() </source> === Review Notes on Functions with Function arguments (functionals) === <source lang="python"> # map : (a -> b), [ a ] -> [ b ] # map: map(str, [1,2,3]) --> [ "1", "2", "3" ] # ^ function (a -> b) # map(int, map(str, [1,2,3]) ) # - helpful for parsing # x = "1 2 3 4 5" # x.split() # ["1", "2", "3", "4", "5"] # map(int, x.split()) # [1,2,3,4,5] str([1,2,3]) # "[1, 2, 3]" (bad) map(str, [1,2,3]) # ["1", "2", "3"] (good) # filter: (a -> Bool), [a] -> [a] # Example filter: # '1' -> no # ' ' -> no # 'a-z' -> yes # 'A-Z' -> yes def f(x): # str -> Bool if x >= 'a' and x <= 'z': return True if x >= 'A' and x <= 'Z': return True return False filter(f, " 1 a b 2 \n") # reduce: (a,b -> a), [b], a -> a sum([1,2,3]) # -> 6 def add2(x,y): # x : int, y : int return x+y reduce(add2, [1,2,3], 0) # For an example where a != b: def append(x,y): # x : [int], y : int return x + [y] reduce(append, [1,2,3], []) # start with an empty list # Newton-Rhapson def nrhap(f, fp, x0, tol = 1e-6): y = f(x0) iter = 0 # guard against infinity while abs(y) > tol: iter += 1 if iter > 1000: raise ValueError, "Unable to converge!" x0 -= y/fp(x0) y = f(x0) return x0 # solve x^3 - 2 = 0 def f(x): return x**3 - 2 def fp(x): return 3*x**2 print( nrhap(f, fp, 1.0)**3 ) </source> === In-Class Problems === * Week 1: [[Media:CalculatorProbs.pdf|Calculator Problems]] ** Solutions: [http://predictivestatmech.org/terms/term.html] ** This solution uses python list comprehensions, and shows that the slowest step is actually unit conversion! * Week 2: [[Media:Pseudocode.pdf|Pseudocode Problems]] ** We will work these in class. For practice, be sure you have python list ideas down! ** Solutions: [https://docs.google.com/document/d/1HRkSdVNsTUydY4cVx67jRHRyhi5gL6nneEj9IX89wlE/edit?usp=sharing] * Week 3: [[Media:Plotting1.pdf|Plotting 1]] ** [https://stackoverflow.com/questions/11815538/how-to-import-matplotlib-in-python#11830055 Notes on installing Matplotlib on your own computer] ** Challenge: actions vs. functions -- what does the following code do: "[ print(1) for i in range(10) ]" (python3 only) * Week 4: [[Media:Plotting2.pdf|Plotting 2]] ** Solutions: [https://docs.google.com/document/d/1AanEFQmxLxoNM-662MHxsxToY3wsqovNx6SwcPQuBIg/edit?usp=sharing] * Week 5: Read pseudocode and plotting, focusing on types and syntax. Also, re-read the end of chapter summaries for Ch. 3, 5 and 6. * Week 6: Read the following pieces on first order logic [http://bayes.wustl.edu/etj/prob/book.pdf Chapter 1 of Jaynes' Book] [http://web.cecs.pdx.edu/~cs410aph/Lectures/Smalltalk%20II/Dijkstra%20on%20Hamming%27s%20Problem.pdf Hamming's Problem], and pages 71-80 in Chapter 4 of Hetland's Algorithms book (on induction). Just skip directly to chapter 4. ** Solutions [https://docs.google.com/document/d/14QZxh2SAWl3JE-SzVyemkAv4p9TBChO-jzZ5YpT8BZs/edit?usp=sharing] * Week 7: Review Hetland, Chapters 3-7. We'll do a series of parsing problems and flex our collective induction and recursion muscles. ** [https://docs.google.com/document/d/1i04oL7zJsD3KzvsPIaHBgwaOZ78UZvz5ReRDF-PlyF0/edit?usp=sharing Week 7 Problems] * Week 8: [[Media:Minimization1.pdf|Minimization Problems!]] * Week 10: [[Media:Minimization2.pdf|Molecular Optimization]] * Week 11: [[Media:Dynamics.pdf|Dynamical Problems]] * Week 12: [[Media:InvPend.pdf|Inverse Pendulum]] ** [[Simulating Rule 110]] * Week 13: No reading, simulate dynamics in the final project, scale up Rule 110 simulation and calculate histograms of local densities. === Homework === * Homework will be assigned through Repl.IT ** Homework 6 is described below * Project presentations will be on Mon.-Wed., Mar 5-7 * Final Projects are due by the end of the last week of classes. '''HW6''' (hand in on Wednesday, April 18) <blockquote> After reading through the SIAM guide on mathematical modeling, formulate an interesting question about the chemical behavior of mixed solvent systems. Don't be too constrained by what can and can't be simulated with MD, but do create a well-designed problem statement, list some possible assumptions that could help narrow down the problem scope, and clearly explain any quantitative variables that can be defined. It will help to reference chemical literature, including textbooks from your past courses. </blockquote> '''Homework 7''' (hand in on Monday, April 23) <blockquote> Create pseudocode and identify relevant python/numpy/scipy data structures and functions for carrying out each of the following MD data analysis tasks. Be explicit about data types you choose for each variable, as well as the inputs and outputs of each function you define. Your pseudocode should be returned neatly handwritten or typed in outline form and should present a complete, workable solution. 1. How do I determine the best solvent for reaction chemistry? Chemical reactions at an industrial scale are always carried out under optimized conditions. Solvent composition (i.e. the mole fraction of each solvent molecule) are one factor that can be tuned in order to control reaction rate, yield, selectivity, and ease of purification. One factor that can be modeled is the difference in solubility between reactant and product molecules. The solubility product constant for a single molecule, K, is defined as the maximum concentration the molecule can be present in solution before further additions of the molecule `crash out' and form a solid rather than dissolving. Let's test the linear solvation free energy model, K(M) = K0 exp( sum_j n_j(M) u_j ), where K0 and k_j are constants for all molecules (M), the sum runs over the 'j' functional groups present in molecule M, with n_j(M) the number of functional groups of type 'j' in that molecule. Write pseudocode for a "guess and check" method that tries out possible parameters, K0 and u_j, to decide how well those parameters perform. Assume you have a table of K(M) and n_j(M) values available, and can call the function "generate_params" to generate a new parameter guess. 2. How fast is a 'diffusion-limited' reaction? Reaction rates depend on how many times the individual molecules involved in each step of the reaction collide. For a bimolecular reaction like an enzyme-substrate binding event, E + S -> (ES), the reaction rate can be limited by diffusion when binding is very strong (so that every collision leads to "irreversible" binding). MD can't simulate chemical reactions, so the analysis will be limited to determining whether the enzyme-substrate becomes small, indicating binding. Assume you have been given a trajectory of an enzyme in solution with 100 substrate molecules. Define a (distance-based) criteria for determining if a complex has formed when given the positions of 12 atoms on a key residue of the enzyme and all 10 atoms of the substrate. This criteria should be stated in terms of a function, with well-typed inputs and outputs. Then write pseudocode that uses the entire trajectory (and the function) to determine: i) the exact time-point (frame) at which an enzyme-substrate complex forms, and ii) whether that complex ever unbinds during the remainder of the simulation trajectory. For this exercise, you will need to use steps that define and use labels for substrates and/or atoms like "loop through substrates," "label that substrate as 'k'", and "check substrate 'k'", etc. Like adding main characters to a story, it's important to know when to give certain pieces of data individual names and types. </blockquote> 40c9bc5c24e7fd3e36b01dc399d6c227314d38ad 671 670 2018-04-20T13:20:14Z David M. Rogers 2 /* Homework */ wikitext text/x-wiki '''<BIG>Introduction to Scientific Computing</BIG>''' Course Info * Course Numbers CHM 4932-004/6938-010, CRN: 20438/20439 * Credit Hours: 3 * Meeting Dates: January 8 - April 25, 2018 ** No Class Jan. 15 or Mar. 12-18 * Meeting Times: Mon. and Wed., 12:30-13:45 in SCA 222 ** Midterm Project Presentations: Mon.-Wed., Mar 5 and 7. ** Final Project Presentations: Wed., May 2, 10:00am – 12:00pm (scheduled final date) ** Lab Session & Office Hours: Fri. 12:30-13:45 in IDR 214 (or SCA 222 by announcement) <pre> $ for((i=1;i<=4;i++)); do cal $i 2018; done ____ January 2018 ____ _____ March 2018 ____ | Su Mo Tu We Th Fr Sa | | Su Mo Tu We Th Fr Sa | 1 2 3 4 5 6 | | 1 (2) 3 1 | 7 8 9*10 11 12 13 | 9 | 4 (5) 6 (7) 8 9 10 2 | 14 x 16*17 18 19 20 | | x x 3 | 21*22 23 24 25 26 27 | 10 | 18*19 20 21 22 23 24 4 | 28*29 30 31 | 11 | 25*26 27 28 29 30 31 ___ February 2018 ____ _____ April 2018 ____ | Su Mo Tu We Th Fr Sa | | Su Mo Tu We Th Fr Sa | 1 2 3 | 12 | 1 *2 3 4 5 6 7 5 | 4 *5 6 7 8 9 10 | 13 | 8 *9 10 11 12 13 14 6 | 11*12 13 14 15 16 17 | 14 | 15*16 17 18 19 20 21 7 | 18*19 20 21 22 23 24 | 15 | 22*23 24(25)26 27 28 8 | 25*26 27 28 | | 29 x Week Topic 1 Calculator Form 2 Pseudocode 3 Plotting 1 (Excel) 4 Plotting 2 (Matplotlib and linear spaces) 5 Abstraction 1 (advanced functions and oo method) 6 Abstraction 2 (Booleans and logic) 7 2D transforms and iterated maps 8 Optimization 1 (Newton-Rhapson) 9 midterm project presentations 10 Optimization 2 (MD Energy) 11 ODE and SDE algorithms 12 Statistics 13 Complexity 14 Circe and Linux crash course 15 Compile & install process, ctypes </pre> == Overview == Mathematical models in the natural sciences take many shapes and forms. The moment they become more complicated than tracking a few variables over time, we have to put away our Excel spreadsheets and make use of a solid foundation in computational science. The course establishes this foundation by introducing data structures and algorithms used in everyday scientific computing using examples in the python scripting language. By the end of the Semester, students will be able to navigate the Linux command-line to go from a mathematical model to a numerical solution. Best practices for working with computer code and visualizing data will also be covered. == Topics == # Languages #* bash (shell) #* python (scripting) #* stack & register-based machine languages: overview of C and Fortran syntax & compiling with gcc, ‘thread safety’ #* Shared libraries & language inter-operability (FFI) # Algorithms #* Horner’s algorithm for polynomials #* Newton’s root finding algo. #* Overview of general optimization algo-s (example: linear & nonlin. least-squares) #* Numerical integration (scripted, plus gnu ODE) #* Communication (how HTTP get/put works) # Data Structures #* Linked Lists #* Trees (file system hierarchies) #* Graphs #* Arrays (dense & sparse) example: vectors & rotations / transpositions, densities and difference operators # Presentation & visualization #* Flat CSV files (and excel) #* Working with binary data #* Python matplotlib (2D images) #* Binning histograms & weighted averages # Best Practices #* High-level code design (modularity, interface specifications, unit testing, etc.) #* Code audit: open-source libraries, ex. Gnu Scientific Library, qsort in libc, Boost #* Source code versioning (example: git or mercurial) #* gdb & execution profiling #* documentation #* Makefiles == Grading == '''Grading Scale (out of 400 points possible)''' {| class="wikitable" |- ! Grade ! Undergraduate ! Graduate |- | A+ | 269 | 323 |- | A | 258 | 310 |- | A- | 250 | 300 |- | B+ | 241 | 290 |- | B | 230 | 276 |- | B- | 222 | 266 |- | C+ | 213 | 256 |- | C | 202 | 243 |- | C- | 194 | 233 |- | D+ | 186 | 223 |- | D | 175 | 210 |- | D- | 166 | 200 |} * (280 U / 330 G) Points Possible: ** 9 homework assignments (10 points per homework) ** 14 in-class assignments / quizzes (10 points per week) ** 2 projects / competitions (50 points per project) ** Undergraduates must complete 1 project, graduates must complete 2 * Important Rules ** For maximum benefit, homework should be done on-time. However, homework will be allowed to be re-submitted at any time for full credit, but must present a unique solution to previous work from yourself or others. ** All work must cite co-group members (if any) and the source of any code snippets used online. === Grading Rationale === Homework points will only be awarded for correct, working code and correct algorithmic analysis, while the homework problems will become progressively tougher. Undergraduates should be able to pass the course with an A if they have correctly answered most of the homework, appear at class prepared and on-time, and made a strong attempt at one of the projects. Graduate students should both perform well on the homework and successfully complete one or two projects. The re-grading for homework allows making up for missed assignments, and encourages returning to core concepts at a later point in the class. Students who have put in the studying effort, completed significant portions of the homework and projects both in- and out of class have thus demonstrated introductory programming proficiency. == Projects == * Midterm Project Description [[Media:Midterm2018.pdf]] (2 Mar., 2018) ** [[Agile|Agile Development Tips & Tricks]] * Midterm Projects: <!-- ** Luis & Matteo [https://drive.google.com/file/d/1tTkwRuJts2SnZcEkVlHO51ItacFfHYL3/view?usp=sharing_eil&ts=5a9d6cb2] ** Misty & Cherinee [https://docs.google.com/presentation/d/17UTtjv-2d19mTtYt9oVwrWI5eOuo7l2qg4zYsOGXTxw/edit?ts=5a9d7601#slide=id.gc6f90357f_0_0] ** Pauline [http://predictivestatmech.org/code/pauline.py] ** Nasha [http://predictivestatmech.org/code/nasha.py] ** Daniel [https://drive.google.com/drive/folders/1NNQEG7O8Pi1jGeMaPwcWYEBVI62BhYgD?usp=sharing] ** Melissa, Casidy & Paul [https://docs.google.com/presentation/d/10U8loA8uPMypoEWO163e6smZ9JnrPXjyQl97Duz8Hg8/edit?usp=sharing_eip&ts=5a9d6081] ** Kimberly [http://predictivestatmech.org/code/kimberly.py] ** Eric ** Jovina & Jesunifemi [http://predictivestatmech.org/code/jovina-nifemi.py] ** Jakin [https://docs.google.com/presentation/d/1LFh-_n6J2jC6FBEl-X4WTJqYyhwjnVucGdMBKsUFsjU/edit?usp=sharing_eip&ts=5a9d8fa1] ** Bryan [http://predictivestatmech.org/code/bryan.py] --> * [[Final2018|Final Project Description]] (25 Apr., 2018) == Textbooks and Resources == * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-0072-7 Beginning Python, Hetland, 2005] (eBook avail. from USF Library) * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-3238-4 Python Algorithms, Hetland, 2010] (eBook avail. from USF Library) * [http://aosabook.org/en/index.html The Architecture of Open Source Applications] * [http://docs.python.org Python Documentation] * [https://developers.google.com/edu/python/ Google Introductory Python Notes] * [http://huffman.sourceforge.net/tao/tao-of-programming.html Tao of Programming] Other (possibly useful) materials: * [http://hackersdictionary.com/html/entry/larval-stage.html The Jargon File] * Chapters 7&8 of Modelling and Simulation, Birta and Arbez, Springer 2007 (eBook avail. from USF Library). * Chapters 4-6 of Models and Algorithms for Intelligent Data Analysis, Runkler, Springer 2012 (eBook avail. from USF Library). * Guide to Scientific Computing in C++, Francis and Whiteley, Springer, 2012. (eBook avail. from USF Library) * Extra info. On the basics: ** Chapters 3 and 7 of Mathematics in Computing, Regan, Springer 2013. (eBook avail. from USF Library) ** Instant feedback graphical programming with [https://www.khanacademy.org/cs/programming/ Khan Academy] * [http://www.meetup.com/python-178/ Local PyBulls Meetings] Code: * [http://carsonfarmer.com/2013/07/essential-python-geo-libraries Python Libraries Useful for Geospatial Problems] * [[Code#Python_Libraries|Python Libraries Useful for Computational Chemistry]] (very small list at present) Interactive Interpreters: * [http://www.codewars.com CodeWars] Recommended for building experience with practice problems. * [http://codecombat.com/ CodeCombat] A very visual way to interact with your python code. * [http://exercism.io Exercism] A command-line client with a similar learn-through-challenge philosophy. * [http://repl.it repl.it] A read-eval-print loop for several computer languages. * [http://en.cppreference.com/w/cpp/language CppReference] Documentation with an online evaluator for C++ code. === Notes === * [[Media:Intro.pdf|Introduction Notes]] * [[Media:Week2.pdf|Function Syntax]] and [[Media:Week3.pdf|For-Loop Syntax]] cheat-sheets. * [[Media:PlottingMaps.pdf|Plotting Maps]] * [https://m3challenge.siam.org/sites/default/files/uploads/siam-guidebook-final-press.pdf SIAM Notes on Mathematical Modeling] * [[Code:libxdrfile|libxdrfile]] * The simple, yet amazing harmonic oscillator ** [http://hyperphysics.phy-astr.gsu.edu/hbase/shm.html Classical Oscillator] ** [http://hyperphysics.phy-astr.gsu.edu/hbase/quantum/hosc.html Quantum Oscillator] ** [http://hyperphysics.phy-astr.gsu.edu/hbase/quantum/hosc6.html#c2 Probabilities] * [[Code:MDIntro]] <!-- ** [[Turing Exercise]] ** [https://predictivestatmech.org/code/example.dcd Example DCD File] * [[Media:Week-5.2017.pdf|Week 5 Notes]] ** [[Code:PyTesting]] * [[Media:NumpyArrays.pdf|Week 7 Notes]] ** [http://www.labri.fr/perso/nrougier/from-python-to-numpy/ all about numpy] * Misc. Notes for Week 8 ** [[Physics:Pairs|Rundown of Pair Interactions]] ** Parameterized surfaces [[Media:param1.jpg|1]] and [[Media:param2.jpg|2]] * Notes for Compilation Lab ** [https://learnpythonthehardway.org/book/appendixa.html Command Line Crash Course] Cheat sheet for bash commands. ** USF's compute cluster documentation at [https://wiki.rc.usf.edu/index.php/Main_Page RC Wiki]. *** See especially the "Connecting to SC" and "Modules" sections ** [[Code:Compiling|Cheat-codes]] for compilation lab. * [[Media:jobs.pdf|Research Computing Batch Queue]] * [[Media:Plug-in.pdf|Plugging Into Libraries]] * [[Media:Matrix.pdf|Matrix Algorithms]] --> === Review Notes on Sequences, list comprehensions and arrays === <source lang="python"> # Say you want to make a plot of the LJ function on the domain x \in [0.9, 3] # 1. You could use the following two list comprehensions to be specific: x = [ i*(3-0.9)/100.0 + 0.9 for i in range(101) ] y = [ 4*(xi**-12 - xi**-6) for xi in x] # 2. You could implement the LJ function as a python function and use MAP, def LJ(x): ix6 = x**-6 # the factoring makes this calculation more efficient return 4*ix6*(ix6 + 1.0) y = map(LJ, x) # 3. You could work on arrays, where addition, multiplication, and powers are elementwise: ax = arange(101)*(3-0.9)/100 + 0.9 ay = LJ(ax) # Mind the difference in type! type(x) type(ax) # 4. You could totally cheat, and use numpy's builtin functions. ax = linspace(0.9, 3.0, 101) # Exercise: replicate the steps above to test the finite difference computation # of the derivative against the analytical derivative of LJ. [ (y[i+1]-y[i])/(x[i+1]-x[i]) for i in ... import matplotlib.pyplot as plt plt.plot(x, y) plt.show() </source> === Review Notes on Functions with Function arguments (functionals) === <source lang="python"> # map : (a -> b), [ a ] -> [ b ] # map: map(str, [1,2,3]) --> [ "1", "2", "3" ] # ^ function (a -> b) # map(int, map(str, [1,2,3]) ) # - helpful for parsing # x = "1 2 3 4 5" # x.split() # ["1", "2", "3", "4", "5"] # map(int, x.split()) # [1,2,3,4,5] str([1,2,3]) # "[1, 2, 3]" (bad) map(str, [1,2,3]) # ["1", "2", "3"] (good) # filter: (a -> Bool), [a] -> [a] # Example filter: # '1' -> no # ' ' -> no # 'a-z' -> yes # 'A-Z' -> yes def f(x): # str -> Bool if x >= 'a' and x <= 'z': return True if x >= 'A' and x <= 'Z': return True return False filter(f, " 1 a b 2 \n") # reduce: (a,b -> a), [b], a -> a sum([1,2,3]) # -> 6 def add2(x,y): # x : int, y : int return x+y reduce(add2, [1,2,3], 0) # For an example where a != b: def append(x,y): # x : [int], y : int return x + [y] reduce(append, [1,2,3], []) # start with an empty list # Newton-Rhapson def nrhap(f, fp, x0, tol = 1e-6): y = f(x0) iter = 0 # guard against infinity while abs(y) > tol: iter += 1 if iter > 1000: raise ValueError, "Unable to converge!" x0 -= y/fp(x0) y = f(x0) return x0 # solve x^3 - 2 = 0 def f(x): return x**3 - 2 def fp(x): return 3*x**2 print( nrhap(f, fp, 1.0)**3 ) </source> === In-Class Problems === * Week 1: [[Media:CalculatorProbs.pdf|Calculator Problems]] ** Solutions: [http://predictivestatmech.org/terms/term.html] ** This solution uses python list comprehensions, and shows that the slowest step is actually unit conversion! * Week 2: [[Media:Pseudocode.pdf|Pseudocode Problems]] ** We will work these in class. For practice, be sure you have python list ideas down! ** Solutions: [https://docs.google.com/document/d/1HRkSdVNsTUydY4cVx67jRHRyhi5gL6nneEj9IX89wlE/edit?usp=sharing] * Week 3: [[Media:Plotting1.pdf|Plotting 1]] ** [https://stackoverflow.com/questions/11815538/how-to-import-matplotlib-in-python#11830055 Notes on installing Matplotlib on your own computer] ** Challenge: actions vs. functions -- what does the following code do: "[ print(1) for i in range(10) ]" (python3 only) * Week 4: [[Media:Plotting2.pdf|Plotting 2]] ** Solutions: [https://docs.google.com/document/d/1AanEFQmxLxoNM-662MHxsxToY3wsqovNx6SwcPQuBIg/edit?usp=sharing] * Week 5: Read pseudocode and plotting, focusing on types and syntax. Also, re-read the end of chapter summaries for Ch. 3, 5 and 6. * Week 6: Read the following pieces on first order logic [http://bayes.wustl.edu/etj/prob/book.pdf Chapter 1 of Jaynes' Book] [http://web.cecs.pdx.edu/~cs410aph/Lectures/Smalltalk%20II/Dijkstra%20on%20Hamming%27s%20Problem.pdf Hamming's Problem], and pages 71-80 in Chapter 4 of Hetland's Algorithms book (on induction). Just skip directly to chapter 4. ** Solutions [https://docs.google.com/document/d/14QZxh2SAWl3JE-SzVyemkAv4p9TBChO-jzZ5YpT8BZs/edit?usp=sharing] * Week 7: Review Hetland, Chapters 3-7. We'll do a series of parsing problems and flex our collective induction and recursion muscles. ** [https://docs.google.com/document/d/1i04oL7zJsD3KzvsPIaHBgwaOZ78UZvz5ReRDF-PlyF0/edit?usp=sharing Week 7 Problems] * Week 8: [[Media:Minimization1.pdf|Minimization Problems!]] * Week 10: [[Media:Minimization2.pdf|Molecular Optimization]] * Week 11: [[Media:Dynamics.pdf|Dynamical Problems]] * Week 12: [[Media:InvPend.pdf|Inverse Pendulum]] ** [[Simulating Rule 110]] * Week 13: No reading, simulate dynamics in the final project, scale up Rule 110 simulation and calculate histograms of local densities. === Homework === * Homework will be assigned through Repl.IT ** Homework 6 is described below * Project presentations will be on Mon.-Wed., Mar 5-7 * Final Projects are due by the end of the last week of classes. '''HW6''' (hand in on Wednesday, April 18) <blockquote> After reading through the SIAM guide on mathematical modeling, formulate an interesting question about the chemical behavior of mixed solvent systems. Don't be too constrained by what can and can't be simulated with MD, but do create a well-designed problem statement, list some possible assumptions that could help narrow down the problem scope, and clearly explain any quantitative variables that can be defined. It will help to reference chemical literature, including textbooks from your past courses. </blockquote> '''Homework 7''' (hand in on Monday, April 23) <pre> Create pseudocode and identify relevant python/numpy/scipy data structures and functions for carrying out each of the following MD data analysis tasks. Be explicit about data types you choose for each variable, as well as the inputs and outputs of each function you define. Your pseudocode should be returned neatly handwritten or typed in outline form and should present a complete, workable solution. 1. How do I determine the best solvent for reaction chemistry? Chemical reactions at an industrial scale are always carried out under optimized conditions. Solvent composition (i.e. the mole fraction of each solvent molecule) are one factor that can be tuned in order to control reaction rate, yield, selectivity, and ease of purification. One factor that can be modeled is the difference in solubility between reactant and product molecules. The solubility product constant for a single molecule, K, is defined as the maximum concentration the molecule can be present in solution before further additions of the molecule `crash out' and form a solid rather than dissolving. Let's test the linear solvation free energy model, K(M) = K0 exp( sum_j n_j(M) u_j ), where K0 and k_j are constants for all molecules (M), the sum runs over the 'j' functional groups present in molecule M, with n_j(M) the number of functional groups of type 'j' in that molecule. Write pseudocode for a "guess and check" method that tries out possible parameters, K0 and u_j, to decide how well those parameters perform. Assume you have a table of K(M) and n_j(M) values available, and can call the function "generate_params" to generate a new parameter guess. 2. How fast is a 'diffusion-limited' reaction? Reaction rates depend on how many times the individual molecules involved in each step of the reaction collide. For a bimolecular reaction like an enzyme-substrate binding event, E + S -> (ES), the reaction rate can be limited by diffusion when binding is very strong (so that every collision leads to "irreversible" binding). MD can't simulate chemical reactions, so the analysis will be limited to determining whether the enzyme-substrate becomes small, indicating binding. Assume you have been given a trajectory of an enzyme in solution with 100 substrate molecules. Define a (distance-based) criteria for determining if a complex has formed when given the positions of 12 atoms on a key residue of the enzyme and all 10 atoms of the substrate. This criteria should be stated in terms of a function, with well-typed inputs and outputs. Then write pseudocode that uses the entire trajectory (and the function) to determine: i) the exact time-point (frame) at which an enzyme-substrate complex forms, and ii) whether that complex ever unbinds during the remainder of the simulation trajectory. For this exercise, you will need to use steps that define and use labels for substrates and/or atoms like "loop through substrates," "label that substrate as 'k'", and "check substrate 'k'", etc. Like adding main characters to a story, it's important to know when to give certain pieces of data individual names and types. </pre> 4fb953e5cf74d70723a7273739b557435c96ff00 672 671 2018-04-20T14:33:31Z David M. Rogers 2 /* Homework */ wikitext text/x-wiki '''<BIG>Introduction to Scientific Computing</BIG>''' Course Info * Course Numbers CHM 4932-004/6938-010, CRN: 20438/20439 * Credit Hours: 3 * Meeting Dates: January 8 - April 25, 2018 ** No Class Jan. 15 or Mar. 12-18 * Meeting Times: Mon. and Wed., 12:30-13:45 in SCA 222 ** Midterm Project Presentations: Mon.-Wed., Mar 5 and 7. ** Final Project Presentations: Wed., May 2, 10:00am – 12:00pm (scheduled final date) ** Lab Session & Office Hours: Fri. 12:30-13:45 in IDR 214 (or SCA 222 by announcement) <pre> $ for((i=1;i<=4;i++)); do cal $i 2018; done ____ January 2018 ____ _____ March 2018 ____ | Su Mo Tu We Th Fr Sa | | Su Mo Tu We Th Fr Sa | 1 2 3 4 5 6 | | 1 (2) 3 1 | 7 8 9*10 11 12 13 | 9 | 4 (5) 6 (7) 8 9 10 2 | 14 x 16*17 18 19 20 | | x x 3 | 21*22 23 24 25 26 27 | 10 | 18*19 20 21 22 23 24 4 | 28*29 30 31 | 11 | 25*26 27 28 29 30 31 ___ February 2018 ____ _____ April 2018 ____ | Su Mo Tu We Th Fr Sa | | Su Mo Tu We Th Fr Sa | 1 2 3 | 12 | 1 *2 3 4 5 6 7 5 | 4 *5 6 7 8 9 10 | 13 | 8 *9 10 11 12 13 14 6 | 11*12 13 14 15 16 17 | 14 | 15*16 17 18 19 20 21 7 | 18*19 20 21 22 23 24 | 15 | 22*23 24(25)26 27 28 8 | 25*26 27 28 | | 29 x Week Topic 1 Calculator Form 2 Pseudocode 3 Plotting 1 (Excel) 4 Plotting 2 (Matplotlib and linear spaces) 5 Abstraction 1 (advanced functions and oo method) 6 Abstraction 2 (Booleans and logic) 7 2D transforms and iterated maps 8 Optimization 1 (Newton-Rhapson) 9 midterm project presentations 10 Optimization 2 (MD Energy) 11 ODE and SDE algorithms 12 Statistics 13 Complexity 14 Circe and Linux crash course 15 Compile & install process, ctypes </pre> == Overview == Mathematical models in the natural sciences take many shapes and forms. The moment they become more complicated than tracking a few variables over time, we have to put away our Excel spreadsheets and make use of a solid foundation in computational science. The course establishes this foundation by introducing data structures and algorithms used in everyday scientific computing using examples in the python scripting language. By the end of the Semester, students will be able to navigate the Linux command-line to go from a mathematical model to a numerical solution. Best practices for working with computer code and visualizing data will also be covered. == Topics == # Languages #* bash (shell) #* python (scripting) #* stack & register-based machine languages: overview of C and Fortran syntax & compiling with gcc, ‘thread safety’ #* Shared libraries & language inter-operability (FFI) # Algorithms #* Horner’s algorithm for polynomials #* Newton’s root finding algo. #* Overview of general optimization algo-s (example: linear & nonlin. least-squares) #* Numerical integration (scripted, plus gnu ODE) #* Communication (how HTTP get/put works) # Data Structures #* Linked Lists #* Trees (file system hierarchies) #* Graphs #* Arrays (dense & sparse) example: vectors & rotations / transpositions, densities and difference operators # Presentation & visualization #* Flat CSV files (and excel) #* Working with binary data #* Python matplotlib (2D images) #* Binning histograms & weighted averages # Best Practices #* High-level code design (modularity, interface specifications, unit testing, etc.) #* Code audit: open-source libraries, ex. Gnu Scientific Library, qsort in libc, Boost #* Source code versioning (example: git or mercurial) #* gdb & execution profiling #* documentation #* Makefiles == Grading == '''Grading Scale (out of 400 points possible)''' {| class="wikitable" |- ! Grade ! Undergraduate ! Graduate |- | A+ | 269 | 323 |- | A | 258 | 310 |- | A- | 250 | 300 |- | B+ | 241 | 290 |- | B | 230 | 276 |- | B- | 222 | 266 |- | C+ | 213 | 256 |- | C | 202 | 243 |- | C- | 194 | 233 |- | D+ | 186 | 223 |- | D | 175 | 210 |- | D- | 166 | 200 |} * (280 U / 330 G) Points Possible: ** 9 homework assignments (10 points per homework) ** 14 in-class assignments / quizzes (10 points per week) ** 2 projects / competitions (50 points per project) ** Undergraduates must complete 1 project, graduates must complete 2 * Important Rules ** For maximum benefit, homework should be done on-time. However, homework will be allowed to be re-submitted at any time for full credit, but must present a unique solution to previous work from yourself or others. ** All work must cite co-group members (if any) and the source of any code snippets used online. === Grading Rationale === Homework points will only be awarded for correct, working code and correct algorithmic analysis, while the homework problems will become progressively tougher. Undergraduates should be able to pass the course with an A if they have correctly answered most of the homework, appear at class prepared and on-time, and made a strong attempt at one of the projects. Graduate students should both perform well on the homework and successfully complete one or two projects. The re-grading for homework allows making up for missed assignments, and encourages returning to core concepts at a later point in the class. Students who have put in the studying effort, completed significant portions of the homework and projects both in- and out of class have thus demonstrated introductory programming proficiency. == Projects == * Midterm Project Description [[Media:Midterm2018.pdf]] (2 Mar., 2018) ** [[Agile|Agile Development Tips & Tricks]] * Midterm Projects: <!-- ** Luis & Matteo [https://drive.google.com/file/d/1tTkwRuJts2SnZcEkVlHO51ItacFfHYL3/view?usp=sharing_eil&ts=5a9d6cb2] ** Misty & Cherinee [https://docs.google.com/presentation/d/17UTtjv-2d19mTtYt9oVwrWI5eOuo7l2qg4zYsOGXTxw/edit?ts=5a9d7601#slide=id.gc6f90357f_0_0] ** Pauline [http://predictivestatmech.org/code/pauline.py] ** Nasha [http://predictivestatmech.org/code/nasha.py] ** Daniel [https://drive.google.com/drive/folders/1NNQEG7O8Pi1jGeMaPwcWYEBVI62BhYgD?usp=sharing] ** Melissa, Casidy & Paul [https://docs.google.com/presentation/d/10U8loA8uPMypoEWO163e6smZ9JnrPXjyQl97Duz8Hg8/edit?usp=sharing_eip&ts=5a9d6081] ** Kimberly [http://predictivestatmech.org/code/kimberly.py] ** Eric ** Jovina & Jesunifemi [http://predictivestatmech.org/code/jovina-nifemi.py] ** Jakin [https://docs.google.com/presentation/d/1LFh-_n6J2jC6FBEl-X4WTJqYyhwjnVucGdMBKsUFsjU/edit?usp=sharing_eip&ts=5a9d8fa1] ** Bryan [http://predictivestatmech.org/code/bryan.py] --> * [[Final2018|Final Project Description]] (25 Apr., 2018) == Textbooks and Resources == * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-0072-7 Beginning Python, Hetland, 2005] (eBook avail. from USF Library) * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-3238-4 Python Algorithms, Hetland, 2010] (eBook avail. from USF Library) * [http://aosabook.org/en/index.html The Architecture of Open Source Applications] * [http://docs.python.org Python Documentation] * [https://developers.google.com/edu/python/ Google Introductory Python Notes] * [http://huffman.sourceforge.net/tao/tao-of-programming.html Tao of Programming] Other (possibly useful) materials: * [http://hackersdictionary.com/html/entry/larval-stage.html The Jargon File] * Chapters 7&8 of Modelling and Simulation, Birta and Arbez, Springer 2007 (eBook avail. from USF Library). * Chapters 4-6 of Models and Algorithms for Intelligent Data Analysis, Runkler, Springer 2012 (eBook avail. from USF Library). * Guide to Scientific Computing in C++, Francis and Whiteley, Springer, 2012. (eBook avail. from USF Library) * Extra info. On the basics: ** Chapters 3 and 7 of Mathematics in Computing, Regan, Springer 2013. (eBook avail. from USF Library) ** Instant feedback graphical programming with [https://www.khanacademy.org/cs/programming/ Khan Academy] * [http://www.meetup.com/python-178/ Local PyBulls Meetings] Code: * [http://carsonfarmer.com/2013/07/essential-python-geo-libraries Python Libraries Useful for Geospatial Problems] * [[Code#Python_Libraries|Python Libraries Useful for Computational Chemistry]] (very small list at present) Interactive Interpreters: * [http://www.codewars.com CodeWars] Recommended for building experience with practice problems. * [http://codecombat.com/ CodeCombat] A very visual way to interact with your python code. * [http://exercism.io Exercism] A command-line client with a similar learn-through-challenge philosophy. * [http://repl.it repl.it] A read-eval-print loop for several computer languages. * [http://en.cppreference.com/w/cpp/language CppReference] Documentation with an online evaluator for C++ code. === Notes === * [[Media:Intro.pdf|Introduction Notes]] * [[Media:Week2.pdf|Function Syntax]] and [[Media:Week3.pdf|For-Loop Syntax]] cheat-sheets. * [[Media:PlottingMaps.pdf|Plotting Maps]] * [https://m3challenge.siam.org/sites/default/files/uploads/siam-guidebook-final-press.pdf SIAM Notes on Mathematical Modeling] * [[Code:libxdrfile|libxdrfile]] * The simple, yet amazing harmonic oscillator ** [http://hyperphysics.phy-astr.gsu.edu/hbase/shm.html Classical Oscillator] ** [http://hyperphysics.phy-astr.gsu.edu/hbase/quantum/hosc.html Quantum Oscillator] ** [http://hyperphysics.phy-astr.gsu.edu/hbase/quantum/hosc6.html#c2 Probabilities] * [[Code:MDIntro]] <!-- ** [[Turing Exercise]] ** [https://predictivestatmech.org/code/example.dcd Example DCD File] * [[Media:Week-5.2017.pdf|Week 5 Notes]] ** [[Code:PyTesting]] * [[Media:NumpyArrays.pdf|Week 7 Notes]] ** [http://www.labri.fr/perso/nrougier/from-python-to-numpy/ all about numpy] * Misc. Notes for Week 8 ** [[Physics:Pairs|Rundown of Pair Interactions]] ** Parameterized surfaces [[Media:param1.jpg|1]] and [[Media:param2.jpg|2]] * Notes for Compilation Lab ** [https://learnpythonthehardway.org/book/appendixa.html Command Line Crash Course] Cheat sheet for bash commands. ** USF's compute cluster documentation at [https://wiki.rc.usf.edu/index.php/Main_Page RC Wiki]. *** See especially the "Connecting to SC" and "Modules" sections ** [[Code:Compiling|Cheat-codes]] for compilation lab. * [[Media:jobs.pdf|Research Computing Batch Queue]] * [[Media:Plug-in.pdf|Plugging Into Libraries]] * [[Media:Matrix.pdf|Matrix Algorithms]] --> === Review Notes on Sequences, list comprehensions and arrays === <source lang="python"> # Say you want to make a plot of the LJ function on the domain x \in [0.9, 3] # 1. You could use the following two list comprehensions to be specific: x = [ i*(3-0.9)/100.0 + 0.9 for i in range(101) ] y = [ 4*(xi**-12 - xi**-6) for xi in x] # 2. You could implement the LJ function as a python function and use MAP, def LJ(x): ix6 = x**-6 # the factoring makes this calculation more efficient return 4*ix6*(ix6 + 1.0) y = map(LJ, x) # 3. You could work on arrays, where addition, multiplication, and powers are elementwise: ax = arange(101)*(3-0.9)/100 + 0.9 ay = LJ(ax) # Mind the difference in type! type(x) type(ax) # 4. You could totally cheat, and use numpy's builtin functions. ax = linspace(0.9, 3.0, 101) # Exercise: replicate the steps above to test the finite difference computation # of the derivative against the analytical derivative of LJ. [ (y[i+1]-y[i])/(x[i+1]-x[i]) for i in ... import matplotlib.pyplot as plt plt.plot(x, y) plt.show() </source> === Review Notes on Functions with Function arguments (functionals) === <source lang="python"> # map : (a -> b), [ a ] -> [ b ] # map: map(str, [1,2,3]) --> [ "1", "2", "3" ] # ^ function (a -> b) # map(int, map(str, [1,2,3]) ) # - helpful for parsing # x = "1 2 3 4 5" # x.split() # ["1", "2", "3", "4", "5"] # map(int, x.split()) # [1,2,3,4,5] str([1,2,3]) # "[1, 2, 3]" (bad) map(str, [1,2,3]) # ["1", "2", "3"] (good) # filter: (a -> Bool), [a] -> [a] # Example filter: # '1' -> no # ' ' -> no # 'a-z' -> yes # 'A-Z' -> yes def f(x): # str -> Bool if x >= 'a' and x <= 'z': return True if x >= 'A' and x <= 'Z': return True return False filter(f, " 1 a b 2 \n") # reduce: (a,b -> a), [b], a -> a sum([1,2,3]) # -> 6 def add2(x,y): # x : int, y : int return x+y reduce(add2, [1,2,3], 0) # For an example where a != b: def append(x,y): # x : [int], y : int return x + [y] reduce(append, [1,2,3], []) # start with an empty list # Newton-Rhapson def nrhap(f, fp, x0, tol = 1e-6): y = f(x0) iter = 0 # guard against infinity while abs(y) > tol: iter += 1 if iter > 1000: raise ValueError, "Unable to converge!" x0 -= y/fp(x0) y = f(x0) return x0 # solve x^3 - 2 = 0 def f(x): return x**3 - 2 def fp(x): return 3*x**2 print( nrhap(f, fp, 1.0)**3 ) </source> === In-Class Problems === * Week 1: [[Media:CalculatorProbs.pdf|Calculator Problems]] ** Solutions: [http://predictivestatmech.org/terms/term.html] ** This solution uses python list comprehensions, and shows that the slowest step is actually unit conversion! * Week 2: [[Media:Pseudocode.pdf|Pseudocode Problems]] ** We will work these in class. For practice, be sure you have python list ideas down! ** Solutions: [https://docs.google.com/document/d/1HRkSdVNsTUydY4cVx67jRHRyhi5gL6nneEj9IX89wlE/edit?usp=sharing] * Week 3: [[Media:Plotting1.pdf|Plotting 1]] ** [https://stackoverflow.com/questions/11815538/how-to-import-matplotlib-in-python#11830055 Notes on installing Matplotlib on your own computer] ** Challenge: actions vs. functions -- what does the following code do: "[ print(1) for i in range(10) ]" (python3 only) * Week 4: [[Media:Plotting2.pdf|Plotting 2]] ** Solutions: [https://docs.google.com/document/d/1AanEFQmxLxoNM-662MHxsxToY3wsqovNx6SwcPQuBIg/edit?usp=sharing] * Week 5: Read pseudocode and plotting, focusing on types and syntax. Also, re-read the end of chapter summaries for Ch. 3, 5 and 6. * Week 6: Read the following pieces on first order logic [http://bayes.wustl.edu/etj/prob/book.pdf Chapter 1 of Jaynes' Book] [http://web.cecs.pdx.edu/~cs410aph/Lectures/Smalltalk%20II/Dijkstra%20on%20Hamming%27s%20Problem.pdf Hamming's Problem], and pages 71-80 in Chapter 4 of Hetland's Algorithms book (on induction). Just skip directly to chapter 4. ** Solutions [https://docs.google.com/document/d/14QZxh2SAWl3JE-SzVyemkAv4p9TBChO-jzZ5YpT8BZs/edit?usp=sharing] * Week 7: Review Hetland, Chapters 3-7. We'll do a series of parsing problems and flex our collective induction and recursion muscles. ** [https://docs.google.com/document/d/1i04oL7zJsD3KzvsPIaHBgwaOZ78UZvz5ReRDF-PlyF0/edit?usp=sharing Week 7 Problems] * Week 8: [[Media:Minimization1.pdf|Minimization Problems!]] * Week 10: [[Media:Minimization2.pdf|Molecular Optimization]] * Week 11: [[Media:Dynamics.pdf|Dynamical Problems]] * Week 12: [[Media:InvPend.pdf|Inverse Pendulum]] ** [[Simulating Rule 110]] * Week 13: No reading, simulate dynamics in the final project, scale up Rule 110 simulation and calculate histograms of local densities. === Homework === * Homework will be assigned through Repl.IT ** Homework 6 is described below * Project presentations will be on Mon.-Wed., Mar 5-7 * Final Projects are due by the end of the last week of classes. '''HW6''' (hand in on Wednesday, April 18) <blockquote> After reading through the SIAM guide on mathematical modeling, formulate an interesting question about the chemical behavior of mixed solvent systems. Don't be too constrained by what can and can't be simulated with MD, but do create a well-designed problem statement, list some possible assumptions that could help narrow down the problem scope, and clearly explain any quantitative variables that can be defined. It will help to reference chemical literature, including textbooks from your past courses. </blockquote> '''Homework 7''' (hand in on Monday, April 23) <pre> Create pseudocode and identify relevant python/numpy/scipy data structures and functions for carrying out each of the following MD data analysis tasks. Be explicit about data types you choose for each variable, as well as the inputs and outputs of each function you define. Your pseudocode should be returned neatly handwritten or typed in outline form and should present a complete, workable solution. 1. How do I determine the best solvent for reaction chemistry? Chemical reactions at an industrial scale are always carried out under optimized conditions. Solvent composition (i.e. the mole fraction of each solvent molecule) are one factor that can be tuned in order to control reaction rate, yield, selectivity, and ease of purification. One factor that can be modeled is the difference in solubility between reactant and product molecules. The solubility product constant for a single molecule, K, is defined as the maximum concentration the molecule can be present in solution before further additions of the molecule `crash out' and form a solid rather than dissolving. Let's test the linear solvation free energy model, K(M) = K0 exp( sum_j n_j(M) u_j ), where K0 and k_j are constants for all molecules (M), the sum runs over the 'j' functional groups present in molecule M, with n_j(M) the number of functional groups of type 'j' in that molecule. Write pseudocode for a "guess and check" method that tries out possible parameters, K0 and u_j, to decide how well those parameters perform. Assume you have a table of K(M) and n_j(M) values available, and can call the function "generate_params" to generate a new parameter guess. 2. How fast is a 'diffusion-limited' reaction? Reaction rates depend on how many times the individual molecules involved in each step of the reaction collide. For a bimolecular reaction like an enzyme-substrate binding event, E + S -> (ES), the reaction rate can be limited by diffusion when binding is very strong (so that every collision leads to "irreversible" binding). MD can't simulate chemical reactions, so the analysis will be limited to determining whether the enzyme-substrate becomes small, indicating binding. Assume you have been given a trajectory of an enzyme in solution with 100 substrate molecules. Define a (distance-based) criteria for determining if a complex has formed when given the positions of 12 atoms on a key residue of the enzyme and all 10 atoms of the substrate. This criteria should be stated in terms of a function, with well-typed inputs and outputs. Then write pseudocode that uses the entire trajectory (and the function) to determine: i) the exact time-point (frame) at which an enzyme-substrate complex forms, and ii) whether that complex ever unbinds during the remainder of the simulation trajectory. For this exercise, you will need to use steps that define and use labels for substrates and/or atoms like "loop through substrates," "label that substrate as 'k'", and "check substrate 'k'", etc. Like adding main characters to a story, it's important to know when to give certain pieces of data individual names and types. </pre> '''Homework 8''' - Due Friday, April 27. (hand in on Wednesday or email by Friday COB). <pre> Revise your midterm project code using what you've learned in this class to make it more structured and maintainable. In some cases, this may simply require adding documentation and in other cases, this may be simplest to accomplish with a complete re-write. The completed code must contain: 1) at least two functions, documented with input and output types and explanations, as well as example input -> output pairs, 2) at least one loop, and 3) at least one new data structure, with a documented type and an example instance that matches the given type. One way to satisfy the last requirement is opting to change the shape of an existing array in the code or to regroup data into an array, list, or dictionary. </pre> 86d10fae48266564c676417597ceeb85f44e63b4 673 672 2018-04-22T18:31:25Z David M. Rogers 2 /* In-Class Problems */ wikitext text/x-wiki '''<BIG>Introduction to Scientific Computing</BIG>''' Course Info * Course Numbers CHM 4932-004/6938-010, CRN: 20438/20439 * Credit Hours: 3 * Meeting Dates: January 8 - April 25, 2018 ** No Class Jan. 15 or Mar. 12-18 * Meeting Times: Mon. and Wed., 12:30-13:45 in SCA 222 ** Midterm Project Presentations: Mon.-Wed., Mar 5 and 7. ** Final Project Presentations: Wed., May 2, 10:00am – 12:00pm (scheduled final date) ** Lab Session & Office Hours: Fri. 12:30-13:45 in IDR 214 (or SCA 222 by announcement) <pre> $ for((i=1;i<=4;i++)); do cal $i 2018; done ____ January 2018 ____ _____ March 2018 ____ | Su Mo Tu We Th Fr Sa | | Su Mo Tu We Th Fr Sa | 1 2 3 4 5 6 | | 1 (2) 3 1 | 7 8 9*10 11 12 13 | 9 | 4 (5) 6 (7) 8 9 10 2 | 14 x 16*17 18 19 20 | | x x 3 | 21*22 23 24 25 26 27 | 10 | 18*19 20 21 22 23 24 4 | 28*29 30 31 | 11 | 25*26 27 28 29 30 31 ___ February 2018 ____ _____ April 2018 ____ | Su Mo Tu We Th Fr Sa | | Su Mo Tu We Th Fr Sa | 1 2 3 | 12 | 1 *2 3 4 5 6 7 5 | 4 *5 6 7 8 9 10 | 13 | 8 *9 10 11 12 13 14 6 | 11*12 13 14 15 16 17 | 14 | 15*16 17 18 19 20 21 7 | 18*19 20 21 22 23 24 | 15 | 22*23 24(25)26 27 28 8 | 25*26 27 28 | | 29 x Week Topic 1 Calculator Form 2 Pseudocode 3 Plotting 1 (Excel) 4 Plotting 2 (Matplotlib and linear spaces) 5 Abstraction 1 (advanced functions and oo method) 6 Abstraction 2 (Booleans and logic) 7 2D transforms and iterated maps 8 Optimization 1 (Newton-Rhapson) 9 midterm project presentations 10 Optimization 2 (MD Energy) 11 ODE and SDE algorithms 12 Statistics 13 Complexity 14 Circe and Linux crash course 15 Compile & install process, ctypes </pre> == Overview == Mathematical models in the natural sciences take many shapes and forms. The moment they become more complicated than tracking a few variables over time, we have to put away our Excel spreadsheets and make use of a solid foundation in computational science. The course establishes this foundation by introducing data structures and algorithms used in everyday scientific computing using examples in the python scripting language. By the end of the Semester, students will be able to navigate the Linux command-line to go from a mathematical model to a numerical solution. Best practices for working with computer code and visualizing data will also be covered. == Topics == # Languages #* bash (shell) #* python (scripting) #* stack & register-based machine languages: overview of C and Fortran syntax & compiling with gcc, ‘thread safety’ #* Shared libraries & language inter-operability (FFI) # Algorithms #* Horner’s algorithm for polynomials #* Newton’s root finding algo. #* Overview of general optimization algo-s (example: linear & nonlin. least-squares) #* Numerical integration (scripted, plus gnu ODE) #* Communication (how HTTP get/put works) # Data Structures #* Linked Lists #* Trees (file system hierarchies) #* Graphs #* Arrays (dense & sparse) example: vectors & rotations / transpositions, densities and difference operators # Presentation & visualization #* Flat CSV files (and excel) #* Working with binary data #* Python matplotlib (2D images) #* Binning histograms & weighted averages # Best Practices #* High-level code design (modularity, interface specifications, unit testing, etc.) #* Code audit: open-source libraries, ex. Gnu Scientific Library, qsort in libc, Boost #* Source code versioning (example: git or mercurial) #* gdb & execution profiling #* documentation #* Makefiles == Grading == '''Grading Scale (out of 400 points possible)''' {| class="wikitable" |- ! Grade ! Undergraduate ! Graduate |- | A+ | 269 | 323 |- | A | 258 | 310 |- | A- | 250 | 300 |- | B+ | 241 | 290 |- | B | 230 | 276 |- | B- | 222 | 266 |- | C+ | 213 | 256 |- | C | 202 | 243 |- | C- | 194 | 233 |- | D+ | 186 | 223 |- | D | 175 | 210 |- | D- | 166 | 200 |} * (280 U / 330 G) Points Possible: ** 9 homework assignments (10 points per homework) ** 14 in-class assignments / quizzes (10 points per week) ** 2 projects / competitions (50 points per project) ** Undergraduates must complete 1 project, graduates must complete 2 * Important Rules ** For maximum benefit, homework should be done on-time. However, homework will be allowed to be re-submitted at any time for full credit, but must present a unique solution to previous work from yourself or others. ** All work must cite co-group members (if any) and the source of any code snippets used online. === Grading Rationale === Homework points will only be awarded for correct, working code and correct algorithmic analysis, while the homework problems will become progressively tougher. Undergraduates should be able to pass the course with an A if they have correctly answered most of the homework, appear at class prepared and on-time, and made a strong attempt at one of the projects. Graduate students should both perform well on the homework and successfully complete one or two projects. The re-grading for homework allows making up for missed assignments, and encourages returning to core concepts at a later point in the class. Students who have put in the studying effort, completed significant portions of the homework and projects both in- and out of class have thus demonstrated introductory programming proficiency. == Projects == * Midterm Project Description [[Media:Midterm2018.pdf]] (2 Mar., 2018) ** [[Agile|Agile Development Tips & Tricks]] * Midterm Projects: <!-- ** Luis & Matteo [https://drive.google.com/file/d/1tTkwRuJts2SnZcEkVlHO51ItacFfHYL3/view?usp=sharing_eil&ts=5a9d6cb2] ** Misty & Cherinee [https://docs.google.com/presentation/d/17UTtjv-2d19mTtYt9oVwrWI5eOuo7l2qg4zYsOGXTxw/edit?ts=5a9d7601#slide=id.gc6f90357f_0_0] ** Pauline [http://predictivestatmech.org/code/pauline.py] ** Nasha [http://predictivestatmech.org/code/nasha.py] ** Daniel [https://drive.google.com/drive/folders/1NNQEG7O8Pi1jGeMaPwcWYEBVI62BhYgD?usp=sharing] ** Melissa, Casidy & Paul [https://docs.google.com/presentation/d/10U8loA8uPMypoEWO163e6smZ9JnrPXjyQl97Duz8Hg8/edit?usp=sharing_eip&ts=5a9d6081] ** Kimberly [http://predictivestatmech.org/code/kimberly.py] ** Eric ** Jovina & Jesunifemi [http://predictivestatmech.org/code/jovina-nifemi.py] ** Jakin [https://docs.google.com/presentation/d/1LFh-_n6J2jC6FBEl-X4WTJqYyhwjnVucGdMBKsUFsjU/edit?usp=sharing_eip&ts=5a9d8fa1] ** Bryan [http://predictivestatmech.org/code/bryan.py] --> * [[Final2018|Final Project Description]] (25 Apr., 2018) == Textbooks and Resources == * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-0072-7 Beginning Python, Hetland, 2005] (eBook avail. from USF Library) * [http://link.springer.com.ezproxy.lib.usf.edu/book/10.1007%2F978-1-4302-3238-4 Python Algorithms, Hetland, 2010] (eBook avail. from USF Library) * [http://aosabook.org/en/index.html The Architecture of Open Source Applications] * [http://docs.python.org Python Documentation] * [https://developers.google.com/edu/python/ Google Introductory Python Notes] * [http://huffman.sourceforge.net/tao/tao-of-programming.html Tao of Programming] Other (possibly useful) materials: * [http://hackersdictionary.com/html/entry/larval-stage.html The Jargon File] * Chapters 7&8 of Modelling and Simulation, Birta and Arbez, Springer 2007 (eBook avail. from USF Library). * Chapters 4-6 of Models and Algorithms for Intelligent Data Analysis, Runkler, Springer 2012 (eBook avail. from USF Library). * Guide to Scientific Computing in C++, Francis and Whiteley, Springer, 2012. (eBook avail. from USF Library) * Extra info. On the basics: ** Chapters 3 and 7 of Mathematics in Computing, Regan, Springer 2013. (eBook avail. from USF Library) ** Instant feedback graphical programming with [https://www.khanacademy.org/cs/programming/ Khan Academy] * [http://www.meetup.com/python-178/ Local PyBulls Meetings] Code: * [http://carsonfarmer.com/2013/07/essential-python-geo-libraries Python Libraries Useful for Geospatial Problems] * [[Code#Python_Libraries|Python Libraries Useful for Computational Chemistry]] (very small list at present) Interactive Interpreters: * [http://www.codewars.com CodeWars] Recommended for building experience with practice problems. * [http://codecombat.com/ CodeCombat] A very visual way to interact with your python code. * [http://exercism.io Exercism] A command-line client with a similar learn-through-challenge philosophy. * [http://repl.it repl.it] A read-eval-print loop for several computer languages. * [http://en.cppreference.com/w/cpp/language CppReference] Documentation with an online evaluator for C++ code. === Notes === * [[Media:Intro.pdf|Introduction Notes]] * [[Media:Week2.pdf|Function Syntax]] and [[Media:Week3.pdf|For-Loop Syntax]] cheat-sheets. * [[Media:PlottingMaps.pdf|Plotting Maps]] * [https://m3challenge.siam.org/sites/default/files/uploads/siam-guidebook-final-press.pdf SIAM Notes on Mathematical Modeling] * [[Code:libxdrfile|libxdrfile]] * The simple, yet amazing harmonic oscillator ** [http://hyperphysics.phy-astr.gsu.edu/hbase/shm.html Classical Oscillator] ** [http://hyperphysics.phy-astr.gsu.edu/hbase/quantum/hosc.html Quantum Oscillator] ** [http://hyperphysics.phy-astr.gsu.edu/hbase/quantum/hosc6.html#c2 Probabilities] * [[Code:MDIntro]] <!-- ** [[Turing Exercise]] ** [https://predictivestatmech.org/code/example.dcd Example DCD File] * [[Media:Week-5.2017.pdf|Week 5 Notes]] ** [[Code:PyTesting]] * [[Media:NumpyArrays.pdf|Week 7 Notes]] ** [http://www.labri.fr/perso/nrougier/from-python-to-numpy/ all about numpy] * Misc. Notes for Week 8 ** [[Physics:Pairs|Rundown of Pair Interactions]] ** Parameterized surfaces [[Media:param1.jpg|1]] and [[Media:param2.jpg|2]] * Notes for Compilation Lab ** [https://learnpythonthehardway.org/book/appendixa.html Command Line Crash Course] Cheat sheet for bash commands. ** USF's compute cluster documentation at [https://wiki.rc.usf.edu/index.php/Main_Page RC Wiki]. *** See especially the "Connecting to SC" and "Modules" sections ** [[Code:Compiling|Cheat-codes]] for compilation lab. * [[Media:jobs.pdf|Research Computing Batch Queue]] * [[Media:Plug-in.pdf|Plugging Into Libraries]] * [[Media:Matrix.pdf|Matrix Algorithms]] --> === Review Notes on Sequences, list comprehensions and arrays === <source lang="python"> # Say you want to make a plot of the LJ function on the domain x \in [0.9, 3] # 1. You could use the following two list comprehensions to be specific: x = [ i*(3-0.9)/100.0 + 0.9 for i in range(101) ] y = [ 4*(xi**-12 - xi**-6) for xi in x] # 2. You could implement the LJ function as a python function and use MAP, def LJ(x): ix6 = x**-6 # the factoring makes this calculation more efficient return 4*ix6*(ix6 + 1.0) y = map(LJ, x) # 3. You could work on arrays, where addition, multiplication, and powers are elementwise: ax = arange(101)*(3-0.9)/100 + 0.9 ay = LJ(ax) # Mind the difference in type! type(x) type(ax) # 4. You could totally cheat, and use numpy's builtin functions. ax = linspace(0.9, 3.0, 101) # Exercise: replicate the steps above to test the finite difference computation # of the derivative against the analytical derivative of LJ. [ (y[i+1]-y[i])/(x[i+1]-x[i]) for i in ... import matplotlib.pyplot as plt plt.plot(x, y) plt.show() </source> === Review Notes on Functions with Function arguments (functionals) === <source lang="python"> # map : (a -> b), [ a ] -> [ b ] # map: map(str, [1,2,3]) --> [ "1", "2", "3" ] # ^ function (a -> b) # map(int, map(str, [1,2,3]) ) # - helpful for parsing # x = "1 2 3 4 5" # x.split() # ["1", "2", "3", "4", "5"] # map(int, x.split()) # [1,2,3,4,5] str([1,2,3]) # "[1, 2, 3]" (bad) map(str, [1,2,3]) # ["1", "2", "3"] (good) # filter: (a -> Bool), [a] -> [a] # Example filter: # '1' -> no # ' ' -> no # 'a-z' -> yes # 'A-Z' -> yes def f(x): # str -> Bool if x >= 'a' and x <= 'z': return True if x >= 'A' and x <= 'Z': return True return False filter(f, " 1 a b 2 \n") # reduce: (a,b -> a), [b], a -> a sum([1,2,3]) # -> 6 def add2(x,y): # x : int, y : int return x+y reduce(add2, [1,2,3], 0) # For an example where a != b: def append(x,y): # x : [int], y : int return x + [y] reduce(append, [1,2,3], []) # start with an empty list # Newton-Rhapson def nrhap(f, fp, x0, tol = 1e-6): y = f(x0) iter = 0 # guard against infinity while abs(y) > tol: iter += 1 if iter > 1000: raise ValueError, "Unable to converge!" x0 -= y/fp(x0) y = f(x0) return x0 # solve x^3 - 2 = 0 def f(x): return x**3 - 2 def fp(x): return 3*x**2 print( nrhap(f, fp, 1.0)**3 ) </source> === In-Class Problems === * Week 1: [[Media:CalculatorProbs.pdf|Calculator Problems]] ** Solutions: [http://predictivestatmech.org/terms/term.html] ** This solution uses python list comprehensions, and shows that the slowest step is actually unit conversion! * Week 2: [[Media:Pseudocode.pdf|Pseudocode Problems]] ** We will work these in class. For practice, be sure you have python list ideas down! ** Solutions: [https://docs.google.com/document/d/1HRkSdVNsTUydY4cVx67jRHRyhi5gL6nneEj9IX89wlE/edit?usp=sharing] * Week 3: [[Media:Plotting1.pdf|Plotting 1]] ** [https://stackoverflow.com/questions/11815538/how-to-import-matplotlib-in-python#11830055 Notes on installing Matplotlib on your own computer] ** Challenge: actions vs. functions -- what does the following code do: "[ print(1) for i in range(10) ]" (python3 only) * Week 4: [[Media:Plotting2.pdf|Plotting 2]] ** Solutions: [https://docs.google.com/document/d/1AanEFQmxLxoNM-662MHxsxToY3wsqovNx6SwcPQuBIg/edit?usp=sharing] * Week 5: Read pseudocode and plotting, focusing on types and syntax. Also, re-read the end of chapter summaries for Ch. 3, 5 and 6. * Week 6: Read the following pieces on first order logic [http://bayes.wustl.edu/etj/prob/book.pdf Chapter 1 of Jaynes' Book] [http://web.cecs.pdx.edu/~cs410aph/Lectures/Smalltalk%20II/Dijkstra%20on%20Hamming%27s%20Problem.pdf Hamming's Problem], and pages 71-80 in Chapter 4 of Hetland's Algorithms book (on induction). Just skip directly to chapter 4. ** Solutions [https://docs.google.com/document/d/14QZxh2SAWl3JE-SzVyemkAv4p9TBChO-jzZ5YpT8BZs/edit?usp=sharing] * Week 7: Review Hetland, Chapters 3-7. We'll do a series of parsing problems and flex our collective induction and recursion muscles. ** [https://docs.google.com/document/d/1i04oL7zJsD3KzvsPIaHBgwaOZ78UZvz5ReRDF-PlyF0/edit?usp=sharing Week 7 Problems] * Week 8: [[Media:Minimization1.pdf|Minimization Problems!]] * Week 10: [[Media:Minimization2.pdf|Molecular Optimization]] * Week 11: [[Media:Dynamics.pdf|Dynamical Problems]] * Week 12: [[Media:InvPend.pdf|Inverse Pendulum]] ** [[Simulating Rule 110]] * Week 13: No reading, simulate dynamics in the final project, scale up Rule 110 simulation and calculate histograms of local densities. * Week 15: [[Media:Stats.pdf|Elementary Statistics]] === Homework === * Homework will be assigned through Repl.IT ** Homework 6 is described below * Project presentations will be on Mon.-Wed., Mar 5-7 * Final Projects are due by the end of the last week of classes. '''HW6''' (hand in on Wednesday, April 18) <blockquote> After reading through the SIAM guide on mathematical modeling, formulate an interesting question about the chemical behavior of mixed solvent systems. Don't be too constrained by what can and can't be simulated with MD, but do create a well-designed problem statement, list some possible assumptions that could help narrow down the problem scope, and clearly explain any quantitative variables that can be defined. It will help to reference chemical literature, including textbooks from your past courses. </blockquote> '''Homework 7''' (hand in on Monday, April 23) <pre> Create pseudocode and identify relevant python/numpy/scipy data structures and functions for carrying out each of the following MD data analysis tasks. Be explicit about data types you choose for each variable, as well as the inputs and outputs of each function you define. Your pseudocode should be returned neatly handwritten or typed in outline form and should present a complete, workable solution. 1. How do I determine the best solvent for reaction chemistry? Chemical reactions at an industrial scale are always carried out under optimized conditions. Solvent composition (i.e. the mole fraction of each solvent molecule) are one factor that can be tuned in order to control reaction rate, yield, selectivity, and ease of purification. One factor that can be modeled is the difference in solubility between reactant and product molecules. The solubility product constant for a single molecule, K, is defined as the maximum concentration the molecule can be present in solution before further additions of the molecule `crash out' and form a solid rather than dissolving. Let's test the linear solvation free energy model, K(M) = K0 exp( sum_j n_j(M) u_j ), where K0 and k_j are constants for all molecules (M), the sum runs over the 'j' functional groups present in molecule M, with n_j(M) the number of functional groups of type 'j' in that molecule. Write pseudocode for a "guess and check" method that tries out possible parameters, K0 and u_j, to decide how well those parameters perform. Assume you have a table of K(M) and n_j(M) values available, and can call the function "generate_params" to generate a new parameter guess. 2. How fast is a 'diffusion-limited' reaction? Reaction rates depend on how many times the individual molecules involved in each step of the reaction collide. For a bimolecular reaction like an enzyme-substrate binding event, E + S -> (ES), the reaction rate can be limited by diffusion when binding is very strong (so that every collision leads to "irreversible" binding). MD can't simulate chemical reactions, so the analysis will be limited to determining whether the enzyme-substrate becomes small, indicating binding. Assume you have been given a trajectory of an enzyme in solution with 100 substrate molecules. Define a (distance-based) criteria for determining if a complex has formed when given the positions of 12 atoms on a key residue of the enzyme and all 10 atoms of the substrate. This criteria should be stated in terms of a function, with well-typed inputs and outputs. Then write pseudocode that uses the entire trajectory (and the function) to determine: i) the exact time-point (frame) at which an enzyme-substrate complex forms, and ii) whether that complex ever unbinds during the remainder of the simulation trajectory. For this exercise, you will need to use steps that define and use labels for substrates and/or atoms like "loop through substrates," "label that substrate as 'k'", and "check substrate 'k'", etc. Like adding main characters to a story, it's important to know when to give certain pieces of data individual names and types. </pre> '''Homework 8''' - Due Friday, April 27. (hand in on Wednesday or email by Friday COB). <pre> Revise your midterm project code using what you've learned in this class to make it more structured and maintainable. In some cases, this may simply require adding documentation and in other cases, this may be simplest to accomplish with a complete re-write. The completed code must contain: 1) at least two functions, documented with input and output types and explanations, as well as example input -> output pairs, 2) at least one loop, and 3) at least one new data structure, with a documented type and an example instance that matches the given type. One way to satisfy the last requirement is opting to change the shape of an existing array in the code or to regroup data into an array, list, or dictionary. </pre> 3fe9eacf6fb7feafe5df195c9ae25170a91b4029 Simulating Rule 110 0 154 662 2018-04-04T17:51:03Z David M. Rogers 2 Created page with "<source lang="python"> from numpy import * import pylab as plt def update(a,b,c): if b == 0 and c == 0: return 0 if a == 1 and b == 1 and c == 1: retu..." wikitext text/x-wiki <source lang="python"> from numpy import * import pylab as plt def update(a,b,c): if b == 0 and c == 0: return 0 if a == 1 and b == 1 and c == 1: return 0 return 1 def update_row(A, r): for i in range(8): A[r+1,i] = update(A[r,i-1], A[r,i], A[r,(i+1)%8]) """ 1. create an empty "output" 2. start with an initial condition 3. for step in times: i. append state to the output ii. update the state """ A = zeros((17,8)) A[0,7] = 1 for step in range(16): update_row(A, step) plt.imshow(1-A, cmap='bone', interpolation='nearest', aspect='auto') plt.show() print( sum(A == 0) / (17.0*8.0) ) </source> 881a26f2af5bb72e8bef0417fa568f5ca0997077 663 662 2018-04-04T17:52:29Z David M. Rogers 2 wikitext text/x-wiki <source lang="python"> from numpy import * import pylab as plt def update(a,b,c): if b == 0 and c == 0: return 0 if a == 1 and b == 1 and c == 1: return 0 return 1 def update_row(A, r): for i in range(8): A[r+1,i] = update(A[r,i-1], A[r,i], A[r,(i+1)%8]) """ 1. create an empty "output" 2. start with an initial condition 3. for step in times: i. append state to the output ii. update the state """ A = zeros((17,8)) A[0,7] = 1 for step in range(16): update_row(A, step) plt.imshow(1-A, cmap='bone', interpolation='nearest', aspect='auto') plt.show() print( sum(A == 0) / (17.0*8.0) ) </source> To show you understand this code, try replacing the dimensions 17,8 by larger numbers and remove all "hard-coded" 17s and 8s to replace them with A.shape, etc. Also, try implementing a different rule or plot using lines instead of imshow. 71d54822199cac8da70efe4da040bd8e6a01d897 Code:MDIntro 0 155 668 2018-04-18T16:36:57Z David M. Rogers 2 Created page with "# [http://pubs.acs.org/doi/pdf/10.1021/j100091a024 Water dimer structure] # [https://spdbv.vital-it.ch/ Swiss PDB Viewer] #* Download, extract to the default location (''C:\Us..." wikitext text/x-wiki # [http://pubs.acs.org/doi/pdf/10.1021/j100091a024 Water dimer structure] # [https://spdbv.vital-it.ch/ Swiss PDB Viewer] #* Download, extract to the default location (''C:\Users\<uname>\Downloads\SPDBV_4.10_PC''), and run spdvb.exe. # Since sftp doesn't work from the lab computers, download files from [http://predictivestatmech.org/code/] # Optional: compile and install [[Code:libxdrfile|libxdrfile]] # Compute radial distribution functions using ''gmx rdf'' #* gmx rdf -n ../index.ndx -f ../run.trr -o run.rdf.xvg #* see [https://www.lehigh.edu/imi/teched/AtModel/Lecture_5_Micoulaut_Atomistics_Glass_Course.pdf] # Compute P(r, theta) #* see [https://docs.scipy.org/doc/numpy/reference/generated/numpy.histogram2d.html] <source lang="python"> from xdrfile import xdrfile from numpy import * trr = xdrfile("../run.trr") # create an empty histogram H = zeros((500,500)) bins = # loop through frames for frame in trr: print ( frame.x.shape) break # add this frame's histogram ## compute distances ## compute angles # display/save histogram H.save( </source> f30e0e131e80c1a514d525e3543804cc53fd8bc7 669 668 2018-04-18T16:37:32Z David M. Rogers 2 wikitext text/x-wiki # [http://pubs.acs.org/doi/pdf/10.1021/j100091a024 Water dimer structure] # [https://spdbv.vital-it.ch/ Swiss PDB Viewer] #* Download, extract to the default location (''C:\Users\<uname>\Downloads\SPDBV_4.10_PC''), and run spdvb.exe. # Since sftp doesn't work from the lab computers, download files from [http://predictivestatmech.org/code/] # Optional: compile and install [[Code:libxdrfile|libxdrfile]] # Compute radial distribution functions using ''gmx rdf'' #* gmx rdf -n ../index.ndx -f ../run.trr -o run.rdf.xvg #* see [https://www.lehigh.edu/imi/teched/AtModel/Lecture_5_Micoulaut_Atomistics_Glass_Course.pdf] # Compute P(r, theta) #* see [https://docs.scipy.org/doc/numpy/reference/generated/numpy.histogram2d.html] <source lang="python"> from xdrfile import xdrfile from numpy import * trr = xdrfile("../run.trr") # create an empty histogram H = zeros((500,500)) bins = # loop through frames for frame in trr: print ( frame.x.shape) break # add this frame's histogram ## compute distances ## compute angles # display/save histogram save("H.npy", H) </source> 6f7aabe682355c537d5bfb42b4b7226c1f89e293 File:Stats.pdf 6 156 674 2018-04-22T18:32:03Z David M. Rogers 2 wikitext text/x-wiki da39a3ee5e6b4b0d3255bfef95601890afd80709 Publications 0 8 675 652 2018-05-07T14:04:49Z David M. Rogers 2 wikitext text/x-wiki {| cellpadding="4" style="border: 1px solid darkgray;" |- style="border: 1px solid darkgray;" || David M. Rogers, "Extension of Kirkwood-Buff theory to the canonical ensemble." [https://aip.scitation.org/doi/full/10.1063/1.5011696 J. Chem. Phys., 148:054102, 2018]. We present a way to utilize Essmann et. al.'s smooth particle mesh Ewald algorithm ([https://github.com/frobnitzem/EwaldCorrel implemented here]) to get the low-angle direct correlation function from canonical ensemble simulation data. The result avoids well-documented issues with long wavelength (small-angle scattering) modes that appear when using real-space methods. This result is combined with new estimates of finite-size effects and grand-canonical ensemble corrections to provide definitive results on the problem of extrapolating Kirkwood-Buff integrals. |- style="border: 1px solid darkgray;" || Juan M. Vanegas, Frank Heinrich, David M.Rogers, Bryan D. Carson, Sadie La Bauve, Briana C. Vernon, Bulent Akgun, Sushil Satija, Aihua Zheng, Margaret Kielian, Susan B. Rempe, and Michael S. Kent, "Insertion of Dengue E into lipid bilayers studied by neutron reflectivity and molecular dynamics simulations." [https://authors.elsevier.com/c/1WcOv1ClS9Jvp BBA 1860(5):1216-1230, 2018]. We compare neutron reflectivity experiments to molecular dynamics calculations on the orientation and binding position of the Dengue envelope protein responsible for viral escape from the host cell's endosome. In addition to the hydrophobic fusion tip, we find important roles for three positively-charged residues in the viral protein that contribute to host membrane binding. These could potentially be targeted by new anti-viral medicines. |- style="border: 1px solid darkgray;" || David M. Rogers, "An information theory model for dissipation in open quantum systems." [http://iopscience.iop.org/article/10.1088/1742-6596/880/1/012039 J. Phys., Conference Series 880(1):012039, 2017]. This paper presents a new, simple ansatz for adding dissipation to arbitrary stochastic forcing of a quantum dynamical system. For Gaussian random forces, it predicts a Lindblad equation identical to the Caldeira-Leggett model up to order <math>\beta^2</math>, where the same term is present with a different prefactor. The system-centric, phase space picture here shows that the <math>\beta^2</math> term represents a quantum confinement effect. |- style="border: 1px solid darkgray;" || David M. Rogers, "Einstein-Podolsky-Rosen paradox implies a minimum achievable temperature." [http://journals.aps.org/pre/abstract/10.1103/PhysRevE.95.012149 Phys. Rev. E 95, 012149, 2017.] This paper provides measurement-based definitions of heat and work that can be realized in current laboratory setups. The first and second laws are proved despite the fact that temperature is treated completely as as a property of the interacting reservoir. Measurements of the work are subject to the famous EPR paradox because the work exchanged between two quantum systems is not defined until a measurement is performed. Based on this, we show that even an environment at absolute zero cannot lower a system's temperature below a minimum characteristic of the way the environment is coupled to the system. |- style="border: 1px solid darkgray;" || Guy W. Dayhoff II and David M. Rogers, "Driving forces in MD simulations of transition and ‘Free’ flows." [http://dx.doi.org/10.1080/08927022.2016.1273524 Mol. Sim. 43(5-6), pp. 467-477, 2017.] (special issue on Surface Chemistry) We set out to test the Joule-Thomson analysis of thermodynamics of porous flow for gasses through a nanopore and found that while local equilibrium is established in the steady-state, finite-size effects cause heat flow opposite the flow direction that violates the assumption of an adiabatic porous plug. |- style="border: 1px solid darkgray;" || David M. Rogers, "Efficient Primitives for Standard Tensor Linear Algebra." [https://doi.org/10.1145/2949550.2949580 Proc. XSEDE16 Conference on Diversity, Big Data, and Science at Scale, no. 14, 2016.] This paper introduces 3 basic functions that generalize BLAS to tensors and presents a code generation strategy for their efficient execution on GPUs that achieves peak performance on the same order of magnitude as for traditional, vendor-optimized matrix-multiplications. |- style="border: 1px solid darkgray;" || David M. Rogers, "Overcoming the Minimum Image Constraint Using the Closest Point Search." [http://dx.doi.org/10.1016/j.jmgm.2016.07.004 J. Mol. Graph. Model 68, pp. 197–205, 2016.] An elegant solution to the problem of finding periodic images in non-rectangular lattices is provided based on the closest vector problem. Related code is here: [https://github.com/frobnitzem/pbctools] |- style="border: 1px solid darkgray;" || Elisa La Bauve, Briana C. Vernon, Dongmei Ye, David M. Rogers, Cathryn M. Siegrist, Bryan Carson. Susan L. Rempe, Aihua Zheng, Margaret C. Kielian, Andrew P. Shreve, and Michael S. Kent. "Method for measuring the unbinding energy of strongly-bound membrane-associated proteins." [http://dx.doi.org/10.1016/j.bbamem.2016.07.004 BBA Biomembranes 1858(11): 2753–62, 2016.] This paper gives multiple experimental measurements of binding energy between the Dengue virus envelope protein and host membranes that largely confirm our computational predictions from 2015. I contributed all the theory for terminal velocity during sedimentation, along with a novel kinetic analysis providing the free energy and enthalpy of the dissociation barrier (all the details are at the end of the appendix). |- style="border: 1px solid darkgray;" || David M. Rogers. "Thermodynamics of Maximum Transition Entropy for Quantum Assemblies." [http://arxiv.org/abs/1503.01232 arXiv:1503.01232 submitted, 2016]. The work presents a new, general, theoretical foundation for the dynamics of open quantum systems modeled on the maximum entropy derivation of equilibrium statistical mechanics. Computational results are presented for three detailed systems to validate and reinforce the theory. It represents a significant advancement for the field, as it lucidly connects the dynamics of a single wavefunction plus environmental noise to the Caldeira-Leggett model for density matrices. |- style="border: 1px solid darkgray;" || Andriy Anishkin, Juan M. Vanegas, David M. Rogers, Philip L. Lorenzi, Wai Kin Chan, Preeti Purwaha, John N. Weinstein, Sergei Sukharev, and Susan B. Rempe. "Catalytic Role of the Substrate Defines Specificity of Therapeutic L-Asparaginase." [http://dx.doi.org/10.1016/j.jmb.2015.06.017 J. Mol. Biol. 427:2867-2885, 2015]. We present an explanation for the (until now controversial) catalytic mechanism of type 2 bacterial L-asparaginase enzymes. By using the carboxylic acid of the substrate (asparagine) as the proton acceptor, this enzyme is able to preferentially carry out deamidation on asparagine more quickly than for the competing substrate, glutamine. The hypothesis, re-discovered from our MD simulations, was first put forward years ago in contested experimental studies, and now finds additional support from our MD and QM calculations. |- style="border: 1px solid darkgray;" || David M. Rogers. "Towards a Direct, By-Need Evaluator for Dependently Typed Languages." [http://arxiv.org/abs/1509.07036 arXiv:1509.07036 submitted, 2015]. This paper describes the implementation of a new interpreted language for distributed parallel computing. It achieves its goal by maintaining pure functional semantics, allowing all terms in the language to be partially evaluated and serialized to network storage at any point during computation. |- style="border: 1px solid darkgray;" || Marielle Soniat, David M. Rogers, and Susan Rempe. "Dispersion- and Exchange-Corrected Density Functional Theory for Sodium Ion Hydration." [http://pubs.acs.org/doi/abs/10.1021/acs.jctc.5b00357 J. Chem. Theory. Comput. 142:074101, 2015]. We studied the influence of dispersion energy corrections on the free energy of formation for sodium-water clusters computed with DFT and wound up discovering that dispersion and split-range exchange functionals can somewhat counter-balance each other. The charged sodium ion pulls on the water's electrons, clearly showing which density functionals over-polarize compared to CCSD. Split-range exchange can reduce this over-polarization, but results in reduced electrostatic interaction. Dispersion can lower the binding energy again to counter-balance. So, functionals fit to experimental formation energies need both effects to avoid lowering energies by over-polarizing. |- style="border: 1px solid darkgray;" || David M. Rogers. "Real-space quadrature: a convenient, efficient representation for multipole expansions." [http://dx.doi.org/10.1063/1.4907404 J. Chem. Phys. 142:074101, 2015]. ([http://predictivestatmech.org/papers/real-poles.pdf Presentation]) I introduce sets of point charges that are able to simultaneously reproduce all multipole (spherical harmonic) expansions up to arbitrary order. The number of points is space-optimal. Translations are described from the usual harmonics and from Cartesian moments (dipole, quadrupole, etc.) on supersymmetric tensors to directional moments using the point weight distribution. Many applications are possible, including trivial implementation of multipoles in molecular mechanics and representing probability distributions over rotation space. |- style="border: 1px solid darkgray;" || David M. Rogers, Michael S. Kent, and Susan B. Rempe, "Molecular basis of endosomal-membrane association for the dengue virus envelope protein." [http://dx.doi.org/10.1016/j.bbamem.2014.12.018 BBA Biomembranes 1848(4):1041-52, 2015.] A fully atomistic potential of mean force for association of the viral envelope protein from Dengue virus was compared to a Poisson-Boltzmann electrostatic plus dispersion model. The results are consistent, showing hope for this type of combined scale simulation. |- style="border: 1px solid darkgray;" || Yaqin Fu, Binsong Li, Ying-Bing Jiang, Darren R. Dunphy, Andy Tsai, Siu-Yue Tam, Hongyou Fan, Hongxia Zhan, David Rogers, Susan Rempe, Plamen Atanassov, Joseph L. Cecchi, and C. Jeffrey Brinker "Atomic Layer Deposition of L-Alanine Polypeptide." [http://pubs.acs.org/doi/abs/10.1021/ja5043403 JACS 136(45):15821–4, 2014.] This paper with our experimental collaborators carried out blocked peptide synthesis by vapor-depositing Boc-L-alanine to create a uniform thin film of polypeptides grown on a silica substrate activated by aminopropyltrimethoxysilane. |- style="border: 1px solid darkgray;" || David M. Rogers. "Silmaril, A Functional Language for Distributed Parallel Evaluation." [http://predictivestatmech.org/sil/papers/sil.pdf Submitted version] |- style="border: 1px solid darkgray;" || Mathias B. Andersen, David M. Rogers, Junyu Mai, Benjamin Schudel, Anson V. Hatch, Susan B. Rempe and Ali Mani. "Spatiotemporal pH dynamics in concentration polarization near ion-selective membranes." [http://dx.doi.org/10.1021/la5014297 Langmuir, 30(26):7902–7912, 2014] |- style="border: 1px solid darkgray;" || W. K. Chan, P. L. Lorenzi, A. Anishkin, P. Purwaha, D. M. Rogers, S. Sukharev, S.B. Rempe, and J. N. Weinstein. "The glutaminase activity of l-asparaginase is not required for anticancer activity against ASNS-negative cells." [http://dx.doi.org/10.1182/blood-2013-10-535112 Blood. 123(23):3596-606, 2014]. |- style="border: 1px solid darkgray;" || David M. Rogers, Dian Jiao, Lawrence Pratt, and Susan B. Rempe. "Structural Models and Molecular Thermodynamics of Hydration of Ions and Small Molecules" [http://dx.doi.org/10.1016/B978-0-444-59440-2.00004-1 Annu. Rep. Comp. Chem. 8:71–127, 2012.] |- style="border: 1px solid darkgray;" || David M. Rogers and Susan B. Rempe. "Irreversible Thermodynamics." [http://dx.doi.org/10.1088/1742-6596/402/1/012014 J. Phys.: Conf. Ser. 402:012014, 2012]. |- style="border: 1px solid darkgray;" || David M. Rogers, Thomas L. Beck, and Susan B. Rempe. [[Media:Dmroge_InfoNonequ2011.pdf|"An Information Theory Approach to Nonlinear, Nonequilibrium Thermodynamics."]] [http://dx.doi.org/10.1007/s10955-011-0358-9 J. Stat. Phys. 145(2):385-409, 2011] We show how the interpretation of thermodynamic states as representing system information leads naturally to thermodynamic cycles and the first and second laws of thermodynamics as well as similar formulations for nontrivial nonequilibrium problems. The logical development of the theory also leads naturally to correct indistinguishability factors in the partition function. |- style="border: 1px solid darkgray;" || Sameer Varma, David M. Rogers, Lawrence R. Pratt, and Susan B. Rempe. "Perspectives on Ion Selectivity: Design Principles for K+ Selectivity in Membrane Transport." [http://jgp.rupress.org/content/137/6/479.full J. Gen. Physiol., 137(6):479-488, 2011.] We review the development of models for understanding the physical basis of selectivity for K+ ions over Na+, its sibling only one row behind, in membrane channels and transporters. Although the problem is subtle because of the morass of competing effects, we emphasize work analyzing the systematic influence of the environment on tipping local binding site structure toward selective configurations. |- style="border: 1px solid darkgray;" || David M. Rogers and Susan B. Rempe. [http://www.ncbi.nlm.nih.gov/pmc/articles/PMC3443978/ “Probing the Thermodynamics of Competitive Ion Binding Using Minimum Energy Structures.”] [http://dx.doi.org/10.1021/jp2012864 J. Phys. Chem. B, 115(29):9116-29, 2011]. We presented an extension of the Quasi-Chemical theory for quantifying the impact of local structure on ion complexation thermodynamics. The theory can be simply represented using a set of thermodynamic cycles involving binding site structural and compositional states as reaction intermediates. |- style="border: 1px solid darkgray;" || Susan B. Rempe and David M. Rogers; et. al. “Computational and experimental platform for understanding and optimizing water flux and salt rejection in nanoporous membranes.” [http://prod.sandia.gov/techlib/access-control.cgi/2010/106735.pdf Sandia Technical Report, SAND2010-6735, 2010.] We summarize work on designing polymer coatings for salt exclusion in water transporting nanopores. In this work, I collected available molecular dynamics results for these systems and performed a novel energy efficiency analysis able to relate atomistic and experimental scales as well as identify important design goals and chemical principles for material performance. |- style="border: 1px solid darkgray;" || David M. Rogers, [http://rave.ohiolink.edu/etdc/view?acc_num=ucin1251832030 ''''Using Bayes' Theorem for Free Energy Calculations''''], 2009. We investigated the central quantity of free energies in a Bayesian context and provide estimators for solvation free energies as well as optimal potential of mean force approximations to model polymer coarse-grained dynamics from atomistic simulations. |- style="border: 1px solid darkgray;" || Zhen Zhao, David M. Rogers and Thomas L. Beck. "Polarization and Charge Transfer in the Hydration of Chloride Ions." [http://link.aip.org/link/?JCP/132/014502/1 J. Chem. Phys., 132:014502, 2010.] Dr. Zhao's ab-initio analysis of the charge distribution in water-ion clusters highlighted the importance of many-body water-water interactions and charge transfer effects in determining cluster structural and energetic properties. These are still challenging to represent in modern polarizable forcefields and have implications for anion properties at interfaces. |- style="border: 1px solid darkgray;" || David M. Rogers and Thomas L. Beck. "Quasi-Chemical and Structural Analysis of Polarizable Anion Hydration." [http://link.aip.org/link/?JCP/132/014505/1 J. Chem. Phys., 132:014505, 2010.] The role of polarizability in forcefield-based models of ions and water was examined. Utilizing some of our recent developments on quasi-chemical theory, we have been able to quantify the tightened, asymmetric nature of the ion's local solvation waters induced by increased polarizability as well as the exact effects of polarization on the solvation free energy. The results suggest some potential problems and diagnostics for such models. |- style="border: 1px solid darkgray;" || David M. Rogers and Thomas L. Beck. [http://forcesolve.sourceforge.net/ Force Solve] (Sourceforge, Chicago IL, 2008). This force matching software implements and tests coarse-graining for general molecular systems in a mere 4000 lines of code. It is able to parametrize coarse Hamiltonians from atomic trajectory data given arbitrary definitions of coarse united-atom type models as well as carry out short Langevin Dynamics simulations on the coarse scale. The program's main drawbacks are its slow speed and high memory usage due to its simplistic design, attributable to the interpreted nature of python. |- style="border: 1px solid darkgray;" || David M. Rogers and Thomas L. Beck. "Resolution and Scale Independent Nonparametric Function Matching Using a String Energy Penalized Spline Prior." 2008. [http://arxiv.org/abs/1003.4741 arXiv:1003.4741v1] (stat.ML). Fresh insight is provided into long-standing mathematical issues surrounding computational modeling of continuous functions from a few sampled data points. The present research lays the groundwork for predicting the behavior of complicated many-body systems using advanced regression techniques. |- style="border: 1px solid darkgray;" || David M. Rogers and Thomas L. Beck. "Modeling molecular and ionic absolute solvation free energies with quasichemical theory bounds." [https://doi.org/10.1063/1.2985613 J. Chem. Phys., 129:134505, 2008.] We develop a Bayesian method for computing (with error bars) the free energy for forming a nano-bubble in an arbitrary solvent system. This forms the first step of a thermodynamic cycle for dissolving a real solute. We prove that upper and lower bounds for that solvation free energy can be obtained from two simulations (with and without the solute present). The method is excellent for dissolving gas in water, while the upper/lower bounds are larger for dissolving water or ions. |} == Manuscripts in Preparation/Submitted == * [https://arxiv.org/abs/1712.09427 Fluctuation Theory of Ionic Solvation Potentials] * [https://arxiv.org/abs/1503.01232 Thermodynamics of Maximum Transition Entropy for Quantum Assemblies] * [https://arxiv.org/abs/1701.01466 Maximum Entropy Closure for Flows in Transiently Driven Nonequilibrium Systems] cbfb79b10f01f3ad901b6ed63dffea083b96aaf4 702 675 2019-01-04T21:32:36Z David M. Rogers 2 wikitext text/x-wiki {| cellpadding="4" style="border: 1px solid darkgray;" |- style="border: 1px solid darkgray;" || David M. Rogers, "Dual Characterization of the Ornstein-Zernike Equation in Moment Space." [https://arxiv.org/abs/1807.05963 submitted, 2019]. I re-write Ornstein-Zernike theory in a convenient matrix basis so that future computational implementations can be made robust and that numerical and fitting error can be tightly controlled. It is hoped that the framework can be used in the near future to compute molecular solvation free energies and to realize its enormous potential economic and environmental benefits for formulating industrial fluids and consumer products. |- style="border: 1px solid darkgray;" || Phillip S. Hudson, Stefan Boresch, David M. Rogers, and H. Lee Woodcock., "Accelerating QM/MM Free Energy Computations via Intramolecular Force Matching" [https://dx.doi.org/10.1021/acs.jctc.8b00517 J. Chem. Theory Comput., 14 (12):6327–35, 2018]. My co-authors apply [https://github.com/frobnitzem/chemparam my algorithm and software implementation of Bayesian generalized linear model regression with linear inequality constraints] to estimate molecular modeling parameters from quantum their mechanical calculations. They find the method gives robust results that greatly increase efficiency of additional simulations. |- style="border: 1px solid darkgray;" || David M. Rogers, "Extension of Kirkwood-Buff theory to the canonical ensemble." [https://aip.scitation.org/doi/full/10.1063/1.5011696 J. Chem. Phys., 148:054102, 2018]. We present a way to utilize Essmann et. al.'s smooth particle mesh Ewald algorithm ([https://github.com/frobnitzem/EwaldCorrel implemented here]) to get the low-angle direct correlation function from canonical ensemble simulation data. The result avoids well-documented issues with long wavelength (small-angle scattering) modes that appear when using real-space methods. This result is combined with new estimates of finite-size effects and grand-canonical ensemble corrections to provide definitive results on the problem of extrapolating Kirkwood-Buff integrals. |- style="border: 1px solid darkgray;" || Juan M. Vanegas, Frank Heinrich, David M.Rogers, Bryan D. Carson, Sadie La Bauve, Briana C. Vernon, Bulent Akgun, Sushil Satija, Aihua Zheng, Margaret Kielian, Susan B. Rempe, and Michael S. Kent, "Insertion of Dengue E into lipid bilayers studied by neutron reflectivity and molecular dynamics simulations." [https://authors.elsevier.com/c/1WcOv1ClS9Jvp BBA 1860(5):1216-1230, 2018]. We compare neutron reflectivity experiments to molecular dynamics calculations on the orientation and binding position of the Dengue envelope protein responsible for viral escape from the host cell's endosome. In addition to the hydrophobic fusion tip, we find important roles for three positively-charged residues in the viral protein that contribute to host membrane binding. These could potentially be targeted by new anti-viral medicines. |- style="border: 1px solid darkgray;" || David M. Rogers, "An information theory model for dissipation in open quantum systems." [http://iopscience.iop.org/article/10.1088/1742-6596/880/1/012039 J. Phys., Conference Series 880(1):012039, 2017]. This paper presents a new, simple ansatz for adding dissipation to arbitrary stochastic forcing of a quantum dynamical system. For Gaussian random forces, it predicts a Lindblad equation identical to the Caldeira-Leggett model up to order <math>\beta^2</math>, where the same term is present with a different prefactor. The system-centric, phase space picture here shows that the <math>\beta^2</math> term represents a quantum confinement effect. |- style="border: 1px solid darkgray;" || David M. Rogers, "Einstein-Podolsky-Rosen paradox implies a minimum achievable temperature." [http://journals.aps.org/pre/abstract/10.1103/PhysRevE.95.012149 Phys. Rev. E 95, 012149, 2017.] This paper provides measurement-based definitions of heat and work that can be realized in current laboratory setups. The first and second laws are proved despite the fact that temperature is treated completely as as a property of the interacting reservoir. Measurements of the work are subject to the famous EPR paradox because the work exchanged between two quantum systems is not defined until a measurement is performed. Based on this, we show that even an environment at absolute zero cannot lower a system's temperature below a minimum characteristic of the way the environment is coupled to the system. |- style="border: 1px solid darkgray;" || Guy W. Dayhoff II and David M. Rogers, "Driving forces in MD simulations of transition and ‘Free’ flows." [http://dx.doi.org/10.1080/08927022.2016.1273524 Mol. Sim. 43(5-6), pp. 467-477, 2017.] (special issue on Surface Chemistry) We set out to test the Joule-Thomson analysis of thermodynamics of porous flow for gasses through a nanopore and found that while local equilibrium is established in the steady-state, finite-size effects cause heat flow opposite the flow direction that violates the assumption of an adiabatic porous plug. |- style="border: 1px solid darkgray;" || David M. Rogers, "Efficient Primitives for Standard Tensor Linear Algebra." [https://doi.org/10.1145/2949550.2949580 Proc. XSEDE16 Conference on Diversity, Big Data, and Science at Scale, no. 14, 2016.] This paper introduces 3 basic functions that generalize BLAS to tensors and presents a code generation strategy for their efficient execution on GPUs that achieves peak performance on the same order of magnitude as for traditional, vendor-optimized matrix-multiplications. |- style="border: 1px solid darkgray;" || David M. Rogers, "Overcoming the Minimum Image Constraint Using the Closest Point Search." [http://dx.doi.org/10.1016/j.jmgm.2016.07.004 J. Mol. Graph. Model 68, pp. 197–205, 2016.] An elegant solution to the problem of finding periodic images in non-rectangular lattices is provided based on the closest vector problem. Related code is here: [https://github.com/frobnitzem/pbctools] |- style="border: 1px solid darkgray;" || Elisa La Bauve, Briana C. Vernon, Dongmei Ye, David M. Rogers, Cathryn M. Siegrist, Bryan Carson. Susan L. Rempe, Aihua Zheng, Margaret C. Kielian, Andrew P. Shreve, and Michael S. Kent. "Method for measuring the unbinding energy of strongly-bound membrane-associated proteins." [http://dx.doi.org/10.1016/j.bbamem.2016.07.004 BBA Biomembranes 1858(11): 2753–62, 2016.] This paper gives multiple experimental measurements of binding energy between the Dengue virus envelope protein and host membranes that largely confirm our computational predictions from 2015. I contributed all the theory for terminal velocity during sedimentation, along with a novel kinetic analysis providing the free energy and enthalpy of the dissociation barrier (all the details are at the end of the appendix). |- style="border: 1px solid darkgray;" || David M. Rogers. "Thermodynamics of Maximum Transition Entropy for Quantum Assemblies." [http://arxiv.org/abs/1503.01232 arXiv:1503.01232 submitted, 2016]. The work presents a new, general, theoretical foundation for the dynamics of open quantum systems modeled on the maximum entropy derivation of equilibrium statistical mechanics. Computational results are presented for three detailed systems to validate and reinforce the theory. It represents a significant advancement for the field, as it lucidly connects the dynamics of a single wavefunction plus environmental noise to the Caldeira-Leggett model for density matrices. |- style="border: 1px solid darkgray;" || Andriy Anishkin, Juan M. Vanegas, David M. Rogers, Philip L. Lorenzi, Wai Kin Chan, Preeti Purwaha, John N. Weinstein, Sergei Sukharev, and Susan B. Rempe. "Catalytic Role of the Substrate Defines Specificity of Therapeutic L-Asparaginase." [http://dx.doi.org/10.1016/j.jmb.2015.06.017 J. Mol. Biol. 427:2867-2885, 2015]. We present an explanation for the (until now controversial) catalytic mechanism of type 2 bacterial L-asparaginase enzymes. By using the carboxylic acid of the substrate (asparagine) as the proton acceptor, this enzyme is able to preferentially carry out deamidation on asparagine more quickly than for the competing substrate, glutamine. The hypothesis, re-discovered from our MD simulations, was first put forward years ago in contested experimental studies, and now finds additional support from our MD and QM calculations. |- style="border: 1px solid darkgray;" || David M. Rogers. "Towards a Direct, By-Need Evaluator for Dependently Typed Languages." [http://arxiv.org/abs/1509.07036 arXiv:1509.07036 submitted, 2015]. This paper describes the implementation of a new interpreted language for distributed parallel computing. It achieves its goal by maintaining pure functional semantics, allowing all terms in the language to be partially evaluated and serialized to network storage at any point during computation. |- style="border: 1px solid darkgray;" || Marielle Soniat, David M. Rogers, and Susan Rempe. "Dispersion- and Exchange-Corrected Density Functional Theory for Sodium Ion Hydration." [http://pubs.acs.org/doi/abs/10.1021/acs.jctc.5b00357 J. Chem. Theory. Comput. 142:074101, 2015]. We studied the influence of dispersion energy corrections on the free energy of formation for sodium-water clusters computed with DFT and wound up discovering that dispersion and split-range exchange functionals can somewhat counter-balance each other. The charged sodium ion pulls on the water's electrons, clearly showing which density functionals over-polarize compared to CCSD. Split-range exchange can reduce this over-polarization, but results in reduced electrostatic interaction. Dispersion can lower the binding energy again to counter-balance. So, functionals fit to experimental formation energies need both effects to avoid lowering energies by over-polarizing. |- style="border: 1px solid darkgray;" || David M. Rogers. "Real-space quadrature: a convenient, efficient representation for multipole expansions." [http://dx.doi.org/10.1063/1.4907404 J. Chem. Phys. 142:074101, 2015]. ([http://predictivestatmech.org/papers/real-poles.pdf Presentation]) I introduce sets of point charges that are able to simultaneously reproduce all multipole (spherical harmonic) expansions up to arbitrary order. The number of points is space-optimal. Translations are described from the usual harmonics and from Cartesian moments (dipole, quadrupole, etc.) on supersymmetric tensors to directional moments using the point weight distribution. Many applications are possible, including trivial implementation of multipoles in molecular mechanics and representing probability distributions over rotation space. |- style="border: 1px solid darkgray;" || David M. Rogers, Michael S. Kent, and Susan B. Rempe, "Molecular basis of endosomal-membrane association for the dengue virus envelope protein." [http://dx.doi.org/10.1016/j.bbamem.2014.12.018 BBA Biomembranes 1848(4):1041-52, 2015.] A fully atomistic potential of mean force for association of the viral envelope protein from Dengue virus was compared to a Poisson-Boltzmann electrostatic plus dispersion model. The results are consistent, showing hope for this type of combined scale simulation. |- style="border: 1px solid darkgray;" || Yaqin Fu, Binsong Li, Ying-Bing Jiang, Darren R. Dunphy, Andy Tsai, Siu-Yue Tam, Hongyou Fan, Hongxia Zhan, David Rogers, Susan Rempe, Plamen Atanassov, Joseph L. Cecchi, and C. Jeffrey Brinker "Atomic Layer Deposition of L-Alanine Polypeptide." [http://pubs.acs.org/doi/abs/10.1021/ja5043403 JACS 136(45):15821–4, 2014.] This paper with our experimental collaborators carried out blocked peptide synthesis by vapor-depositing Boc-L-alanine to create a uniform thin film of polypeptides grown on a silica substrate activated by aminopropyltrimethoxysilane. |- style="border: 1px solid darkgray;" || David M. Rogers. "Silmaril, A Functional Language for Distributed Parallel Evaluation." [http://predictivestatmech.org/sil/papers/sil.pdf Submitted version] |- style="border: 1px solid darkgray;" || Mathias B. Andersen, David M. Rogers, Junyu Mai, Benjamin Schudel, Anson V. Hatch, Susan B. Rempe and Ali Mani. "Spatiotemporal pH dynamics in concentration polarization near ion-selective membranes." [http://dx.doi.org/10.1021/la5014297 Langmuir, 30(26):7902–7912, 2014] |- style="border: 1px solid darkgray;" || W. K. Chan, P. L. Lorenzi, A. Anishkin, P. Purwaha, D. M. Rogers, S. Sukharev, S.B. Rempe, and J. N. Weinstein. "The glutaminase activity of l-asparaginase is not required for anticancer activity against ASNS-negative cells." [http://dx.doi.org/10.1182/blood-2013-10-535112 Blood. 123(23):3596-606, 2014]. |- style="border: 1px solid darkgray;" || David M. Rogers, Dian Jiao, Lawrence Pratt, and Susan B. Rempe. "Structural Models and Molecular Thermodynamics of Hydration of Ions and Small Molecules" [http://dx.doi.org/10.1016/B978-0-444-59440-2.00004-1 Annu. Rep. Comp. Chem. 8:71–127, 2012.] |- style="border: 1px solid darkgray;" || David M. Rogers and Susan B. Rempe. "Irreversible Thermodynamics." [http://dx.doi.org/10.1088/1742-6596/402/1/012014 J. Phys.: Conf. Ser. 402:012014, 2012]. |- style="border: 1px solid darkgray;" || David M. Rogers, Thomas L. Beck, and Susan B. Rempe. [[Media:Dmroge_InfoNonequ2011.pdf|"An Information Theory Approach to Nonlinear, Nonequilibrium Thermodynamics."]] [http://dx.doi.org/10.1007/s10955-011-0358-9 J. Stat. Phys. 145(2):385-409, 2011] We show how the interpretation of thermodynamic states as representing system information leads naturally to thermodynamic cycles and the first and second laws of thermodynamics as well as similar formulations for nontrivial nonequilibrium problems. The logical development of the theory also leads naturally to correct indistinguishability factors in the partition function. |- style="border: 1px solid darkgray;" || Sameer Varma, David M. Rogers, Lawrence R. Pratt, and Susan B. Rempe. "Perspectives on Ion Selectivity: Design Principles for K+ Selectivity in Membrane Transport." [http://jgp.rupress.org/content/137/6/479.full J. Gen. Physiol., 137(6):479-488, 2011.] We review the development of models for understanding the physical basis of selectivity for K+ ions over Na+, its sibling only one row behind, in membrane channels and transporters. Although the problem is subtle because of the morass of competing effects, we emphasize work analyzing the systematic influence of the environment on tipping local binding site structure toward selective configurations. |- style="border: 1px solid darkgray;" || David M. Rogers and Susan B. Rempe. [http://www.ncbi.nlm.nih.gov/pmc/articles/PMC3443978/ “Probing the Thermodynamics of Competitive Ion Binding Using Minimum Energy Structures.”] [http://dx.doi.org/10.1021/jp2012864 J. Phys. Chem. B, 115(29):9116-29, 2011]. We presented an extension of the Quasi-Chemical theory for quantifying the impact of local structure on ion complexation thermodynamics. The theory can be simply represented using a set of thermodynamic cycles involving binding site structural and compositional states as reaction intermediates. |- style="border: 1px solid darkgray;" || Susan B. Rempe and David M. Rogers; et. al. “Computational and experimental platform for understanding and optimizing water flux and salt rejection in nanoporous membranes.” [http://prod.sandia.gov/techlib/access-control.cgi/2010/106735.pdf Sandia Technical Report, SAND2010-6735, 2010.] We summarize work on designing polymer coatings for salt exclusion in water transporting nanopores. In this work, I collected available molecular dynamics results for these systems and performed a novel energy efficiency analysis able to relate atomistic and experimental scales as well as identify important design goals and chemical principles for material performance. |- style="border: 1px solid darkgray;" || David M. Rogers, [http://rave.ohiolink.edu/etdc/view?acc_num=ucin1251832030 ''''Using Bayes' Theorem for Free Energy Calculations''''], 2009. We investigated the central quantity of free energies in a Bayesian context and provide estimators for solvation free energies as well as optimal potential of mean force approximations to model polymer coarse-grained dynamics from atomistic simulations. |- style="border: 1px solid darkgray;" || Zhen Zhao, David M. Rogers and Thomas L. Beck. "Polarization and Charge Transfer in the Hydration of Chloride Ions." [http://link.aip.org/link/?JCP/132/014502/1 J. Chem. Phys., 132:014502, 2010.] Dr. Zhao's ab-initio analysis of the charge distribution in water-ion clusters highlighted the importance of many-body water-water interactions and charge transfer effects in determining cluster structural and energetic properties. These are still challenging to represent in modern polarizable forcefields and have implications for anion properties at interfaces. |- style="border: 1px solid darkgray;" || David M. Rogers and Thomas L. Beck. "Quasi-Chemical and Structural Analysis of Polarizable Anion Hydration." [http://link.aip.org/link/?JCP/132/014505/1 J. Chem. Phys., 132:014505, 2010.] The role of polarizability in forcefield-based models of ions and water was examined. Utilizing some of our recent developments on quasi-chemical theory, we have been able to quantify the tightened, asymmetric nature of the ion's local solvation waters induced by increased polarizability as well as the exact effects of polarization on the solvation free energy. The results suggest some potential problems and diagnostics for such models. |- style="border: 1px solid darkgray;" || David M. Rogers and Thomas L. Beck. [http://forcesolve.sourceforge.net/ Force Solve] (Sourceforge, Chicago IL, 2008). This force matching software implements and tests coarse-graining for general molecular systems in a mere 4000 lines of code. It is able to parametrize coarse Hamiltonians from atomic trajectory data given arbitrary definitions of coarse united-atom type models as well as carry out short Langevin Dynamics simulations on the coarse scale. The program's main drawbacks are its slow speed and high memory usage due to its simplistic design, attributable to the interpreted nature of python. |- style="border: 1px solid darkgray;" || David M. Rogers and Thomas L. Beck. "Resolution and Scale Independent Nonparametric Function Matching Using a String Energy Penalized Spline Prior." 2008. [http://arxiv.org/abs/1003.4741 arXiv:1003.4741v1] (stat.ML). Fresh insight is provided into long-standing mathematical issues surrounding computational modeling of continuous functions from a few sampled data points. The present research lays the groundwork for predicting the behavior of complicated many-body systems using advanced regression techniques. |- style="border: 1px solid darkgray;" || David M. Rogers and Thomas L. Beck. "Modeling molecular and ionic absolute solvation free energies with quasichemical theory bounds." [https://doi.org/10.1063/1.2985613 J. Chem. Phys., 129:134505, 2008.] We develop a Bayesian method for computing (with error bars) the free energy for forming a nano-bubble in an arbitrary solvent system. This forms the first step of a thermodynamic cycle for dissolving a real solute. We prove that upper and lower bounds for that solvation free energy can be obtained from two simulations (with and without the solute present). The method is excellent for dissolving gas in water, while the upper/lower bounds are larger for dissolving water or ions. |} == Manuscripts in Preparation/Submitted == * [https://arxiv.org/abs/1712.09427 Fluctuation Theory of Ionic Solvation Potentials] * [https://arxiv.org/abs/1503.01232 Thermodynamics of Maximum Transition Entropy for Quantum Assemblies] * [https://arxiv.org/abs/1701.01466 Maximum Entropy Closure for Flows in Transiently Driven Nonequilibrium Systems] 97f5dda907147ed63545636d30ce9c5e84aed448 Predictive Chemistry:Current events 4 10 676 602 2018-05-08T20:06:48Z David M. Rogers 2 wikitext text/x-wiki * Friday, May 4, 2018: David M. Rogers presents "[[File:jazz.pdf|Jazz, Evolution, and Trillion Dollar Problems]]" at Florida ACS Meeting & Exhibition. * Wednesday, Sept. 27, 2017: Family Science Night! * Thursday, August 31, 2017: David M. Rogers presents "Demystifying Nonequilibrium Statistical Mechanics" at the U. Pittsburgh Chemistry Seminar Series. * May 6, 2017: David M. Rogers presents "Quantum Thermodynamics by Repeated Measurement" at the Florida ACS Meeting & Exposition (FAME2017) and Guy W. Dayhoff II presents "Driving Forces in MD Simulations of Transition and `Free' Flows". * March, 2017: David M. Rogers was honored with [http://dx.doi.org/10.1063/1.4978399 JCP's top reviewer award] for 2016! * Feb. 17, 2017: David M. Rogers presents "Demystifying Nonequilibrium Statistical Mechanics" at the USF Physics Colloquium. * September 14, 2016: David M. Rogers presents "A moment generating function for flows in open quantum systems" at the [http://www.df.unipi.it/~elze/DICE2016.html International Conference for Spacetime, Matter, and Quantum Mechanics]. * July 12-16, 2016: David M. Rogers presents "A Molecular Approach to Dispersion Energy" at the TSRC Workshop on Ions in Solution: Biology, Energy, and Environment. * July 7-8, 2016: David M. Rogers presents "The quantum mechanics of Jaynes" at the LANL Quantum Lunch. * March 13-17, 2016: David M. Rogers presents "The Quantum Andersen Thermostat," at the 2016 ACS Spring Meeting. * Friday, Feb. 12, 2016: David M. Rogers presents "Angle-free methods for boundary element problems on the sphere: The quadrature basis for spherical harmonics," at the USF Mathematics Department Analysis Lecture Series. * Monday, Jan 11, 2016: USF Spring 2016 semester classes begin. * Tuesday, December 15, 2015: David M. Rogers presents "Maximum Transition Entropy - A Causal, Canonical Model for Nonequilibrium Statistical Mechanics," at the 114th Statistical Mechanics Conference at Rutgers, New Brunswick New Jersey. * Monday, September 14, 2015, Invited Presentation, "Understanding the origins of irreversibility: electrical driving and the second law.," Tulane Department of Chemistry. * July 27-30, 2015 Travel to DOE Comp. Sci. Graduate Fellowship Program Review in Arlington, VA. * June, 2015: JCTC Publishes our [http://pubs.acs.org/doi/abs/10.1021/acs.jctc.5b00357 article] on "Dispersion- and Exchange-Corrected Density Functional Theory for Sodium Ion Hydration" * Wednesday, May 13, 2015: David M. Rogers presented "Spatiotemporal Concentration-Polarization Induced pH Changes at Ion-Selective Membranes." at the [https://www.cbdstconference.com/agenda Chemical and Biological Defense Sci. & Tech. conference] in St. Louis, MO. * Friday, May 8, 2015: David M. Rogers presented "Where do Quanta Come From?" at the Florida ACS Meeting and Exhibition ([http://fame2015.fl-acs.org/ataglance.html FAME]). * April, 2015: [http://scitation.aip.org/content/aip/journal/jcp/142/7/10.1063/1.4907404 Real-Space Quadrature paper] was published as a cover article by JCP. * Wednesday, Mar. 4, 2015: David M. Rogers presented "[http://meetings.aps.org/Meeting/MAR15/Session/M44.9 Thermodynamics of Maximum Transition Entropy for Quantum Assemblies]." at the APS March Meeting in San Antonio, TX. * Saturday, Nov. 22 2014: USF and neighboring universities are hosting a [http://predictivestatmech.org/papers/MRI-flyer.pdf Scientific Computing Workshop] for undergraduates. Follow the instructions in the flyer to sign up by Nov. 11! * Thursday, Oct. 16: David M. Rogers presented "[http://predictivestatmech.org/papers/real-poles.pdf Real-space quadrature: A convenient, universal representation for multipole expansions]." at the Southeast Regional Meeting of the ACS in Nashville, TN. * Friday, Aug. 29 2014: Felipe Zapata joins the group * Monday, Aug. 25 2014: USF Autumn Semester First Day of Classes - don't forget to sign up for [[CompSciFall2014|Introduction to Scientific Computing]]! * Monday, Aug. 18 2014: David M. Rogers presented an invited talk "pH Dynamics During Concentration Polarization," to the [http://www.pnnl.gov/computing/cm4/ CM4 Mathematics for Mesoscopic Materials Modeling Group]. * Tuesday, July 8 2014: David M. Rogers presented "What’s Holding Up Multiscale modeling?" at the Telluride, CO workshop for [http://www.telluridescience.org/meetings/workshop-details?wid=404 Ions in Aqueous Solutions and Molecular Biology]. * Friday, May 9 2014: David M. Rogers presented "Jumping from atomistic to continuum simulation of electrochemical driving at interfaces," at the 2014 Florida FAME Conference.[http://www.fame.chem.ufl.edu/computational.html] * January 29th, 2014: David M. Rogers presented "Simulating at the molecular / continuum interface," at the USF Research Computing User's Group Forum [http://www.usf.edu/it/research-computing/featured-researchers/rogersgroup.aspx]. * Monday, Aug. 26 2013: USF Autumn Semester First Day of Classes * Friday, July 12, 2013: Argonne Center for Nanoscale Materials [http://nano.anl.gov/users/call_for_proposals.html Proposal Deadline] * Thursday, July 4, 2013: Independence Day - celebrate by supporting [https://www.eff.org/ EFF] * Thursday, April 11 2013: David M. Rogers presented "Solute Partitioning and Transport through Natural and Biomimetic Membranes," at the 2013 ACS National Meeting. == Calendars == * [http://www.registrar.usf.edu/enroll/regist/calendt.php USF Calendar] 463303d4142e29ccef135a12e363cfc3881a7dce 678 676 2018-05-08T20:08:32Z David M. Rogers 2 wikitext text/x-wiki * Friday, May 4, 2018: David M. Rogers presents "Jazz, Evolution, and Trillion Dollar Problems" [[File:jazz.pdf]] at Florida ACS Meeting & Exhibition. * Wednesday, Sept. 27, 2017: Family Science Night! * Thursday, August 31, 2017: David M. Rogers presents "Demystifying Nonequilibrium Statistical Mechanics" at the U. Pittsburgh Chemistry Seminar Series. * May 6, 2017: David M. Rogers presents "Quantum Thermodynamics by Repeated Measurement" at the Florida ACS Meeting & Exposition (FAME2017) and Guy W. Dayhoff II presents "Driving Forces in MD Simulations of Transition and `Free' Flows". * March, 2017: David M. Rogers was honored with [http://dx.doi.org/10.1063/1.4978399 JCP's top reviewer award] for 2016! * Feb. 17, 2017: David M. Rogers presents "Demystifying Nonequilibrium Statistical Mechanics" at the USF Physics Colloquium. * September 14, 2016: David M. Rogers presents "A moment generating function for flows in open quantum systems" at the [http://www.df.unipi.it/~elze/DICE2016.html International Conference for Spacetime, Matter, and Quantum Mechanics]. * July 12-16, 2016: David M. Rogers presents "A Molecular Approach to Dispersion Energy" at the TSRC Workshop on Ions in Solution: Biology, Energy, and Environment. * July 7-8, 2016: David M. Rogers presents "The quantum mechanics of Jaynes" at the LANL Quantum Lunch. * March 13-17, 2016: David M. Rogers presents "The Quantum Andersen Thermostat," at the 2016 ACS Spring Meeting. * Friday, Feb. 12, 2016: David M. Rogers presents "Angle-free methods for boundary element problems on the sphere: The quadrature basis for spherical harmonics," at the USF Mathematics Department Analysis Lecture Series. * Monday, Jan 11, 2016: USF Spring 2016 semester classes begin. * Tuesday, December 15, 2015: David M. Rogers presents "Maximum Transition Entropy - A Causal, Canonical Model for Nonequilibrium Statistical Mechanics," at the 114th Statistical Mechanics Conference at Rutgers, New Brunswick New Jersey. * Monday, September 14, 2015, Invited Presentation, "Understanding the origins of irreversibility: electrical driving and the second law.," Tulane Department of Chemistry. * July 27-30, 2015 Travel to DOE Comp. Sci. Graduate Fellowship Program Review in Arlington, VA. * June, 2015: JCTC Publishes our [http://pubs.acs.org/doi/abs/10.1021/acs.jctc.5b00357 article] on "Dispersion- and Exchange-Corrected Density Functional Theory for Sodium Ion Hydration" * Wednesday, May 13, 2015: David M. Rogers presented "Spatiotemporal Concentration-Polarization Induced pH Changes at Ion-Selective Membranes." at the [https://www.cbdstconference.com/agenda Chemical and Biological Defense Sci. & Tech. conference] in St. Louis, MO. * Friday, May 8, 2015: David M. Rogers presented "Where do Quanta Come From?" at the Florida ACS Meeting and Exhibition ([http://fame2015.fl-acs.org/ataglance.html FAME]). * April, 2015: [http://scitation.aip.org/content/aip/journal/jcp/142/7/10.1063/1.4907404 Real-Space Quadrature paper] was published as a cover article by JCP. * Wednesday, Mar. 4, 2015: David M. Rogers presented "[http://meetings.aps.org/Meeting/MAR15/Session/M44.9 Thermodynamics of Maximum Transition Entropy for Quantum Assemblies]." at the APS March Meeting in San Antonio, TX. * Saturday, Nov. 22 2014: USF and neighboring universities are hosting a [http://predictivestatmech.org/papers/MRI-flyer.pdf Scientific Computing Workshop] for undergraduates. Follow the instructions in the flyer to sign up by Nov. 11! * Thursday, Oct. 16: David M. Rogers presented "[http://predictivestatmech.org/papers/real-poles.pdf Real-space quadrature: A convenient, universal representation for multipole expansions]." at the Southeast Regional Meeting of the ACS in Nashville, TN. * Friday, Aug. 29 2014: Felipe Zapata joins the group * Monday, Aug. 25 2014: USF Autumn Semester First Day of Classes - don't forget to sign up for [[CompSciFall2014|Introduction to Scientific Computing]]! * Monday, Aug. 18 2014: David M. Rogers presented an invited talk "pH Dynamics During Concentration Polarization," to the [http://www.pnnl.gov/computing/cm4/ CM4 Mathematics for Mesoscopic Materials Modeling Group]. * Tuesday, July 8 2014: David M. Rogers presented "What’s Holding Up Multiscale modeling?" at the Telluride, CO workshop for [http://www.telluridescience.org/meetings/workshop-details?wid=404 Ions in Aqueous Solutions and Molecular Biology]. * Friday, May 9 2014: David M. Rogers presented "Jumping from atomistic to continuum simulation of electrochemical driving at interfaces," at the 2014 Florida FAME Conference.[http://www.fame.chem.ufl.edu/computational.html] * January 29th, 2014: David M. Rogers presented "Simulating at the molecular / continuum interface," at the USF Research Computing User's Group Forum [http://www.usf.edu/it/research-computing/featured-researchers/rogersgroup.aspx]. * Monday, Aug. 26 2013: USF Autumn Semester First Day of Classes * Friday, July 12, 2013: Argonne Center for Nanoscale Materials [http://nano.anl.gov/users/call_for_proposals.html Proposal Deadline] * Thursday, July 4, 2013: Independence Day - celebrate by supporting [https://www.eff.org/ EFF] * Thursday, April 11 2013: David M. Rogers presented "Solute Partitioning and Transport through Natural and Biomimetic Membranes," at the 2013 ACS National Meeting. == Calendars == * [http://www.registrar.usf.edu/enroll/regist/calendt.php USF Calendar] f72186291a6248427e6561266dfee7385b747c42 683 678 2018-07-21T19:24:25Z David M. Rogers 2 wikitext text/x-wiki * Tuesday, July 17, 2018: David M. Rogers presents "Fixing Nonlocality in the Primitive Model" [[File:tsrc2018.pdf]] at the TSRC Workshop on Ions in Biology. * Friday, May 4, 2018: David M. Rogers presents "Jazz, Evolution, and Trillion Dollar Problems" [[File:jazz.pdf]] at Florida ACS Meeting & Exhibition. * Thursday, March, 22, 2018: David M. Rogers presents "Finite size effects in simulations of molecular Joule-Thomson flow" [[File:ACS2018.pdf]] at the ACS Spring Meeting in New Orleans. * March 5-9, 2017: David M. Rogers presents "Quantum Nonequilibrium Statistical Mechanics Meets the Measurement Problem" [[File:APS2018.pdf]] at the APS March Meeting in Los Angeles. * Wednesday, Sept. 27, 2017: Family Science Night! * Thursday, August 31, 2017: David M. Rogers presents "Demystifying Nonequilibrium Statistical Mechanics" at the U. Pittsburgh Chemistry Seminar Series. * May 6, 2017: David M. Rogers presents "Quantum Thermodynamics by Repeated Measurement" at the Florida ACS Meeting & Exposition (FAME2017) and Guy W. Dayhoff II presents "Driving Forces in MD Simulations of Transition and `Free' Flows". * March, 2017: David M. Rogers was honored with [http://dx.doi.org/10.1063/1.4978399 JCP's top reviewer award] for 2016! * Feb. 17, 2017: David M. Rogers presents "Demystifying Nonequilibrium Statistical Mechanics" at the USF Physics Colloquium. * September 14, 2016: David M. Rogers presents "A moment generating function for flows in open quantum systems" at the [http://www.df.unipi.it/~elze/DICE2016.html International Conference for Spacetime, Matter, and Quantum Mechanics]. * July 12-16, 2016: David M. Rogers presents "A Molecular Approach to Dispersion Energy" at the TSRC Workshop on Ions in Solution: Biology, Energy, and Environment. * July 7-8, 2016: David M. Rogers presents "The quantum mechanics of Jaynes" at the LANL Quantum Lunch. * March 13-17, 2016: David M. Rogers presents "The Quantum Andersen Thermostat," at the 2016 ACS Spring Meeting. * Friday, Feb. 12, 2016: David M. Rogers presents "Angle-free methods for boundary element problems on the sphere: The quadrature basis for spherical harmonics," at the USF Mathematics Department Analysis Lecture Series. * Monday, Jan 11, 2016: USF Spring 2016 semester classes begin. * Tuesday, December 15, 2015: David M. Rogers presents "Maximum Transition Entropy - A Causal, Canonical Model for Nonequilibrium Statistical Mechanics," at the 114th Statistical Mechanics Conference at Rutgers, New Brunswick New Jersey. * Monday, September 14, 2015, Invited Presentation, "Understanding the origins of irreversibility: electrical driving and the second law.," Tulane Department of Chemistry. * July 27-30, 2015 Travel to DOE Comp. Sci. Graduate Fellowship Program Review in Arlington, VA. * June, 2015: JCTC Publishes our [http://pubs.acs.org/doi/abs/10.1021/acs.jctc.5b00357 article] on "Dispersion- and Exchange-Corrected Density Functional Theory for Sodium Ion Hydration" * Wednesday, May 13, 2015: David M. Rogers presented "Spatiotemporal Concentration-Polarization Induced pH Changes at Ion-Selective Membranes." at the [https://www.cbdstconference.com/agenda Chemical and Biological Defense Sci. & Tech. conference] in St. Louis, MO. * Friday, May 8, 2015: David M. Rogers presented "Where do Quanta Come From?" at the Florida ACS Meeting and Exhibition ([http://fame2015.fl-acs.org/ataglance.html FAME]). * April, 2015: [http://scitation.aip.org/content/aip/journal/jcp/142/7/10.1063/1.4907404 Real-Space Quadrature paper] was published as a cover article by JCP. * Wednesday, Mar. 4, 2015: David M. Rogers presented "[http://meetings.aps.org/Meeting/MAR15/Session/M44.9 Thermodynamics of Maximum Transition Entropy for Quantum Assemblies]." at the APS March Meeting in San Antonio, TX. * Saturday, Nov. 22 2014: USF and neighboring universities are hosting a [http://predictivestatmech.org/papers/MRI-flyer.pdf Scientific Computing Workshop] for undergraduates. Follow the instructions in the flyer to sign up by Nov. 11! * Thursday, Oct. 16: David M. Rogers presented "[http://predictivestatmech.org/papers/real-poles.pdf Real-space quadrature: A convenient, universal representation for multipole expansions]." at the Southeast Regional Meeting of the ACS in Nashville, TN. * Friday, Aug. 29 2014: Felipe Zapata joins the group * Monday, Aug. 25 2014: USF Autumn Semester First Day of Classes - don't forget to sign up for [[CompSciFall2014|Introduction to Scientific Computing]]! * Monday, Aug. 18 2014: David M. Rogers presented an invited talk "pH Dynamics During Concentration Polarization," to the [http://www.pnnl.gov/computing/cm4/ CM4 Mathematics for Mesoscopic Materials Modeling Group]. * Tuesday, July 8 2014: David M. Rogers presented "What’s Holding Up Multiscale modeling?" at the Telluride, CO workshop for [http://www.telluridescience.org/meetings/workshop-details?wid=404 Ions in Aqueous Solutions and Molecular Biology]. * Friday, May 9 2014: David M. Rogers presented "Jumping from atomistic to continuum simulation of electrochemical driving at interfaces," at the 2014 Florida FAME Conference.[http://www.fame.chem.ufl.edu/computational.html] * January 29th, 2014: David M. Rogers presented "Simulating at the molecular / continuum interface," at the USF Research Computing User's Group Forum [http://www.usf.edu/it/research-computing/featured-researchers/rogersgroup.aspx]. * Monday, Aug. 26 2013: USF Autumn Semester First Day of Classes * Friday, July 12, 2013: Argonne Center for Nanoscale Materials [http://nano.anl.gov/users/call_for_proposals.html Proposal Deadline] * Thursday, July 4, 2013: Independence Day - celebrate by supporting [https://www.eff.org/ EFF] * Thursday, April 11 2013: David M. Rogers presented "Solute Partitioning and Transport through Natural and Biomimetic Membranes," at the 2013 ACS National Meeting. == Calendars == * [http://www.registrar.usf.edu/enroll/regist/calendt.php USF Calendar] 3e09688b4f69686b5d0e90667cceab7ff3a3e8d5 684 683 2018-07-21T19:59:53Z David M. Rogers 2 wikitext text/x-wiki * Tuesday, July 17, 2018: David M. Rogers presents "Fixing Nonlocality in the Primitive Model" [[File:tsrc2018.pdf]] at the TSRC Workshop on Ions in Biology. * Friday, May 4, 2018: David M. Rogers presents "Jazz, Evolution, and Trillion Dollar Problems" [[File:jazz.pdf]] at Florida ACS Meeting & Exhibition. * Thursday, March, 22, 2018: David M. Rogers presents "Finite size effects in simulations of molecular Joule-Thomson flow" [[File:ACS2018.pdf]] at the ACS Spring Meeting in New Orleans. * March 5-9, 2017: David M. Rogers presents "Quantum Nonequilibrium Statistical Mechanics Meets the Measurement Problem" [[File:APS2018.pdf]] at the APS March Meeting in Los Angeles. * Wednesday, Sept. 27, 2017: Family Science Night! * Thursday, August 31, 2017: David M. Rogers presents "Demystifying Nonequilibrium Statistical Mechanics" at the U. Pittsburgh Chemistry Seminar Series. * May 6, 2017: David M. Rogers presents "Quantum Thermodynamics by Repeated Measurement" at the Florida ACS Meeting & Exposition (FAME2017) and Guy W. Dayhoff II presents "Driving Forces in MD Simulations of Transition and `Free' Flows". * March, 2017: David M. Rogers was honored with [http://dx.doi.org/10.1063/1.4978399 JCP's top reviewer award] for 2016! * Feb. 17, 2017: David M. Rogers presents "Demystifying Nonequilibrium Statistical Mechanics" at the USF Physics Colloquium. * September 14, 2016: David M. Rogers presents "A moment generating function for flows in open quantum systems" at the [http://www.df.unipi.it/~elze/DICE2016.html International Conference for Spacetime, Matter, and Quantum Mechanics]. * July 12-16, 2016: David M. Rogers presents "A Molecular Approach to Dispersion Energy" at the TSRC Workshop on Ions in Solution: Biology, Energy, and Environment. * July 7-8, 2016: David M. Rogers presents "The quantum mechanics of Jaynes" at the LANL Quantum Lunch. * March 13-17, 2016: David M. Rogers presents "The Quantum Andersen Thermostat," at the 2016 ACS Spring Meeting. * Friday, Feb. 12, 2016: David M. Rogers presents "Angle-free methods for boundary element problems on the sphere: The quadrature basis for spherical harmonics," at the USF Mathematics Department Analysis Lecture Series. * Monday, Jan 11, 2016: USF Spring 2016 semester classes begin. * Tuesday, December 15, 2015: David M. Rogers presents "Maximum Transition Entropy - A Causal, Canonical Model for Nonequilibrium Statistical Mechanics," at the 114th Statistical Mechanics Conference at Rutgers, New Brunswick New Jersey. * Monday, September 14, 2015, Invited Presentation, "Understanding the origins of irreversibility: electrical driving and the second law.," Tulane Department of Chemistry. * July 27-30, 2015 Travel to DOE Comp. Sci. Graduate Fellowship Program Review in Arlington, VA. * June, 2015: JCTC Publishes our [http://pubs.acs.org/doi/abs/10.1021/acs.jctc.5b00357 article] on "Dispersion- and Exchange-Corrected Density Functional Theory for Sodium Ion Hydration" * Wednesday, May 13, 2015: David M. Rogers presented "Spatiotemporal Concentration-Polarization Induced pH Changes at Ion-Selective Membranes." at the [https://www.cbdstconference.com/agenda Chemical and Biological Defense Sci. & Tech. conference] in St. Louis, MO. * Friday, May 8, 2015: David M. Rogers presented "Where do Quanta Come From?" at the Florida ACS Meeting and Exhibition ([http://fame2015.fl-acs.org/ataglance.html FAME]). * April, 2015: [http://scitation.aip.org/content/aip/journal/jcp/142/7/10.1063/1.4907404 Real-Space Quadrature paper] was published as a cover article by JCP. * Wednesday, Mar. 4, 2015: David M. Rogers presented "[http://meetings.aps.org/Meeting/MAR15/Session/M44.9 Thermodynamics of Maximum Transition Entropy for Quantum Assemblies]." at the APS March Meeting in San Antonio, TX. * Saturday, Nov. 22 2014: USF and neighboring universities are hosting a [http://predictivestatmech.org/papers/MRI-flyer.pdf Scientific Computing Workshop] for undergraduates. Follow the instructions in the flyer to sign up by Nov. 11! * Thursday, Oct. 16: David M. Rogers presented "[http://predictivestatmech.org/papers/real-poles.pdf Real-space quadrature: A convenient, universal representation for multipole expansions]." at the Southeast Regional Meeting of the ACS in Nashville, TN. * Friday, Aug. 29 2014: Felipe Zapata joins the group * Monday, Aug. 25 2014: USF Autumn Semester First Day of Classes - don't forget to sign up for [[CompSciFall2014|Introduction to Scientific Computing]]! * Monday, Aug. 18 2014: David M. Rogers presented an invited talk "pH Dynamics During Concentration Polarization," to the [http://www.pnnl.gov/computing/cm4/ CM4 Mathematics for Mesoscopic Materials Modeling Group]. * Tuesday, July 8 2014: David M. Rogers presented "What’s Holding Up Multiscale modeling?" at the Telluride, CO workshop for [http://www.telluridescience.org/meetings/workshop-details?wid=404 Ions in Aqueous Solutions and Molecular Biology]. * Friday, May 9 2014: David M. Rogers presented "Jumping from atomistic to continuum simulation of electrochemical driving at interfaces," at the 2014 Florida FAME Conference.[http://www.fame.chem.ufl.edu/computational.html] * January 29th, 2014: David M. Rogers presented "Simulating at the molecular / continuum interface," at the USF Research Computing User's Group Forum [http://www.usf.edu/it/research-computing/featured-researchers/rogersgroup.aspx]. * Monday, Aug. 26 2013: USF Autumn Semester First Day of Classes * Friday, July 12, 2013: Argonne Center for Nanoscale Materials [http://nano.anl.gov/users/call_for_proposals.html Proposal Deadline] * Thursday, July 4, 2013: Independence Day - celebrate by supporting [https://www.eff.org/ EFF] * Thursday, April 11 2013: David M. Rogers presented "Solute Partitioning and Transport through Natural and Biomimetic Membranes," at the 2013 ACS National Meeting. == Calendars == * [http://www.registrar.usf.edu/enroll/regist/calendt.php USF Calendar] feb1209af51490431dc045e4076b379e9f5b7a2a 685 684 2018-07-22T20:18:40Z David M. Rogers 2 wikitext text/x-wiki * Tuesday, July 17, 2018: David M. Rogers presents "[https://predictivestatmech.org/papers/tsrc2018.pdf Fixing Nonlocality in the Primitive Model]" at the TSRC Workshop on Ions in Biology. * Friday, May 4, 2018: David M. Rogers presents "[https://predictivestatmech.org/papers/jazz.pdf Jazz, Evolution, and Trillion Dollar Problems]" at Florida ACS Meeting & Exhibition. * Thursday, March, 22, 2018: David M. Rogers presents "[https://predictivestatmech.org/papers/acs2018.pdf Finite size effects in simulations of molecular Joule-Thomson flow]" at the ACS Spring Meeting in New Orleans. * March 5-9, 2017: David M. Rogers presents "[https://predictivestatmech.org/papers/aps2018.pdf Quantum Nonequilibrium Statistical Mechanics Meets the Measurement Problem]" at the APS March Meeting in Los Angeles. * Wednesday, Sept. 27, 2017: Family Science Night! * Thursday, August 31, 2017: David M. Rogers presents "Demystifying Nonequilibrium Statistical Mechanics" at the U. Pittsburgh Chemistry Seminar Series. * May 6, 2017: David M. Rogers presents "Quantum Thermodynamics by Repeated Measurement" at the Florida ACS Meeting & Exposition (FAME2017) and Guy W. Dayhoff II presents "Driving Forces in MD Simulations of Transition and `Free' Flows". * March, 2017: David M. Rogers was honored with [http://dx.doi.org/10.1063/1.4978399 JCP's top reviewer award] for 2016! * Feb. 17, 2017: David M. Rogers presents "Demystifying Nonequilibrium Statistical Mechanics" at the USF Physics Colloquium. * September 14, 2016: David M. Rogers presents "A moment generating function for flows in open quantum systems" at the [http://www.df.unipi.it/~elze/DICE2016.html International Conference for Spacetime, Matter, and Quantum Mechanics]. * July 12-16, 2016: David M. Rogers presents "A Molecular Approach to Dispersion Energy" at the TSRC Workshop on Ions in Solution: Biology, Energy, and Environment. * July 7-8, 2016: David M. Rogers presents "The quantum mechanics of Jaynes" at the LANL Quantum Lunch. * March 13-17, 2016: David M. Rogers presents "The Quantum Andersen Thermostat," at the 2016 ACS Spring Meeting. * Friday, Feb. 12, 2016: David M. Rogers presents "Angle-free methods for boundary element problems on the sphere: The quadrature basis for spherical harmonics," at the USF Mathematics Department Analysis Lecture Series. * Monday, Jan 11, 2016: USF Spring 2016 semester classes begin. * Tuesday, December 15, 2015: David M. Rogers presents "Maximum Transition Entropy - A Causal, Canonical Model for Nonequilibrium Statistical Mechanics," at the 114th Statistical Mechanics Conference at Rutgers, New Brunswick New Jersey. * Monday, September 14, 2015, Invited Presentation, "Understanding the origins of irreversibility: electrical driving and the second law.," Tulane Department of Chemistry. * July 27-30, 2015 Travel to DOE Comp. Sci. Graduate Fellowship Program Review in Arlington, VA. * June, 2015: JCTC Publishes our [http://pubs.acs.org/doi/abs/10.1021/acs.jctc.5b00357 article] on "Dispersion- and Exchange-Corrected Density Functional Theory for Sodium Ion Hydration" * Wednesday, May 13, 2015: David M. Rogers presented "Spatiotemporal Concentration-Polarization Induced pH Changes at Ion-Selective Membranes." at the [https://www.cbdstconference.com/agenda Chemical and Biological Defense Sci. & Tech. conference] in St. Louis, MO. * Friday, May 8, 2015: David M. Rogers presented "Where do Quanta Come From?" at the Florida ACS Meeting and Exhibition ([http://fame2015.fl-acs.org/ataglance.html FAME]). * April, 2015: [http://scitation.aip.org/content/aip/journal/jcp/142/7/10.1063/1.4907404 Real-Space Quadrature paper] was published as a cover article by JCP. * Wednesday, Mar. 4, 2015: David M. Rogers presented "[http://meetings.aps.org/Meeting/MAR15/Session/M44.9 Thermodynamics of Maximum Transition Entropy for Quantum Assemblies]." at the APS March Meeting in San Antonio, TX. * Saturday, Nov. 22 2014: USF and neighboring universities are hosting a [http://predictivestatmech.org/papers/MRI-flyer.pdf Scientific Computing Workshop] for undergraduates. Follow the instructions in the flyer to sign up by Nov. 11! * Thursday, Oct. 16: David M. Rogers presented "[http://predictivestatmech.org/papers/real-poles.pdf Real-space quadrature: A convenient, universal representation for multipole expansions]." at the Southeast Regional Meeting of the ACS in Nashville, TN. * Friday, Aug. 29 2014: Felipe Zapata joins the group * Monday, Aug. 25 2014: USF Autumn Semester First Day of Classes - don't forget to sign up for [[CompSciFall2014|Introduction to Scientific Computing]]! * Monday, Aug. 18 2014: David M. Rogers presented an invited talk "pH Dynamics During Concentration Polarization," to the [http://www.pnnl.gov/computing/cm4/ CM4 Mathematics for Mesoscopic Materials Modeling Group]. * Tuesday, July 8 2014: David M. Rogers presented "What’s Holding Up Multiscale modeling?" at the Telluride, CO workshop for [http://www.telluridescience.org/meetings/workshop-details?wid=404 Ions in Aqueous Solutions and Molecular Biology]. * Friday, May 9 2014: David M. Rogers presented "Jumping from atomistic to continuum simulation of electrochemical driving at interfaces," at the 2014 Florida FAME Conference.[http://www.fame.chem.ufl.edu/computational.html] * January 29th, 2014: David M. Rogers presented "Simulating at the molecular / continuum interface," at the USF Research Computing User's Group Forum [http://www.usf.edu/it/research-computing/featured-researchers/rogersgroup.aspx]. * Monday, Aug. 26 2013: USF Autumn Semester First Day of Classes * Friday, July 12, 2013: Argonne Center for Nanoscale Materials [http://nano.anl.gov/users/call_for_proposals.html Proposal Deadline] * Thursday, July 4, 2013: Independence Day - celebrate by supporting [https://www.eff.org/ EFF] * Thursday, April 11 2013: David M. Rogers presented "Solute Partitioning and Transport through Natural and Biomimetic Membranes," at the 2013 ACS National Meeting. == Calendars == * [http://www.registrar.usf.edu/enroll/regist/calendt.php USF Calendar] 19d9eda1f2411c44bcb4a69bea2d3dba8a48c04c 686 685 2018-07-23T14:13:03Z David M. Rogers 2 wikitext text/x-wiki * Tuesday, July 17, 2018: David M. Rogers presents "[https://predictivestatmech.org/papers/tsrc2018.pdf Fixing Nonlocality in the Primitive Model]" at the TSRC Workshop on Ions in Biology. * Friday, May 4, 2018: David M. Rogers presents "[https://predictivestatmech.org/papers/jazz.pdf Jazz, Evolution, and Trillion Dollar Problems]" at Florida ACS Meeting & Exhibition. * Thursday, March, 22, 2018: David M. Rogers presents "[https://predictivestatmech.org/papers/acs2018.pdf Finite size effects in simulations of molecular Joule-Thomson flow]" at the ACS Spring Meeting in New Orleans. * March 5-9, 2018: David M. Rogers presents "[https://predictivestatmech.org/papers/aps2018.pdf Quantum Nonequilibrium Statistical Mechanics Meets the Measurement Problem]" at the APS March Meeting in Los Angeles. * Wednesday, Sept. 27, 2017: Family Science Night! * Thursday, August 31, 2017: David M. Rogers presents "Demystifying Nonequilibrium Statistical Mechanics" at the U. Pittsburgh Chemistry Seminar Series. * May 6, 2017: David M. Rogers presents "Quantum Thermodynamics by Repeated Measurement" at the Florida ACS Meeting & Exposition (FAME2017) and Guy W. Dayhoff II presents "Driving Forces in MD Simulations of Transition and `Free' Flows". * March, 2017: David M. Rogers was honored with [http://dx.doi.org/10.1063/1.4978399 JCP's top reviewer award] for 2016! * Feb. 17, 2017: David M. Rogers presents "Demystifying Nonequilibrium Statistical Mechanics" at the USF Physics Colloquium. * September 14, 2016: David M. Rogers presents "A moment generating function for flows in open quantum systems" at the [http://www.df.unipi.it/~elze/DICE2016.html International Conference for Spacetime, Matter, and Quantum Mechanics]. * July 12-16, 2016: David M. Rogers presents "A Molecular Approach to Dispersion Energy" at the TSRC Workshop on Ions in Solution: Biology, Energy, and Environment. * July 7-8, 2016: David M. Rogers presents "The quantum mechanics of Jaynes" at the LANL Quantum Lunch. * March 13-17, 2016: David M. Rogers presents "The Quantum Andersen Thermostat," at the 2016 ACS Spring Meeting. * Friday, Feb. 12, 2016: David M. Rogers presents "Angle-free methods for boundary element problems on the sphere: The quadrature basis for spherical harmonics," at the USF Mathematics Department Analysis Lecture Series. * Monday, Jan 11, 2016: USF Spring 2016 semester classes begin. * Tuesday, December 15, 2015: David M. Rogers presents "Maximum Transition Entropy - A Causal, Canonical Model for Nonequilibrium Statistical Mechanics," at the 114th Statistical Mechanics Conference at Rutgers, New Brunswick New Jersey. * Monday, September 14, 2015, Invited Presentation, "Understanding the origins of irreversibility: electrical driving and the second law.," Tulane Department of Chemistry. * July 27-30, 2015 Travel to DOE Comp. Sci. Graduate Fellowship Program Review in Arlington, VA. * June, 2015: JCTC Publishes our [http://pubs.acs.org/doi/abs/10.1021/acs.jctc.5b00357 article] on "Dispersion- and Exchange-Corrected Density Functional Theory for Sodium Ion Hydration" * Wednesday, May 13, 2015: David M. Rogers presented "Spatiotemporal Concentration-Polarization Induced pH Changes at Ion-Selective Membranes." at the [https://www.cbdstconference.com/agenda Chemical and Biological Defense Sci. & Tech. conference] in St. Louis, MO. * Friday, May 8, 2015: David M. Rogers presented "Where do Quanta Come From?" at the Florida ACS Meeting and Exhibition ([http://fame2015.fl-acs.org/ataglance.html FAME]). * April, 2015: [http://scitation.aip.org/content/aip/journal/jcp/142/7/10.1063/1.4907404 Real-Space Quadrature paper] was published as a cover article by JCP. * Wednesday, Mar. 4, 2015: David M. Rogers presented "[http://meetings.aps.org/Meeting/MAR15/Session/M44.9 Thermodynamics of Maximum Transition Entropy for Quantum Assemblies]." at the APS March Meeting in San Antonio, TX. * Saturday, Nov. 22 2014: USF and neighboring universities are hosting a [http://predictivestatmech.org/papers/MRI-flyer.pdf Scientific Computing Workshop] for undergraduates. Follow the instructions in the flyer to sign up by Nov. 11! * Thursday, Oct. 16: David M. Rogers presented "[http://predictivestatmech.org/papers/real-poles.pdf Real-space quadrature: A convenient, universal representation for multipole expansions]." at the Southeast Regional Meeting of the ACS in Nashville, TN. * Friday, Aug. 29 2014: Felipe Zapata joins the group * Monday, Aug. 25 2014: USF Autumn Semester First Day of Classes - don't forget to sign up for [[CompSciFall2014|Introduction to Scientific Computing]]! * Monday, Aug. 18 2014: David M. Rogers presented an invited talk "pH Dynamics During Concentration Polarization," to the [http://www.pnnl.gov/computing/cm4/ CM4 Mathematics for Mesoscopic Materials Modeling Group]. * Tuesday, July 8 2014: David M. Rogers presented "What’s Holding Up Multiscale modeling?" at the Telluride, CO workshop for [http://www.telluridescience.org/meetings/workshop-details?wid=404 Ions in Aqueous Solutions and Molecular Biology]. * Friday, May 9 2014: David M. Rogers presented "Jumping from atomistic to continuum simulation of electrochemical driving at interfaces," at the 2014 Florida FAME Conference.[http://www.fame.chem.ufl.edu/computational.html] * January 29th, 2014: David M. Rogers presented "Simulating at the molecular / continuum interface," at the USF Research Computing User's Group Forum [http://www.usf.edu/it/research-computing/featured-researchers/rogersgroup.aspx]. * Monday, Aug. 26 2013: USF Autumn Semester First Day of Classes * Friday, July 12, 2013: Argonne Center for Nanoscale Materials [http://nano.anl.gov/users/call_for_proposals.html Proposal Deadline] * Thursday, July 4, 2013: Independence Day - celebrate by supporting [https://www.eff.org/ EFF] * Thursday, April 11 2013: David M. Rogers presented "Solute Partitioning and Transport through Natural and Biomimetic Membranes," at the 2013 ACS National Meeting. == Calendars == * [http://www.registrar.usf.edu/enroll/regist/calendt.php USF Calendar] e37529ad665029172692a9b4b94791511d1b4827 687 686 2018-07-27T16:15:40Z David M. Rogers 2 wikitext text/x-wiki * Thursday, July 28, 2018: Would have presented "Maximum Entropy Closure for Nonequilibrium Statistical Mechanics" at the [https://nesmcq18.sciencesconf.org New Trends in Nonequilibrium Statistical Mechanics: Classical and Quantum Systems] Conference except American Airlines [https://predictivestatmech.org/code/AAfail.jpg Delayed] all flights to Miami for 6 hours while (unrelated) one of their planes in Philadelphia [https://twitter.com/itsmebeccam/status/1021796289846173697 pissed all over the runway]. It's a bad day for American Air. * Tuesday, July 17, 2018: David M. Rogers presents "[https://predictivestatmech.org/papers/tsrc2018.pdf Fixing Nonlocality in the Primitive Model]" at the TSRC Workshop on Ions in Biology. * Friday, May 4, 2018: David M. Rogers presents "[https://predictivestatmech.org/papers/jazz.pdf Jazz, Evolution, and Trillion Dollar Problems]" at Florida ACS Meeting & Exhibition. * Thursday, March, 22, 2018: David M. Rogers presents "[https://predictivestatmech.org/papers/acs2018.pdf Finite size effects in simulations of molecular Joule-Thomson flow]" at the ACS Spring Meeting in New Orleans. * March 5-9, 2018: David M. Rogers presents "[https://predictivestatmech.org/papers/aps2018.pdf Quantum Nonequilibrium Statistical Mechanics Meets the Measurement Problem]" at the APS March Meeting in Los Angeles. * Wednesday, Sept. 27, 2017: Family Science Night! * Thursday, August 31, 2017: David M. Rogers presents "Demystifying Nonequilibrium Statistical Mechanics" at the U. Pittsburgh Chemistry Seminar Series. * May 6, 2017: David M. Rogers presents "Quantum Thermodynamics by Repeated Measurement" at the Florida ACS Meeting & Exposition (FAME2017) and Guy W. Dayhoff II presents "Driving Forces in MD Simulations of Transition and `Free' Flows". * March, 2017: David M. Rogers was honored with [http://dx.doi.org/10.1063/1.4978399 JCP's top reviewer award] for 2016! * Feb. 17, 2017: David M. Rogers presents "Demystifying Nonequilibrium Statistical Mechanics" at the USF Physics Colloquium. * September 14, 2016: David M. Rogers presents "A moment generating function for flows in open quantum systems" at the [http://www.df.unipi.it/~elze/DICE2016.html International Conference for Spacetime, Matter, and Quantum Mechanics]. * July 12-16, 2016: David M. Rogers presents "A Molecular Approach to Dispersion Energy" at the TSRC Workshop on Ions in Solution: Biology, Energy, and Environment. * July 7-8, 2016: David M. Rogers presents "The quantum mechanics of Jaynes" at the LANL Quantum Lunch. * March 13-17, 2016: David M. Rogers presents "The Quantum Andersen Thermostat," at the 2016 ACS Spring Meeting. * Friday, Feb. 12, 2016: David M. Rogers presents "Angle-free methods for boundary element problems on the sphere: The quadrature basis for spherical harmonics," at the USF Mathematics Department Analysis Lecture Series. * Monday, Jan 11, 2016: USF Spring 2016 semester classes begin. * Tuesday, December 15, 2015: David M. Rogers presents "Maximum Transition Entropy - A Causal, Canonical Model for Nonequilibrium Statistical Mechanics," at the 114th Statistical Mechanics Conference at Rutgers, New Brunswick New Jersey. * Monday, September 14, 2015, Invited Presentation, "Understanding the origins of irreversibility: electrical driving and the second law.," Tulane Department of Chemistry. * July 27-30, 2015 Travel to DOE Comp. Sci. Graduate Fellowship Program Review in Arlington, VA. * June, 2015: JCTC Publishes our [http://pubs.acs.org/doi/abs/10.1021/acs.jctc.5b00357 article] on "Dispersion- and Exchange-Corrected Density Functional Theory for Sodium Ion Hydration" * Wednesday, May 13, 2015: David M. Rogers presented "Spatiotemporal Concentration-Polarization Induced pH Changes at Ion-Selective Membranes." at the [https://www.cbdstconference.com/agenda Chemical and Biological Defense Sci. & Tech. conference] in St. Louis, MO. * Friday, May 8, 2015: David M. Rogers presented "Where do Quanta Come From?" at the Florida ACS Meeting and Exhibition ([http://fame2015.fl-acs.org/ataglance.html FAME]). * April, 2015: [http://scitation.aip.org/content/aip/journal/jcp/142/7/10.1063/1.4907404 Real-Space Quadrature paper] was published as a cover article by JCP. * Wednesday, Mar. 4, 2015: David M. Rogers presented "[http://meetings.aps.org/Meeting/MAR15/Session/M44.9 Thermodynamics of Maximum Transition Entropy for Quantum Assemblies]." at the APS March Meeting in San Antonio, TX. * Saturday, Nov. 22 2014: USF and neighboring universities are hosting a [http://predictivestatmech.org/papers/MRI-flyer.pdf Scientific Computing Workshop] for undergraduates. Follow the instructions in the flyer to sign up by Nov. 11! * Thursday, Oct. 16: David M. Rogers presented "[http://predictivestatmech.org/papers/real-poles.pdf Real-space quadrature: A convenient, universal representation for multipole expansions]." at the Southeast Regional Meeting of the ACS in Nashville, TN. * Friday, Aug. 29 2014: Felipe Zapata joins the group * Monday, Aug. 25 2014: USF Autumn Semester First Day of Classes - don't forget to sign up for [[CompSciFall2014|Introduction to Scientific Computing]]! * Monday, Aug. 18 2014: David M. Rogers presented an invited talk "pH Dynamics During Concentration Polarization," to the [http://www.pnnl.gov/computing/cm4/ CM4 Mathematics for Mesoscopic Materials Modeling Group]. * Tuesday, July 8 2014: David M. Rogers presented "What’s Holding Up Multiscale modeling?" at the Telluride, CO workshop for [http://www.telluridescience.org/meetings/workshop-details?wid=404 Ions in Aqueous Solutions and Molecular Biology]. * Friday, May 9 2014: David M. Rogers presented "Jumping from atomistic to continuum simulation of electrochemical driving at interfaces," at the 2014 Florida FAME Conference.[http://www.fame.chem.ufl.edu/computational.html] * January 29th, 2014: David M. Rogers presented "Simulating at the molecular / continuum interface," at the USF Research Computing User's Group Forum [http://www.usf.edu/it/research-computing/featured-researchers/rogersgroup.aspx]. * Monday, Aug. 26 2013: USF Autumn Semester First Day of Classes * Friday, July 12, 2013: Argonne Center for Nanoscale Materials [http://nano.anl.gov/users/call_for_proposals.html Proposal Deadline] * Thursday, July 4, 2013: Independence Day - celebrate by supporting [https://www.eff.org/ EFF] * Thursday, April 11 2013: David M. Rogers presented "Solute Partitioning and Transport through Natural and Biomimetic Membranes," at the 2013 ACS National Meeting. == Calendars == * [http://www.registrar.usf.edu/enroll/regist/calendt.php USF Calendar] 9acb612e6a09d202fd81aab4f8d2f99ad0b28e23 699 687 2018-10-15T16:43:47Z David M. Rogers 2 wikitext text/x-wiki * Thursday, July 28, 2018: Would have presented "Maximum Entropy Closure for Nonequilibrium Statistical Mechanics" at the [https://nesmcq18.sciencesconf.org New Trends in Nonequilibrium Statistical Mechanics: Classical and Quantum Systems] Conference except American Airlines [https://predictivestatmech.org/code/AAfail.jpg Delayed] all flights to Miami for 6 hours while (unrelated) one of their planes in Philadelphia [https://pic.twitter.com/zdWHVAzlYC pissed all over the runway]. It's a bad day for American Air. * Tuesday, July 17, 2018: David M. Rogers presents "[https://predictivestatmech.org/papers/tsrc2018.pdf Fixing Nonlocality in the Primitive Model]" at the TSRC Workshop on Ions in Biology. * Friday, May 4, 2018: David M. Rogers presents "[https://predictivestatmech.org/papers/jazz.pdf Jazz, Evolution, and Trillion Dollar Problems]" at Florida ACS Meeting & Exhibition. * Thursday, March, 22, 2018: David M. Rogers presents "[https://predictivestatmech.org/papers/acs2018.pdf Finite size effects in simulations of molecular Joule-Thomson flow]" at the ACS Spring Meeting in New Orleans. * March 5-9, 2018: David M. Rogers presents "[https://predictivestatmech.org/papers/aps2018.pdf Quantum Nonequilibrium Statistical Mechanics Meets the Measurement Problem]" at the APS March Meeting in Los Angeles. * Wednesday, Sept. 27, 2017: Family Science Night! * Thursday, August 31, 2017: David M. Rogers presents "Demystifying Nonequilibrium Statistical Mechanics" at the U. Pittsburgh Chemistry Seminar Series. * May 6, 2017: David M. Rogers presents "Quantum Thermodynamics by Repeated Measurement" at the Florida ACS Meeting & Exposition (FAME2017) and Guy W. Dayhoff II presents "Driving Forces in MD Simulations of Transition and `Free' Flows". * March, 2017: David M. Rogers was honored with [http://dx.doi.org/10.1063/1.4978399 JCP's top reviewer award] for 2016! * Feb. 17, 2017: David M. Rogers presents "Demystifying Nonequilibrium Statistical Mechanics" at the USF Physics Colloquium. * September 14, 2016: David M. Rogers presents "A moment generating function for flows in open quantum systems" at the [http://www.df.unipi.it/~elze/DICE2016.html International Conference for Spacetime, Matter, and Quantum Mechanics]. * July 12-16, 2016: David M. Rogers presents "A Molecular Approach to Dispersion Energy" at the TSRC Workshop on Ions in Solution: Biology, Energy, and Environment. * July 7-8, 2016: David M. Rogers presents "The quantum mechanics of Jaynes" at the LANL Quantum Lunch. * March 13-17, 2016: David M. Rogers presents "The Quantum Andersen Thermostat," at the 2016 ACS Spring Meeting. * Friday, Feb. 12, 2016: David M. Rogers presents "Angle-free methods for boundary element problems on the sphere: The quadrature basis for spherical harmonics," at the USF Mathematics Department Analysis Lecture Series. * Monday, Jan 11, 2016: USF Spring 2016 semester classes begin. * Tuesday, December 15, 2015: David M. Rogers presents "Maximum Transition Entropy - A Causal, Canonical Model for Nonequilibrium Statistical Mechanics," at the 114th Statistical Mechanics Conference at Rutgers, New Brunswick New Jersey. * Monday, September 14, 2015, Invited Presentation, "Understanding the origins of irreversibility: electrical driving and the second law.," Tulane Department of Chemistry. * July 27-30, 2015 Travel to DOE Comp. Sci. Graduate Fellowship Program Review in Arlington, VA. * June, 2015: JCTC Publishes our [http://pubs.acs.org/doi/abs/10.1021/acs.jctc.5b00357 article] on "Dispersion- and Exchange-Corrected Density Functional Theory for Sodium Ion Hydration" * Wednesday, May 13, 2015: David M. Rogers presented "Spatiotemporal Concentration-Polarization Induced pH Changes at Ion-Selective Membranes." at the [https://www.cbdstconference.com/agenda Chemical and Biological Defense Sci. & Tech. conference] in St. Louis, MO. * Friday, May 8, 2015: David M. Rogers presented "Where do Quanta Come From?" at the Florida ACS Meeting and Exhibition ([http://fame2015.fl-acs.org/ataglance.html FAME]). * April, 2015: [http://scitation.aip.org/content/aip/journal/jcp/142/7/10.1063/1.4907404 Real-Space Quadrature paper] was published as a cover article by JCP. * Wednesday, Mar. 4, 2015: David M. Rogers presented "[http://meetings.aps.org/Meeting/MAR15/Session/M44.9 Thermodynamics of Maximum Transition Entropy for Quantum Assemblies]." at the APS March Meeting in San Antonio, TX. * Saturday, Nov. 22 2014: USF and neighboring universities are hosting a [http://predictivestatmech.org/papers/MRI-flyer.pdf Scientific Computing Workshop] for undergraduates. Follow the instructions in the flyer to sign up by Nov. 11! * Thursday, Oct. 16: David M. Rogers presented "[http://predictivestatmech.org/papers/real-poles.pdf Real-space quadrature: A convenient, universal representation for multipole expansions]." at the Southeast Regional Meeting of the ACS in Nashville, TN. * Friday, Aug. 29 2014: Felipe Zapata joins the group * Monday, Aug. 25 2014: USF Autumn Semester First Day of Classes - don't forget to sign up for [[CompSciFall2014|Introduction to Scientific Computing]]! * Monday, Aug. 18 2014: David M. Rogers presented an invited talk "pH Dynamics During Concentration Polarization," to the [http://www.pnnl.gov/computing/cm4/ CM4 Mathematics for Mesoscopic Materials Modeling Group]. * Tuesday, July 8 2014: David M. Rogers presented "What’s Holding Up Multiscale modeling?" at the Telluride, CO workshop for [http://www.telluridescience.org/meetings/workshop-details?wid=404 Ions in Aqueous Solutions and Molecular Biology]. * Friday, May 9 2014: David M. Rogers presented "Jumping from atomistic to continuum simulation of electrochemical driving at interfaces," at the 2014 Florida FAME Conference.[http://www.fame.chem.ufl.edu/computational.html] * January 29th, 2014: David M. Rogers presented "Simulating at the molecular / continuum interface," at the USF Research Computing User's Group Forum [http://www.usf.edu/it/research-computing/featured-researchers/rogersgroup.aspx]. * Monday, Aug. 26 2013: USF Autumn Semester First Day of Classes * Friday, July 12, 2013: Argonne Center for Nanoscale Materials [http://nano.anl.gov/users/call_for_proposals.html Proposal Deadline] * Thursday, July 4, 2013: Independence Day - celebrate by supporting [https://www.eff.org/ EFF] * Thursday, April 11 2013: David M. Rogers presented "Solute Partitioning and Transport through Natural and Biomimetic Membranes," at the 2013 ACS National Meeting. == Calendars == * [http://www.registrar.usf.edu/enroll/regist/calendt.php USF Calendar] 6b9a3587dee4baae7ade9acf6e3ed05433273a2a File:Jazz.pdf 6 157 677 2018-05-08T20:06:51Z David M. Rogers 2 wikitext text/x-wiki da39a3ee5e6b4b0d3255bfef95601890afd80709 Main Page 0 9 679 521 2018-05-10T19:20:21Z David M. Rogers 2 wikitext text/x-wiki Welcome to the David M. Rogers' research group in Multiscale Chemical Physics at the University of South Florida. We develop predictive models for new physics and chemistry that appear when moving up from the atomic to the nano and micro-scale. To support this goal, we are developing the thermodynamics of far-from equilibrium systems, building functional data structures for supercomputing and applying Bayesian inference to mine simulation data. Work in these topics builds on recent advances in fundamental computer science, applied statistics, and nonequilibrium physics and chemistry. Together, new developments in these fields will allow unprecedented access to electron through device-level simulations and analysis for materials design grounded in fundamental physics. Two research areas collectively have the potential to greatly reduce the time and effort building, running, and analyzing molecular and continuum simulations for modern high-performance computing platforms. The first expands the theory and techniques of statistical mechanics for probabilistic simulation of energy conversion devices. For more details, see the [[Research]], [[Publications]], and [[Current events]] links. We have '''guaranteed, paid''' [[positions available|Graduate Research Assistantships]] for talented and inquisitive Undergraduate and Graduate Research assistants who want to learn about and make fundamental, lasting contributions to the central science! 55eaa3f2d95c98c967f370efe9120b5565c76b81 680 679 2018-05-10T19:20:31Z David M. Rogers 2 wikitext text/x-wiki Welcome to the David M. Rogers' research group in Multiscale Chemical Physics at the University of South Florida. We develop predictive models for new physics and chemistry that appear when moving up from the atomic to the nano and micro-scale. To support this goal, we are developing the thermodynamics of far-from equilibrium systems, building functional data structures for supercomputing and applying Bayesian inference to mine simulation data. Work in these topics builds on recent advances in fundamental computer science, applied statistics, and nonequilibrium physics and chemistry. Together, new developments in these fields will allow unprecedented access to electron through device-level simulations and analysis for materials design grounded in fundamental physics. Two research areas collectively have the potential to greatly reduce the time and effort building, running, and analyzing molecular and continuum simulations for modern high-performance computing platforms. The first expands the theory and techniques of statistical mechanics for probabilistic simulation of energy conversion devices. For more details, see the [[Research]], [[Publications]], and [[Current events]] links. We have '''guaranteed, paid''' [[positions available|Graduate Research Assistantships]] for talented and inquisitive Undergraduate and Graduate Research assistants who want to learn about and make fundamental, lasting contributions to the central science! 11276039027bfb8f2ef0fc426badf466548f29a5 681 680 2018-05-10T19:21:48Z David M. Rogers 2 wikitext text/x-wiki Welcome to the David M. Rogers' research group in Multiscale Chemical Physics at the University of South Florida. We develop predictive models for new physics and chemistry that appear when moving up from the atomic to the nano and micro-scale. To support this goal, we are developing the thermodynamics of far-from equilibrium systems, building functional data structures for supercomputing and applying Bayesian inference to mine simulation data. Work in these topics builds on recent advances in fundamental computer science, applied statistics, and nonequilibrium physics and chemistry. Together, new developments in these fields will allow unprecedented access to electron through device-level simulations and analysis for materials design grounded in fundamental physics. Two research areas collectively have the potential to greatly reduce the time and effort building, running, and analyzing molecular and continuum simulations for modern high-performance computing platforms. The first expands the theory and techniques of statistical mechanics for probabilistic simulation of energy conversion devices. The second applies advances in domain-specific languages to eliminate the lag between defining a physical, Hamiltonian model and carrying out dynamics and other computations on its potential energy landscape. For more details, see the [[Research]], [[Publications]], and [[Current events]] links. We have '''guaranteed, paid''' [[positions available|Graduate Research Assistantships]] for talented and inquisitive Undergraduate and Graduate Research assistants who want to learn about and make fundamental, lasting contributions to the central science! 4f980592a2413cb285efdfa9e14575cc903728bf 682 681 2018-05-10T19:22:26Z David M. Rogers 2 wikitext text/x-wiki Welcome to the David M. Rogers' research group in Multiscale Chemical Physics at the University of South Florida. We develop predictive models for new physics and chemistry that appear when moving up from the atomic to the nano and micro-scale. To support this goal, we are developing the thermodynamics of far-from equilibrium systems, building functional data structures for supercomputing and applying Bayesian inference to mine simulation data. Work in these topics builds on recent advances in fundamental computer science, applied statistics, and nonequilibrium physics and chemistry. Together, new developments in these fields will allow unprecedented access to electron through device-level simulations and analysis for materials design grounded in fundamental physics. Two research areas collectively have the potential to greatly reduce the time and effort building, running, and analyzing molecular and continuum simulations for modern high-performance computing platforms. The first expands the theory and techniques of statistical mechanics for probabilistic simulation of energy conversion devices. The second applies advances in domain-specific languages to eliminate the lag between defining a physical, Hamiltonian model and carrying out dynamics and other computations on its potential energy landscape. For more details, see the [[Research]], [[Publications]], and [[Predictive_Chemistry:Current_events|Current events]] links. We have '''guaranteed, paid''' [[positions available|Graduate Research Assistantships]] for talented and inquisitive Undergraduate and Graduate Research assistants who want to learn about and make fundamental, lasting contributions to the central science! b9fe579f6f29d2f27c09f8a72279e27ac0cc5eb4 PChemFall2018 0 158 688 2018-08-14T17:58:03Z David M. Rogers 2 Created page with "'''<BIG>Physical Chemistry I</BIG>''' Course Info * Course Numbers CHM 4410-001 * Credit Hours: 4 * Meeting Dates: Aug. 21 - Nov. 27, 2018 ** No Class Aug. 24 or Nov. 22-23 *..." wikitext text/x-wiki '''<BIG>Physical Chemistry I</BIG>''' Course Info * Course Numbers CHM 4410-001 * Credit Hours: 4 * Meeting Dates: Aug. 21 - Nov. 27, 2018 ** No Class Aug. 24 or Nov. 22-23 * Meeting Times: Tues. and Thurs., 3:30-4:45 pm in CIS 3064 ** Problem Sessions: Fri., 2-2:50 pm in CIS 3064 ** Office Hours: Tues. and Thurs., 2:30-3:20 pm in IDR 200 * Grading: ** Quiz (40%) *** To succeed in the quiz, study the topics covered in the previous week! ** Midterm (30%) <s>Thurs., Oct. 11 3:30-4:45 pm</s> <u>Thurs., Oct. 26 3:30-4:45 pm</u> (CIS 3064) ** Final (30%) Thurs., Dec. 6 12:30-2:30 pm (CIS 3064) == Overview == This is the first part of a 2-semester course in thermodynamics. This course will cover the mathematical theory of chemical equilibrium, heat, and work. These are the driving forces behind the operation of Le Châtelier's principle, and are routinely used to understand and control chemical reactions, states of matter, and amount and efficiency of energy production. == Textbooks == * McQuarrie and Simon, Physical Chemistry: A Molecular Approach, University Science Books, 1997. ISBN: 0935702997. == Resources == * [http://hyperphysics.phy-astr.gsu.edu/hbase/kinetic/ktcon.html Kinetic Theory] at HyperPhysics * [http://hyperphysics.phy-astr.gsu.edu/hbase/heacon.html Heat Concepts] at HyperPhysics ** Note: McQuarrie says dU = dQ + dW, while Nave says dU = dQ - dW. There is no contradiction, since McQuarrie's dW = -P dV (work done on the system), while Nave's dW = P dV (work done by the system). I prefer the first definition. * News from the frontlines of exploring entropy: [http://scitation.aip.org/content/aip/magazine/physicstoday/article/68/9/10.1063/PT.3.2912 Information: From Maxwell’s demon to Landauer’s eraser] * [[Media:Transforms.pdf|Notes]] on transformations of variables. * [[PChemFall2016 | Course Page from 2016]] * [[PChemFall2015 | Course Page from 2015]] -- contains previous quizzes and keys. == Topics == # Moving Freely in P-V-T space (Chapter H, with examples from Ch. 16-[2,3,5,6,7], 17-[4,5], and 19-1) #* Isobaric, isothermal, and isochoric processes #* State functions #* Implicit, partial, and total derivatives #* Integration along a path #* Relations between partial derivatives #** Transformations using substitution #** Transformations using the chain rule #* Visualizing isosurfaces #* Using P(V,T) / V(P,T) / T(P,V) # First Law of Thermodynamics – conserved quantities (Ch. 19-[2 to 9]) #* Mechanisms of energy flow: work, heat, mass/chemical #* Integrating work and heat for common processes #* Energy of a molecule vs. a collection – translation, rotation, intermolecular, etc. #* Extensive and intensive quantities #* Using energy balance for fun and profit. # Standard States and Energies (Ch. 19-[10,11,12], Ch 26-[3,6,7,8,9]) #* Connecting to analytical chemistry. #* Spontaneous, irreversible, processes vs. quasistatic processes. #* Experimentally measuring reaction constants and heats. (Ch. 21-5) # The Second Law of Thermodynamics: Energy, Enthalpy, Entropy, and Free Energy (Ch. 20) #* The absolute temperature scale. (Ch. 16-1) #* Inequalities followed by each path type. (Ch. 22-[1,2]) #* Heat, measurement, information, Maxwell’s demon and Landauer’s principle. # Basic Probability #* Simple counting (Ch. J) #* Velocity distribution function (Ch 27-[1,2,3,4]) #* Boltzmann distributions (Ch. 17-[1,2,3,6 to 8]) # Applications: #* Quantitative Prediction of Reaction Equilibria (Ch. 26) #* Liquid solutions: osmotic pressure, vapor pressure, Henry’s and Raoult’s Laws (Ch. 24) #* Phase Equilibria and Basic Phase Diagrams (Ch. 23) #* Thermodynamic Cycles, Examples with Refrigeration and Galvanic Cell (Ch. 20-7) == Online Tutorials == There are some excellent introductory videos on Khan Academy that are useful if you need a refresher or extra practice with some of the topics in the course. # Moving Freely in P-V-T space #* Isobars & Work [https://www.khanacademy.org/test-prep/mcat/chemical-processes/thermodynamics-mcat/v/pv-diagrams-part-1-work-and-isobaric-processes] #* Isotherms, Isochors, Adiabats [https://www.khanacademy.org/test-prep/mcat/chemical-processes/thermodynamics-mcat/v/pv-diagrams-part-2-isothermal-isometric-adiabatic-processes] #* Implicit Derivatives (explained with practice problems) [https://www.khanacademy.org/math/ap-calculus-ab/ab-derivatives-advanced/ab-implicit-diff/v/implicit-differentiation-1] #* Partial Derivatives (explained with practice problems) [https://www.khanacademy.org/math/multivariable-calculus/multivariable-derivatives/partial-derivatives/v/partial-derivatives-introduction] #* State Functions (Macrostates vs Microstates) [https://www.khanacademy.org/science/chemistry/thermodynamics-chemistry/internal-energy-sal/v/macrostates-and-microstates] #* Quasistatic and Reversible Processes [https://www.khanacademy.org/science/chemistry/thermodynamics-chemistry/internal-energy-sal/v/quasistatic-and-reversible-processes] #* Integration along a path (using PV-diagrams and expansion/compression Work) [https://www.khanacademy.org/science/chemistry/thermodynamics-chemistry/internal-energy-sal/v/pv-diagrams-and-expansion-work] # First Law of Thermodynamics – conserved quantities (Ch. 19-[2 to 9]) #* PV work [https://www.khanacademy.org/science/chemistry/thermodynamics-chemistry/internal-energy-sal/a/pressure-volume-work] 8253808581a796092e980a0b01e75b825b515384 689 688 2018-08-14T17:58:31Z David M. Rogers 2 wikitext text/x-wiki '''<BIG>Physical Chemistry I</BIG>''' Course Info * Course Numbers CHM 4410-001 * Credit Hours: 4 * Meeting Dates: Aug. 21 - Nov. 27, 2018 ** No Class Aug. 24 or Nov. 22-23 * Meeting Times: Tues. and Thurs., 3:30-4:45 pm in CIS 3064 ** Problem Sessions: Fri., 2-2:50 pm in CIS 3064 ** Office Hours: Tues. and Thurs., 2:30-3:20 pm in IDR 200 * Grading: ** Quiz (40%) *** To succeed in the quiz, study the topics covered in the previous week! ** Midterm (30%) Thurs., Oct. 11 3:30-4:45 pm (CIS 3064) ** Final (30%) Thurs., Dec. 6 12:30-2:30 pm (CIS 3064) == Overview == This is the first part of a 2-semester course in thermodynamics. This course will cover the mathematical theory of chemical equilibrium, heat, and work. These are the driving forces behind the operation of Le Châtelier's principle, and are routinely used to understand and control chemical reactions, states of matter, and amount and efficiency of energy production. == Textbooks == * McQuarrie and Simon, Physical Chemistry: A Molecular Approach, University Science Books, 1997. ISBN: 0935702997. == Resources == * [http://hyperphysics.phy-astr.gsu.edu/hbase/kinetic/ktcon.html Kinetic Theory] at HyperPhysics * [http://hyperphysics.phy-astr.gsu.edu/hbase/heacon.html Heat Concepts] at HyperPhysics ** Note: McQuarrie says dU = dQ + dW, while Nave says dU = dQ - dW. There is no contradiction, since McQuarrie's dW = -P dV (work done on the system), while Nave's dW = P dV (work done by the system). I prefer the first definition. * News from the frontlines of exploring entropy: [http://scitation.aip.org/content/aip/magazine/physicstoday/article/68/9/10.1063/PT.3.2912 Information: From Maxwell’s demon to Landauer’s eraser] * [[Media:Transforms.pdf|Notes]] on transformations of variables. * [[PChemFall2016 | Course Page from 2016]] * [[PChemFall2015 | Course Page from 2015]] -- contains previous quizzes and keys. == Topics == # Moving Freely in P-V-T space (Chapter H, with examples from Ch. 16-[2,3,5,6,7], 17-[4,5], and 19-1) #* Isobaric, isothermal, and isochoric processes #* State functions #* Implicit, partial, and total derivatives #* Integration along a path #* Relations between partial derivatives #** Transformations using substitution #** Transformations using the chain rule #* Visualizing isosurfaces #* Using P(V,T) / V(P,T) / T(P,V) # First Law of Thermodynamics – conserved quantities (Ch. 19-[2 to 9]) #* Mechanisms of energy flow: work, heat, mass/chemical #* Integrating work and heat for common processes #* Energy of a molecule vs. a collection – translation, rotation, intermolecular, etc. #* Extensive and intensive quantities #* Using energy balance for fun and profit. # Standard States and Energies (Ch. 19-[10,11,12], Ch 26-[3,6,7,8,9]) #* Connecting to analytical chemistry. #* Spontaneous, irreversible, processes vs. quasistatic processes. #* Experimentally measuring reaction constants and heats. (Ch. 21-5) # The Second Law of Thermodynamics: Energy, Enthalpy, Entropy, and Free Energy (Ch. 20) #* The absolute temperature scale. (Ch. 16-1) #* Inequalities followed by each path type. (Ch. 22-[1,2]) #* Heat, measurement, information, Maxwell’s demon and Landauer’s principle. # Basic Probability #* Simple counting (Ch. J) #* Velocity distribution function (Ch 27-[1,2,3,4]) #* Boltzmann distributions (Ch. 17-[1,2,3,6 to 8]) # Applications: #* Quantitative Prediction of Reaction Equilibria (Ch. 26) #* Liquid solutions: osmotic pressure, vapor pressure, Henry’s and Raoult’s Laws (Ch. 24) #* Phase Equilibria and Basic Phase Diagrams (Ch. 23) #* Thermodynamic Cycles, Examples with Refrigeration and Galvanic Cell (Ch. 20-7) == Online Tutorials == There are some excellent introductory videos on Khan Academy that are useful if you need a refresher or extra practice with some of the topics in the course. # Moving Freely in P-V-T space #* Isobars & Work [https://www.khanacademy.org/test-prep/mcat/chemical-processes/thermodynamics-mcat/v/pv-diagrams-part-1-work-and-isobaric-processes] #* Isotherms, Isochors, Adiabats [https://www.khanacademy.org/test-prep/mcat/chemical-processes/thermodynamics-mcat/v/pv-diagrams-part-2-isothermal-isometric-adiabatic-processes] #* Implicit Derivatives (explained with practice problems) [https://www.khanacademy.org/math/ap-calculus-ab/ab-derivatives-advanced/ab-implicit-diff/v/implicit-differentiation-1] #* Partial Derivatives (explained with practice problems) [https://www.khanacademy.org/math/multivariable-calculus/multivariable-derivatives/partial-derivatives/v/partial-derivatives-introduction] #* State Functions (Macrostates vs Microstates) [https://www.khanacademy.org/science/chemistry/thermodynamics-chemistry/internal-energy-sal/v/macrostates-and-microstates] #* Quasistatic and Reversible Processes [https://www.khanacademy.org/science/chemistry/thermodynamics-chemistry/internal-energy-sal/v/quasistatic-and-reversible-processes] #* Integration along a path (using PV-diagrams and expansion/compression Work) [https://www.khanacademy.org/science/chemistry/thermodynamics-chemistry/internal-energy-sal/v/pv-diagrams-and-expansion-work] # First Law of Thermodynamics – conserved quantities (Ch. 19-[2 to 9]) #* PV work [https://www.khanacademy.org/science/chemistry/thermodynamics-chemistry/internal-energy-sal/a/pressure-volume-work] 742552dc90c1106baa24ae7bb6aa96d7d34afc8f 690 689 2018-08-14T18:00:37Z David M. Rogers 2 wikitext text/x-wiki '''<BIG>Physical Chemistry I</BIG>''' Course Info * Course Numbers CHM 4410-001 * Credit Hours: 4 * Meeting Dates: Aug. 21 - Nov. 27, 2018 ** No Class Aug. 24 or Nov. 22-23 * Meeting Times: Tues. and Thurs., 3:30-4:45 pm in CIS 3064 ** Regular quizzes on Tuesdays ** Problem Sessions: Fri., 2-2:50 pm in CIS 3064 ** Office Hours: Tues. and Thurs., 2:30-3:20 pm in IDR 200 * Grading: ** Quiz (40%) *** To succeed in the quiz, complete the homework and study the topics covered in the previous week! ** Midterm (30%) Thurs., Oct. 11 3:30-4:45 pm (CIS 3064) ** Final (30%) Thurs., Dec. 6 12:30-2:30 pm (CIS 3064) == Overview == This is the first part of a 2-semester course in thermodynamics. This course will cover the mathematical theory of chemical equilibrium, heat, and work. These are the driving forces behind the operation of Le Châtelier's principle, and are routinely used to understand and control chemical reactions, states of matter, and amount and efficiency of energy production. == Textbooks == * McQuarrie and Simon, Physical Chemistry: A Molecular Approach, University Science Books, 1997. ISBN: 0935702997. == Resources == * [http://hyperphysics.phy-astr.gsu.edu/hbase/kinetic/ktcon.html Kinetic Theory] at HyperPhysics * [http://hyperphysics.phy-astr.gsu.edu/hbase/heacon.html Heat Concepts] at HyperPhysics ** Note: McQuarrie says dU = dQ + dW, while Nave says dU = dQ - dW. There is no contradiction, since McQuarrie's dW = -P dV (work done on the system), while Nave's dW = P dV (work done by the system). I prefer the first definition. * News from the frontlines of exploring entropy: [http://scitation.aip.org/content/aip/magazine/physicstoday/article/68/9/10.1063/PT.3.2912 Information: From Maxwell’s demon to Landauer’s eraser] * [[Media:Transforms.pdf|Notes]] on transformations of variables. * [[PChemFall2016 | Course Page from 2016]] * [[PChemFall2015 | Course Page from 2015]] -- contains previous quizzes and keys. == Topics == # Moving Freely in P-V-T space (Chapter H, with examples from Ch. 16-[2,3,5,6,7], 17-[4,5], and 19-1) #* Isobaric, isothermal, and isochoric processes #* State functions #* Implicit, partial, and total derivatives #* Integration along a path #* Relations between partial derivatives #** Transformations using substitution #** Transformations using the chain rule #* Visualizing isosurfaces #* Using P(V,T) / V(P,T) / T(P,V) # First Law of Thermodynamics – conserved quantities (Ch. 19-[2 to 9]) #* Mechanisms of energy flow: work, heat, mass/chemical #* Integrating work and heat for common processes #* Energy of a molecule vs. a collection – translation, rotation, intermolecular, etc. #* Extensive and intensive quantities #* Using energy balance for fun and profit. # Standard States and Energies (Ch. 19-[10,11,12], Ch 26-[3,6,7,8,9]) #* Connecting to analytical chemistry. #* Spontaneous, irreversible, processes vs. quasistatic processes. #* Experimentally measuring reaction constants and heats. (Ch. 21-5) # The Second Law of Thermodynamics: Energy, Enthalpy, Entropy, and Free Energy (Ch. 20) #* The absolute temperature scale. (Ch. 16-1) #* Inequalities followed by each path type. (Ch. 22-[1,2]) #* Heat, measurement, information, Maxwell’s demon and Landauer’s principle. # Basic Probability #* Simple counting (Ch. J) #* Velocity distribution function (Ch 27-[1,2,3,4]) #* Boltzmann distributions (Ch. 17-[1,2,3,6 to 8]) # Applications: #* Quantitative Prediction of Reaction Equilibria (Ch. 26) #* Liquid solutions: osmotic pressure, vapor pressure, Henry’s and Raoult’s Laws (Ch. 24) #* Phase Equilibria and Basic Phase Diagrams (Ch. 23) #* Thermodynamic Cycles, Examples with Refrigeration and Galvanic Cell (Ch. 20-7) == Online Tutorials == There are some excellent introductory videos on Khan Academy that are useful if you need a refresher or extra practice with some of the topics in the course. # Moving Freely in P-V-T space #* Isobars & Work [https://www.khanacademy.org/test-prep/mcat/chemical-processes/thermodynamics-mcat/v/pv-diagrams-part-1-work-and-isobaric-processes] #* Isotherms, Isochors, Adiabats [https://www.khanacademy.org/test-prep/mcat/chemical-processes/thermodynamics-mcat/v/pv-diagrams-part-2-isothermal-isometric-adiabatic-processes] #* Implicit Derivatives (explained with practice problems) [https://www.khanacademy.org/math/ap-calculus-ab/ab-derivatives-advanced/ab-implicit-diff/v/implicit-differentiation-1] #* Partial Derivatives (explained with practice problems) [https://www.khanacademy.org/math/multivariable-calculus/multivariable-derivatives/partial-derivatives/v/partial-derivatives-introduction] #* State Functions (Macrostates vs Microstates) [https://www.khanacademy.org/science/chemistry/thermodynamics-chemistry/internal-energy-sal/v/macrostates-and-microstates] #* Quasistatic and Reversible Processes [https://www.khanacademy.org/science/chemistry/thermodynamics-chemistry/internal-energy-sal/v/quasistatic-and-reversible-processes] #* Integration along a path (using PV-diagrams and expansion/compression Work) [https://www.khanacademy.org/science/chemistry/thermodynamics-chemistry/internal-energy-sal/v/pv-diagrams-and-expansion-work] # First Law of Thermodynamics – conserved quantities (Ch. 19-[2 to 9]) #* PV work [https://www.khanacademy.org/science/chemistry/thermodynamics-chemistry/internal-energy-sal/a/pressure-volume-work] 0616b5cee6581ec22e1dd2be46120167cda74d98 691 690 2018-08-21T21:54:17Z David M. Rogers 2 wikitext text/x-wiki '''<BIG>Physical Chemistry I</BIG>''' Course Info * Course Numbers CHM 4410-001 * Credit Hours: 4 * Meeting Dates: Aug. 21 - Nov. 27, 2018 ** No Class Aug. 24 or Nov. 22-23 * Meeting Times: Tues. and Thurs., 3:30-4:45 pm in CIS 3064 ** Regular quizzes on Tuesdays ** Problem Sessions: Fri., 2-2:50 pm in CIS 3064 ** Office Hours: Tues. and Thurs., 2:30-3:20 pm in IDR 200 * Grading: ** Quiz (40%) *** To succeed in the quiz, complete the homework and study the topics covered in the previous week! ** Midterm (30%) Thurs., Oct. 11 3:30-4:45 pm (CIS 3064) ** Final (30%) Thurs., Dec. 6 12:30-2:30 pm (CIS 3064) == Overview == This is the first part of a 2-semester course in thermodynamics. This course will cover the mathematical theory of chemical equilibrium, heat, and work. These are the driving forces behind the operation of Le Châtelier's principle, and are routinely used to understand and control chemical reactions, states of matter, and amount and efficiency of energy production. == Textbooks == * McQuarrie and Simon, Physical Chemistry: A Molecular Approach, University Science Books, 1997. ISBN: 0935702997. == Resources == * [http://hyperphysics.phy-astr.gsu.edu/hbase/kinetic/ktcon.html Kinetic Theory] at HyperPhysics * [http://hyperphysics.phy-astr.gsu.edu/hbase/heacon.html Heat Concepts] at HyperPhysics ** Note: McQuarrie says dU = dQ + dW, while Nave says dU = dQ - dW. There is no contradiction, since McQuarrie's dW = -P dV (work done on the system), while Nave's dW = P dV (work done by the system). I prefer the first definition. * News from the frontlines of exploring entropy: [http://scitation.aip.org/content/aip/magazine/physicstoday/article/68/9/10.1063/PT.3.2912 Information: From Maxwell’s demon to Landauer’s eraser] * [[Media:Transforms.pdf|Notes]] on transformations of variables. * [[PChemFall2017 | Course Page from 2017]] * [[PChemFall2016 | Course Page from 2016]] * [[PChemFall2015 | Course Page from 2015]] -- contains previous quizzes and keys. == Topics == # Moving Freely in P-V-T space (Chapter H, with examples from Ch. 16-[2,3,5,6,7], 17-[4,5], and 19-1) #* Isobaric, isothermal, and isochoric processes #* State functions #* Implicit, partial, and total derivatives #* Integration along a path #* Relations between partial derivatives #** Transformations using substitution #** Transformations using the chain rule #* Visualizing isosurfaces #* Using P(V,T) / V(P,T) / T(P,V) # First Law of Thermodynamics – conserved quantities (Ch. 19-[2 to 9]) #* Mechanisms of energy flow: work, heat, mass/chemical #* Integrating work and heat for common processes #* Energy of a molecule vs. a collection – translation, rotation, intermolecular, etc. #* Extensive and intensive quantities #* Using energy balance for fun and profit. # Standard States and Energies (Ch. 19-[10,11,12], Ch 26-[3,6,7,8,9]) #* Connecting to analytical chemistry. #* Spontaneous, irreversible, processes vs. quasistatic processes. #* Experimentally measuring reaction constants and heats. (Ch. 21-5) # The Second Law of Thermodynamics: Energy, Enthalpy, Entropy, and Free Energy (Ch. 20) #* The absolute temperature scale. (Ch. 16-1) #* Inequalities followed by each path type. (Ch. 22-[1,2]) #* Heat, measurement, information, Maxwell’s demon and Landauer’s principle. # Basic Probability #* Simple counting (Ch. J) #* Velocity distribution function (Ch 27-[1,2,3,4]) #* Boltzmann distributions (Ch. 17-[1,2,3,6 to 8]) # Applications: #* Quantitative Prediction of Reaction Equilibria (Ch. 26) #* Liquid solutions: osmotic pressure, vapor pressure, Henry’s and Raoult’s Laws (Ch. 24) #* Phase Equilibria and Basic Phase Diagrams (Ch. 23) #* Thermodynamic Cycles, Examples with Refrigeration and Galvanic Cell (Ch. 20-7) == Assigned Homework Problems == # Moving Freely in P-V-T space #* H: 1-5,7,10-14 #* 16:1-21,25,26(1st part),29,33(optional,35-42,44-45,52-56,58-59 #** sketch a plot for 16.4 and 16.5 #* 17: 9-17 == Online Tutorials == There are some excellent introductory videos on Khan Academy that are useful if you need a refresher or extra practice with some of the topics in the course. # Moving Freely in P-V-T space #* Isobars & Work [https://www.khanacademy.org/test-prep/mcat/chemical-processes/thermodynamics-mcat/v/pv-diagrams-part-1-work-and-isobaric-processes] #* Isotherms, Isochors, Adiabats [https://www.khanacademy.org/test-prep/mcat/chemical-processes/thermodynamics-mcat/v/pv-diagrams-part-2-isothermal-isometric-adiabatic-processes] #* Implicit Derivatives (explained with practice problems) [https://www.khanacademy.org/math/ap-calculus-ab/ab-derivatives-advanced/ab-implicit-diff/v/implicit-differentiation-1] #* Partial Derivatives (explained with practice problems) [https://www.khanacademy.org/math/multivariable-calculus/multivariable-derivatives/partial-derivatives/v/partial-derivatives-introduction] #* State Functions (Macrostates vs Microstates) [https://www.khanacademy.org/science/chemistry/thermodynamics-chemistry/internal-energy-sal/v/macrostates-and-microstates] #* Quasistatic and Reversible Processes [https://www.khanacademy.org/science/chemistry/thermodynamics-chemistry/internal-energy-sal/v/quasistatic-and-reversible-processes] #* Integration along a path (using PV-diagrams and expansion/compression Work) [https://www.khanacademy.org/science/chemistry/thermodynamics-chemistry/internal-energy-sal/v/pv-diagrams-and-expansion-work] # First Law of Thermodynamics – conserved quantities (Ch. 19-[2 to 9]) #* PV work [https://www.khanacademy.org/science/chemistry/thermodynamics-chemistry/internal-energy-sal/a/pressure-volume-work] 22525a947473df29cc4fbf3fe1537a3f4b70f523 692 691 2018-08-21T21:55:06Z David M. Rogers 2 /* Assigned Homework Problems */ wikitext text/x-wiki '''<BIG>Physical Chemistry I</BIG>''' Course Info * Course Numbers CHM 4410-001 * Credit Hours: 4 * Meeting Dates: Aug. 21 - Nov. 27, 2018 ** No Class Aug. 24 or Nov. 22-23 * Meeting Times: Tues. and Thurs., 3:30-4:45 pm in CIS 3064 ** Regular quizzes on Tuesdays ** Problem Sessions: Fri., 2-2:50 pm in CIS 3064 ** Office Hours: Tues. and Thurs., 2:30-3:20 pm in IDR 200 * Grading: ** Quiz (40%) *** To succeed in the quiz, complete the homework and study the topics covered in the previous week! ** Midterm (30%) Thurs., Oct. 11 3:30-4:45 pm (CIS 3064) ** Final (30%) Thurs., Dec. 6 12:30-2:30 pm (CIS 3064) == Overview == This is the first part of a 2-semester course in thermodynamics. This course will cover the mathematical theory of chemical equilibrium, heat, and work. These are the driving forces behind the operation of Le Châtelier's principle, and are routinely used to understand and control chemical reactions, states of matter, and amount and efficiency of energy production. == Textbooks == * McQuarrie and Simon, Physical Chemistry: A Molecular Approach, University Science Books, 1997. ISBN: 0935702997. == Resources == * [http://hyperphysics.phy-astr.gsu.edu/hbase/kinetic/ktcon.html Kinetic Theory] at HyperPhysics * [http://hyperphysics.phy-astr.gsu.edu/hbase/heacon.html Heat Concepts] at HyperPhysics ** Note: McQuarrie says dU = dQ + dW, while Nave says dU = dQ - dW. There is no contradiction, since McQuarrie's dW = -P dV (work done on the system), while Nave's dW = P dV (work done by the system). I prefer the first definition. * News from the frontlines of exploring entropy: [http://scitation.aip.org/content/aip/magazine/physicstoday/article/68/9/10.1063/PT.3.2912 Information: From Maxwell’s demon to Landauer’s eraser] * [[Media:Transforms.pdf|Notes]] on transformations of variables. * [[PChemFall2017 | Course Page from 2017]] * [[PChemFall2016 | Course Page from 2016]] * [[PChemFall2015 | Course Page from 2015]] -- contains previous quizzes and keys. == Topics == # Moving Freely in P-V-T space (Chapter H, with examples from Ch. 16-[2,3,5,6,7], 17-[4,5], and 19-1) #* Isobaric, isothermal, and isochoric processes #* State functions #* Implicit, partial, and total derivatives #* Integration along a path #* Relations between partial derivatives #** Transformations using substitution #** Transformations using the chain rule #* Visualizing isosurfaces #* Using P(V,T) / V(P,T) / T(P,V) # First Law of Thermodynamics – conserved quantities (Ch. 19-[2 to 9]) #* Mechanisms of energy flow: work, heat, mass/chemical #* Integrating work and heat for common processes #* Energy of a molecule vs. a collection – translation, rotation, intermolecular, etc. #* Extensive and intensive quantities #* Using energy balance for fun and profit. # Standard States and Energies (Ch. 19-[10,11,12], Ch 26-[3,6,7,8,9]) #* Connecting to analytical chemistry. #* Spontaneous, irreversible, processes vs. quasistatic processes. #* Experimentally measuring reaction constants and heats. (Ch. 21-5) # The Second Law of Thermodynamics: Energy, Enthalpy, Entropy, and Free Energy (Ch. 20) #* The absolute temperature scale. (Ch. 16-1) #* Inequalities followed by each path type. (Ch. 22-[1,2]) #* Heat, measurement, information, Maxwell’s demon and Landauer’s principle. # Basic Probability #* Simple counting (Ch. J) #* Velocity distribution function (Ch 27-[1,2,3,4]) #* Boltzmann distributions (Ch. 17-[1,2,3,6 to 8]) # Applications: #* Quantitative Prediction of Reaction Equilibria (Ch. 26) #* Liquid solutions: osmotic pressure, vapor pressure, Henry’s and Raoult’s Laws (Ch. 24) #* Phase Equilibria and Basic Phase Diagrams (Ch. 23) #* Thermodynamic Cycles, Examples with Refrigeration and Galvanic Cell (Ch. 20-7) == Assigned Homework Problems == # Moving Freely in P-V-T space #* H: 1-5,7,10-14 #* 16:1-21,25,26(1st part),29,35-42,44-45,52-56,58-59,33(optional) #** sketch a plot for 16.4 and 16.5 #* 17: 9-17 == Online Tutorials == There are some excellent introductory videos on Khan Academy that are useful if you need a refresher or extra practice with some of the topics in the course. # Moving Freely in P-V-T space #* Isobars & Work [https://www.khanacademy.org/test-prep/mcat/chemical-processes/thermodynamics-mcat/v/pv-diagrams-part-1-work-and-isobaric-processes] #* Isotherms, Isochors, Adiabats [https://www.khanacademy.org/test-prep/mcat/chemical-processes/thermodynamics-mcat/v/pv-diagrams-part-2-isothermal-isometric-adiabatic-processes] #* Implicit Derivatives (explained with practice problems) [https://www.khanacademy.org/math/ap-calculus-ab/ab-derivatives-advanced/ab-implicit-diff/v/implicit-differentiation-1] #* Partial Derivatives (explained with practice problems) [https://www.khanacademy.org/math/multivariable-calculus/multivariable-derivatives/partial-derivatives/v/partial-derivatives-introduction] #* State Functions (Macrostates vs Microstates) [https://www.khanacademy.org/science/chemistry/thermodynamics-chemistry/internal-energy-sal/v/macrostates-and-microstates] #* Quasistatic and Reversible Processes [https://www.khanacademy.org/science/chemistry/thermodynamics-chemistry/internal-energy-sal/v/quasistatic-and-reversible-processes] #* Integration along a path (using PV-diagrams and expansion/compression Work) [https://www.khanacademy.org/science/chemistry/thermodynamics-chemistry/internal-energy-sal/v/pv-diagrams-and-expansion-work] # First Law of Thermodynamics – conserved quantities (Ch. 19-[2 to 9]) #* PV work [https://www.khanacademy.org/science/chemistry/thermodynamics-chemistry/internal-energy-sal/a/pressure-volume-work] e1b0406deaa836822b93c00c47895cf87c0153ec 693 692 2018-08-22T21:07:52Z David M. Rogers 2 wikitext text/x-wiki '''<BIG>Physical Chemistry I</BIG>''' Course Info * Course Numbers CHM 4410-001 * Credit Hours: 4 * Meeting Dates: Aug. 21 - Nov. 27, 2018 ** No Class Aug. 24 or Nov. 22-23 * Meeting Times: Tues. and Thurs., 3:30-4:45 pm in CIS 3064 ** Regular quizzes on Tuesdays ** Problem Sessions: Fri., 2-2:50 pm in CIS 3064 ** Office Hours: Tues. and Thurs., 2:30-3:20 pm in IDR 200 * Grading: ** Quiz (40%) *** To succeed in the quiz, complete the homework and study the topics covered in the previous week! ** Midterm (30%) Thurs., Oct. 11 3:30-4:45 pm (CIS 3064) ** Final (30%) Thurs., Dec. 6 12:30-2:30 pm (CIS 3064) == Overview == This is the first part of a 2-semester course in thermodynamics. This course will cover the mathematical theory of chemical equilibrium, heat, and work. These are the driving forces behind the operation of Le Châtelier's principle, and are routinely used to understand and control chemical reactions, states of matter, and amount and efficiency of energy production. == Textbooks == * McQuarrie and Simon, Physical Chemistry: A Molecular Approach, University Science Books, 1997. ISBN: 0935702997. == Resources == * [http://hyperphysics.phy-astr.gsu.edu/hbase/kinetic/ktcon.html Kinetic Theory] at HyperPhysics * [http://hyperphysics.phy-astr.gsu.edu/hbase/heacon.html Heat Concepts] at HyperPhysics ** Note: McQuarrie says dU = dQ + dW, while Nave says dU = dQ - dW. There is no contradiction, since McQuarrie's dW = -P dV (work done on the system), while Nave's dW = P dV (work done by the system). I prefer the first definition. * News from the frontlines of exploring entropy: [http://scitation.aip.org/content/aip/magazine/physicstoday/article/68/9/10.1063/PT.3.2912 Information: From Maxwell’s demon to Landauer’s eraser] * [[Media:Transforms.pdf|Notes]] on transformations of variables. * [[PChemFall2017 | Course Page from 2017]] * [[PChemFall2016 | Course Page from 2016]] * [[PChemFall2015 | Course Page from 2015]] -- contains previous quizzes and keys. * [https://predictivestatmech.org/papers/quiz0.pdf Pretest key] == Topics == # Moving Freely in P-V-T space (Chapter H, with examples from Ch. 16-[2,3,5,6,7], 17-[4,5], and 19-1) #* Isobaric, isothermal, and isochoric processes #* State functions #* Implicit, partial, and total derivatives #* Integration along a path #* Relations between partial derivatives #** Transformations using substitution #** Transformations using the chain rule #* Visualizing isosurfaces #* Using P(V,T) / V(P,T) / T(P,V) # First Law of Thermodynamics – conserved quantities (Ch. 19-[2 to 9]) #* Mechanisms of energy flow: work, heat, mass/chemical #* Integrating work and heat for common processes #* Energy of a molecule vs. a collection – translation, rotation, intermolecular, etc. #* Extensive and intensive quantities #* Using energy balance for fun and profit. # Standard States and Energies (Ch. 19-[10,11,12], Ch 26-[3,6,7,8,9]) #* Connecting to analytical chemistry. #* Spontaneous, irreversible, processes vs. quasistatic processes. #* Experimentally measuring reaction constants and heats. (Ch. 21-5) # The Second Law of Thermodynamics: Energy, Enthalpy, Entropy, and Free Energy (Ch. 20) #* The absolute temperature scale. (Ch. 16-1) #* Inequalities followed by each path type. (Ch. 22-[1,2]) #* Heat, measurement, information, Maxwell’s demon and Landauer’s principle. # Basic Probability #* Simple counting (Ch. J) #* Velocity distribution function (Ch 27-[1,2,3,4]) #* Boltzmann distributions (Ch. 17-[1,2,3,6 to 8]) # Applications: #* Quantitative Prediction of Reaction Equilibria (Ch. 26) #* Liquid solutions: osmotic pressure, vapor pressure, Henry’s and Raoult’s Laws (Ch. 24) #* Phase Equilibria and Basic Phase Diagrams (Ch. 23) #* Thermodynamic Cycles, Examples with Refrigeration and Galvanic Cell (Ch. 20-7) == Assigned Homework Problems == # Moving Freely in P-V-T space #* H: 1-5,7,10-14 #* 16:1-21,25,26(1st part),29,35-42,44-45,52-56,58-59,33(optional) #** sketch a plot for 16.4 and 16.5 #* 17: 9-17 == Online Tutorials == There are some excellent introductory videos on Khan Academy that are useful if you need a refresher or extra practice with some of the topics in the course. # Moving Freely in P-V-T space #* Isobars & Work [https://www.khanacademy.org/test-prep/mcat/chemical-processes/thermodynamics-mcat/v/pv-diagrams-part-1-work-and-isobaric-processes] #* Isotherms, Isochors, Adiabats [https://www.khanacademy.org/test-prep/mcat/chemical-processes/thermodynamics-mcat/v/pv-diagrams-part-2-isothermal-isometric-adiabatic-processes] #* Implicit Derivatives (explained with practice problems) [https://www.khanacademy.org/math/ap-calculus-ab/ab-derivatives-advanced/ab-implicit-diff/v/implicit-differentiation-1] #* Partial Derivatives (explained with practice problems) [https://www.khanacademy.org/math/multivariable-calculus/multivariable-derivatives/partial-derivatives/v/partial-derivatives-introduction] #* State Functions (Macrostates vs Microstates) [https://www.khanacademy.org/science/chemistry/thermodynamics-chemistry/internal-energy-sal/v/macrostates-and-microstates] #* Quasistatic and Reversible Processes [https://www.khanacademy.org/science/chemistry/thermodynamics-chemistry/internal-energy-sal/v/quasistatic-and-reversible-processes] #* Integration along a path (using PV-diagrams and expansion/compression Work) [https://www.khanacademy.org/science/chemistry/thermodynamics-chemistry/internal-energy-sal/v/pv-diagrams-and-expansion-work] # First Law of Thermodynamics – conserved quantities (Ch. 19-[2 to 9]) #* PV work [https://www.khanacademy.org/science/chemistry/thermodynamics-chemistry/internal-energy-sal/a/pressure-volume-work] 302284e224d2614236386b75f796673c37414bd3 694 693 2018-09-01T19:04:15Z David M. Rogers 2 /* Resources */ wikitext text/x-wiki '''<BIG>Physical Chemistry I</BIG>''' Course Info * Course Numbers CHM 4410-001 * Credit Hours: 4 * Meeting Dates: Aug. 21 - Nov. 27, 2018 ** No Class Aug. 24 or Nov. 22-23 * Meeting Times: Tues. and Thurs., 3:30-4:45 pm in CIS 3064 ** Regular quizzes on Tuesdays ** Problem Sessions: Fri., 2-2:50 pm in CIS 3064 ** Office Hours: Tues. and Thurs., 2:30-3:20 pm in IDR 200 * Grading: ** Quiz (40%) *** To succeed in the quiz, complete the homework and study the topics covered in the previous week! ** Midterm (30%) Thurs., Oct. 11 3:30-4:45 pm (CIS 3064) ** Final (30%) Thurs., Dec. 6 12:30-2:30 pm (CIS 3064) == Overview == This is the first part of a 2-semester course in thermodynamics. This course will cover the mathematical theory of chemical equilibrium, heat, and work. These are the driving forces behind the operation of Le Châtelier's principle, and are routinely used to understand and control chemical reactions, states of matter, and amount and efficiency of energy production. == Textbooks == * McQuarrie and Simon, Physical Chemistry: A Molecular Approach, University Science Books, 1997. ISBN: 0935702997. == Resources == * [http://hyperphysics.phy-astr.gsu.edu/hbase/kinetic/ktcon.html Kinetic Theory] at HyperPhysics * [http://hyperphysics.phy-astr.gsu.edu/hbase/heacon.html Heat Concepts] at HyperPhysics ** Note: McQuarrie says dU = dQ + dW, while Nave says dU = dQ - dW. There is no contradiction, since McQuarrie's dW = -P dV (work done on the system), while Nave's dW = P dV (work done by the system). I prefer the first definition. * News from the frontlines of exploring entropy: [http://scitation.aip.org/content/aip/magazine/physicstoday/article/68/9/10.1063/PT.3.2912 Information: From Maxwell’s demon to Landauer’s eraser] * [[Media:Transforms.pdf|Notes]] on transformations of variables. * [[PChemFall2017 | Course Page from 2017]] * [[PChemFall2016 | Course Page from 2016]] * [[PChemFall2015 | Course Page from 2015]] -- contains previous quizzes and keys. * [https://predictivestatmech.org/papers/quiz0.pdf Pretest key] * [https://predictivestatmech.org/papers/quiz1_2018.pdf Quiz 1 Key] -- for more information and practice problems, see The Vallance Chemistry Group, U. Oxford (http://vallance.chem.ox.ac.uk under Teaching -> Units and Dimensions). == Topics == # Moving Freely in P-V-T space (Chapter H, with examples from Ch. 16-[2,3,5,6,7], 17-[4,5], and 19-1) #* Isobaric, isothermal, and isochoric processes #* State functions #* Implicit, partial, and total derivatives #* Integration along a path #* Relations between partial derivatives #** Transformations using substitution #** Transformations using the chain rule #* Visualizing isosurfaces #* Using P(V,T) / V(P,T) / T(P,V) # First Law of Thermodynamics – conserved quantities (Ch. 19-[2 to 9]) #* Mechanisms of energy flow: work, heat, mass/chemical #* Integrating work and heat for common processes #* Energy of a molecule vs. a collection – translation, rotation, intermolecular, etc. #* Extensive and intensive quantities #* Using energy balance for fun and profit. # Standard States and Energies (Ch. 19-[10,11,12], Ch 26-[3,6,7,8,9]) #* Connecting to analytical chemistry. #* Spontaneous, irreversible, processes vs. quasistatic processes. #* Experimentally measuring reaction constants and heats. (Ch. 21-5) # The Second Law of Thermodynamics: Energy, Enthalpy, Entropy, and Free Energy (Ch. 20) #* The absolute temperature scale. (Ch. 16-1) #* Inequalities followed by each path type. (Ch. 22-[1,2]) #* Heat, measurement, information, Maxwell’s demon and Landauer’s principle. # Basic Probability #* Simple counting (Ch. J) #* Velocity distribution function (Ch 27-[1,2,3,4]) #* Boltzmann distributions (Ch. 17-[1,2,3,6 to 8]) # Applications: #* Quantitative Prediction of Reaction Equilibria (Ch. 26) #* Liquid solutions: osmotic pressure, vapor pressure, Henry’s and Raoult’s Laws (Ch. 24) #* Phase Equilibria and Basic Phase Diagrams (Ch. 23) #* Thermodynamic Cycles, Examples with Refrigeration and Galvanic Cell (Ch. 20-7) == Assigned Homework Problems == # Moving Freely in P-V-T space #* H: 1-5,7,10-14 #* 16:1-21,25,26(1st part),29,35-42,44-45,52-56,58-59,33(optional) #** sketch a plot for 16.4 and 16.5 #* 17: 9-17 == Online Tutorials == There are some excellent introductory videos on Khan Academy that are useful if you need a refresher or extra practice with some of the topics in the course. # Moving Freely in P-V-T space #* Isobars & Work [https://www.khanacademy.org/test-prep/mcat/chemical-processes/thermodynamics-mcat/v/pv-diagrams-part-1-work-and-isobaric-processes] #* Isotherms, Isochors, Adiabats [https://www.khanacademy.org/test-prep/mcat/chemical-processes/thermodynamics-mcat/v/pv-diagrams-part-2-isothermal-isometric-adiabatic-processes] #* Implicit Derivatives (explained with practice problems) [https://www.khanacademy.org/math/ap-calculus-ab/ab-derivatives-advanced/ab-implicit-diff/v/implicit-differentiation-1] #* Partial Derivatives (explained with practice problems) [https://www.khanacademy.org/math/multivariable-calculus/multivariable-derivatives/partial-derivatives/v/partial-derivatives-introduction] #* State Functions (Macrostates vs Microstates) [https://www.khanacademy.org/science/chemistry/thermodynamics-chemistry/internal-energy-sal/v/macrostates-and-microstates] #* Quasistatic and Reversible Processes [https://www.khanacademy.org/science/chemistry/thermodynamics-chemistry/internal-energy-sal/v/quasistatic-and-reversible-processes] #* Integration along a path (using PV-diagrams and expansion/compression Work) [https://www.khanacademy.org/science/chemistry/thermodynamics-chemistry/internal-energy-sal/v/pv-diagrams-and-expansion-work] # First Law of Thermodynamics – conserved quantities (Ch. 19-[2 to 9]) #* PV work [https://www.khanacademy.org/science/chemistry/thermodynamics-chemistry/internal-energy-sal/a/pressure-volume-work] 390e3aab55cd75d1624971cae7e6f381d57eb53e 695 694 2018-09-19T18:14:47Z David M. Rogers 2 /* Assigned Homework Problems */ wikitext text/x-wiki '''<BIG>Physical Chemistry I</BIG>''' Course Info * Course Numbers CHM 4410-001 * Credit Hours: 4 * Meeting Dates: Aug. 21 - Nov. 27, 2018 ** No Class Aug. 24 or Nov. 22-23 * Meeting Times: Tues. and Thurs., 3:30-4:45 pm in CIS 3064 ** Regular quizzes on Tuesdays ** Problem Sessions: Fri., 2-2:50 pm in CIS 3064 ** Office Hours: Tues. and Thurs., 2:30-3:20 pm in IDR 200 * Grading: ** Quiz (40%) *** To succeed in the quiz, complete the homework and study the topics covered in the previous week! ** Midterm (30%) Thurs., Oct. 11 3:30-4:45 pm (CIS 3064) ** Final (30%) Thurs., Dec. 6 12:30-2:30 pm (CIS 3064) == Overview == This is the first part of a 2-semester course in thermodynamics. This course will cover the mathematical theory of chemical equilibrium, heat, and work. These are the driving forces behind the operation of Le Châtelier's principle, and are routinely used to understand and control chemical reactions, states of matter, and amount and efficiency of energy production. == Textbooks == * McQuarrie and Simon, Physical Chemistry: A Molecular Approach, University Science Books, 1997. ISBN: 0935702997. == Resources == * [http://hyperphysics.phy-astr.gsu.edu/hbase/kinetic/ktcon.html Kinetic Theory] at HyperPhysics * [http://hyperphysics.phy-astr.gsu.edu/hbase/heacon.html Heat Concepts] at HyperPhysics ** Note: McQuarrie says dU = dQ + dW, while Nave says dU = dQ - dW. There is no contradiction, since McQuarrie's dW = -P dV (work done on the system), while Nave's dW = P dV (work done by the system). I prefer the first definition. * News from the frontlines of exploring entropy: [http://scitation.aip.org/content/aip/magazine/physicstoday/article/68/9/10.1063/PT.3.2912 Information: From Maxwell’s demon to Landauer’s eraser] * [[Media:Transforms.pdf|Notes]] on transformations of variables. * [[PChemFall2017 | Course Page from 2017]] * [[PChemFall2016 | Course Page from 2016]] * [[PChemFall2015 | Course Page from 2015]] -- contains previous quizzes and keys. * [https://predictivestatmech.org/papers/quiz0.pdf Pretest key] * [https://predictivestatmech.org/papers/quiz1_2018.pdf Quiz 1 Key] -- for more information and practice problems, see The Vallance Chemistry Group, U. Oxford (http://vallance.chem.ox.ac.uk under Teaching -> Units and Dimensions). == Topics == # Moving Freely in P-V-T space (Chapter H, with examples from Ch. 16-[2,3,5,6,7], 17-[4,5], and 19-1) #* Isobaric, isothermal, and isochoric processes #* State functions #* Implicit, partial, and total derivatives #* Integration along a path #* Relations between partial derivatives #** Transformations using substitution #** Transformations using the chain rule #* Visualizing isosurfaces #* Using P(V,T) / V(P,T) / T(P,V) # First Law of Thermodynamics – conserved quantities (Ch. 19-[2 to 9]) #* Mechanisms of energy flow: work, heat, mass/chemical #* Integrating work and heat for common processes #* Energy of a molecule vs. a collection – translation, rotation, intermolecular, etc. #* Extensive and intensive quantities #* Using energy balance for fun and profit. # Standard States and Energies (Ch. 19-[10,11,12], Ch 26-[3,6,7,8,9]) #* Connecting to analytical chemistry. #* Spontaneous, irreversible, processes vs. quasistatic processes. #* Experimentally measuring reaction constants and heats. (Ch. 21-5) # The Second Law of Thermodynamics: Energy, Enthalpy, Entropy, and Free Energy (Ch. 20) #* The absolute temperature scale. (Ch. 16-1) #* Inequalities followed by each path type. (Ch. 22-[1,2]) #* Heat, measurement, information, Maxwell’s demon and Landauer’s principle. # Basic Probability #* Simple counting (Ch. J) #* Velocity distribution function (Ch 27-[1,2,3,4]) #* Boltzmann distributions (Ch. 17-[1,2,3,6 to 8]) # Applications: #* Quantitative Prediction of Reaction Equilibria (Ch. 26) #* Liquid solutions: osmotic pressure, vapor pressure, Henry’s and Raoult’s Laws (Ch. 24) #* Phase Equilibria and Basic Phase Diagrams (Ch. 23) #* Thermodynamic Cycles, Examples with Refrigeration and Galvanic Cell (Ch. 20-7) == Assigned Homework Problems == # Moving Freely in P-V-T space #* H: 1-5,7,10-14 #* 16:1-21,25,26(1st part),29,35-42,44-45,52-56,58-59,33(optional) #** sketch a plot for 16.4 and 16.5 #* 17: 9-17 # First Law (sec. 19-1 through 19-9) #* 19:1-31 #* You can skip 19-27 and 28 (we'll do in class) # Standard States and Energies (sec. 19-10 through 19-12, 21-5 and 26-3 through 26-9) #* 19:34-49 #* 21: 1-7, 10-26, 29, 48, 42-43, 45-47 #* 26: 2-17, 21, 33, 62-65 #* 26:59 [on the van't Hoff plot] == Online Tutorials == There are some excellent introductory videos on Khan Academy that are useful if you need a refresher or extra practice with some of the topics in the course. # Moving Freely in P-V-T space #* Isobars & Work [https://www.khanacademy.org/test-prep/mcat/chemical-processes/thermodynamics-mcat/v/pv-diagrams-part-1-work-and-isobaric-processes] #* Isotherms, Isochors, Adiabats [https://www.khanacademy.org/test-prep/mcat/chemical-processes/thermodynamics-mcat/v/pv-diagrams-part-2-isothermal-isometric-adiabatic-processes] #* Implicit Derivatives (explained with practice problems) [https://www.khanacademy.org/math/ap-calculus-ab/ab-derivatives-advanced/ab-implicit-diff/v/implicit-differentiation-1] #* Partial Derivatives (explained with practice problems) [https://www.khanacademy.org/math/multivariable-calculus/multivariable-derivatives/partial-derivatives/v/partial-derivatives-introduction] #* State Functions (Macrostates vs Microstates) [https://www.khanacademy.org/science/chemistry/thermodynamics-chemistry/internal-energy-sal/v/macrostates-and-microstates] #* Quasistatic and Reversible Processes [https://www.khanacademy.org/science/chemistry/thermodynamics-chemistry/internal-energy-sal/v/quasistatic-and-reversible-processes] #* Integration along a path (using PV-diagrams and expansion/compression Work) [https://www.khanacademy.org/science/chemistry/thermodynamics-chemistry/internal-energy-sal/v/pv-diagrams-and-expansion-work] # First Law of Thermodynamics – conserved quantities (Ch. 19-[2 to 9]) #* PV work [https://www.khanacademy.org/science/chemistry/thermodynamics-chemistry/internal-energy-sal/a/pressure-volume-work] ae117292d3a41b67d512a88a51152d78f9b59df6 697 695 2018-09-27T18:56:22Z David M. Rogers 2 /* Resources */ wikitext text/x-wiki '''<BIG>Physical Chemistry I</BIG>''' Course Info * Course Numbers CHM 4410-001 * Credit Hours: 4 * Meeting Dates: Aug. 21 - Nov. 27, 2018 ** No Class Aug. 24 or Nov. 22-23 * Meeting Times: Tues. and Thurs., 3:30-4:45 pm in CIS 3064 ** Regular quizzes on Tuesdays ** Problem Sessions: Fri., 2-2:50 pm in CIS 3064 ** Office Hours: Tues. and Thurs., 2:30-3:20 pm in IDR 200 * Grading: ** Quiz (40%) *** To succeed in the quiz, complete the homework and study the topics covered in the previous week! ** Midterm (30%) Thurs., Oct. 11 3:30-4:45 pm (CIS 3064) ** Final (30%) Thurs., Dec. 6 12:30-2:30 pm (CIS 3064) == Overview == This is the first part of a 2-semester course in thermodynamics. This course will cover the mathematical theory of chemical equilibrium, heat, and work. These are the driving forces behind the operation of Le Châtelier's principle, and are routinely used to understand and control chemical reactions, states of matter, and amount and efficiency of energy production. == Textbooks == * McQuarrie and Simon, Physical Chemistry: A Molecular Approach, University Science Books, 1997. ISBN: 0935702997. == Resources == * [http://hyperphysics.phy-astr.gsu.edu/hbase/kinetic/ktcon.html Kinetic Theory] at HyperPhysics * [http://hyperphysics.phy-astr.gsu.edu/hbase/heacon.html Heat Concepts] at HyperPhysics ** Note: McQuarrie says dU = dQ + dW, while Nave says dU = dQ - dW. There is no contradiction, since McQuarrie's dW = -P dV (work done on the system), while Nave's dW = P dV (work done by the system). I prefer the first definition. * News from the frontlines of exploring entropy: [http://scitation.aip.org/content/aip/magazine/physicstoday/article/68/9/10.1063/PT.3.2912 Information: From Maxwell’s demon to Landauer’s eraser] * [[Media:Transforms.pdf|Notes]] on transformations of variables. * [[PChemFall2017 | Course Page from 2017]] * [[PChemFall2016 | Course Page from 2016]] * [[PChemFall2015 | Course Page from 2015]] -- contains previous quizzes and keys. * [https://predictivestatmech.org/papers/quiz0.pdf Pretest key] * [https://predictivestatmech.org/papers/quiz1_2018.pdf Quiz 1 Key] -- for more information and practice problems, see The Vallance Chemistry Group, U. Oxford (http://vallance.chem.ox.ac.uk under Teaching -> Units and Dimensions). * Gas Thermodynamics Videos: ** P-V work demonstrated by a [https://youtu.be/j0TQxYemrgg?t=75 Steel Drum Implosion] ** Adiabatic Compression in a [https://youtu.be/4qe1Ueifekg?t=144 Fire Piston] ** Complete thermodynamic cycle [https://youtu.be/EtF3-YmHp_0?t=29 Stirling Engine] ** Pressure (concentration gradient) driven chemical work [https://youtu.be/3y1dO4nNaKY?t=95 ATP Synthetase] == Topics == # Moving Freely in P-V-T space (Chapter H, with examples from Ch. 16-[2,3,5,6,7], 17-[4,5], and 19-1) #* Isobaric, isothermal, and isochoric processes #* State functions #* Implicit, partial, and total derivatives #* Integration along a path #* Relations between partial derivatives #** Transformations using substitution #** Transformations using the chain rule #* Visualizing isosurfaces #* Using P(V,T) / V(P,T) / T(P,V) # First Law of Thermodynamics – conserved quantities (Ch. 19-[2 to 9]) #* Mechanisms of energy flow: work, heat, mass/chemical #* Integrating work and heat for common processes #* Energy of a molecule vs. a collection – translation, rotation, intermolecular, etc. #* Extensive and intensive quantities #* Using energy balance for fun and profit. # Standard States and Energies (Ch. 19-[10,11,12], Ch 26-[3,6,7,8,9]) #* Connecting to analytical chemistry. #* Spontaneous, irreversible, processes vs. quasistatic processes. #* Experimentally measuring reaction constants and heats. (Ch. 21-5) # The Second Law of Thermodynamics: Energy, Enthalpy, Entropy, and Free Energy (Ch. 20) #* The absolute temperature scale. (Ch. 16-1) #* Inequalities followed by each path type. (Ch. 22-[1,2]) #* Heat, measurement, information, Maxwell’s demon and Landauer’s principle. # Basic Probability #* Simple counting (Ch. J) #* Velocity distribution function (Ch 27-[1,2,3,4]) #* Boltzmann distributions (Ch. 17-[1,2,3,6 to 8]) # Applications: #* Quantitative Prediction of Reaction Equilibria (Ch. 26) #* Liquid solutions: osmotic pressure, vapor pressure, Henry’s and Raoult’s Laws (Ch. 24) #* Phase Equilibria and Basic Phase Diagrams (Ch. 23) #* Thermodynamic Cycles, Examples with Refrigeration and Galvanic Cell (Ch. 20-7) == Assigned Homework Problems == # Moving Freely in P-V-T space #* H: 1-5,7,10-14 #* 16:1-21,25,26(1st part),29,35-42,44-45,52-56,58-59,33(optional) #** sketch a plot for 16.4 and 16.5 #* 17: 9-17 # First Law (sec. 19-1 through 19-9) #* 19:1-31 #* You can skip 19-27 and 28 (we'll do in class) # Standard States and Energies (sec. 19-10 through 19-12, 21-5 and 26-3 through 26-9) #* 19:34-49 #* 21: 1-7, 10-26, 29, 48, 42-43, 45-47 #* 26: 2-17, 21, 33, 62-65 #* 26:59 [on the van't Hoff plot] == Online Tutorials == There are some excellent introductory videos on Khan Academy that are useful if you need a refresher or extra practice with some of the topics in the course. # Moving Freely in P-V-T space #* Isobars & Work [https://www.khanacademy.org/test-prep/mcat/chemical-processes/thermodynamics-mcat/v/pv-diagrams-part-1-work-and-isobaric-processes] #* Isotherms, Isochors, Adiabats [https://www.khanacademy.org/test-prep/mcat/chemical-processes/thermodynamics-mcat/v/pv-diagrams-part-2-isothermal-isometric-adiabatic-processes] #* Implicit Derivatives (explained with practice problems) [https://www.khanacademy.org/math/ap-calculus-ab/ab-derivatives-advanced/ab-implicit-diff/v/implicit-differentiation-1] #* Partial Derivatives (explained with practice problems) [https://www.khanacademy.org/math/multivariable-calculus/multivariable-derivatives/partial-derivatives/v/partial-derivatives-introduction] #* State Functions (Macrostates vs Microstates) [https://www.khanacademy.org/science/chemistry/thermodynamics-chemistry/internal-energy-sal/v/macrostates-and-microstates] #* Quasistatic and Reversible Processes [https://www.khanacademy.org/science/chemistry/thermodynamics-chemistry/internal-energy-sal/v/quasistatic-and-reversible-processes] #* Integration along a path (using PV-diagrams and expansion/compression Work) [https://www.khanacademy.org/science/chemistry/thermodynamics-chemistry/internal-energy-sal/v/pv-diagrams-and-expansion-work] # First Law of Thermodynamics – conserved quantities (Ch. 19-[2 to 9]) #* PV work [https://www.khanacademy.org/science/chemistry/thermodynamics-chemistry/internal-energy-sal/a/pressure-volume-work] b370f8ce1ad1eed5b2d9f1da5fd9b52413b3ecbc 700 697 2018-10-23T17:10:22Z David M. Rogers 2 wikitext text/x-wiki '''<BIG>Physical Chemistry I</BIG>''' Course Info * Course Numbers CHM 4410-001 * Credit Hours: 4 * Meeting Dates: Aug. 21 - Nov. 27, 2018 ** No Class Aug. 24 or Nov. 22-23 * Meeting Times: Tues. and Thurs., 3:30-4:45 pm in CIS 3064 ** Regular quizzes on Tuesdays ** Problem Sessions: Fri., 2-2:50 pm in CIS 3064 ** Office Hours: Tues. and Thurs., 2:30-3:20 pm in IDR 200 * Grading: ** Quiz (40%) *** To succeed in the quiz, complete the homework and study the topics covered in the previous week! ** Midterm (30%) Thurs., Oct. 11 3:30-4:45 pm (CIS 3064) ** Final (30%) Thurs., Dec. 6 12:30-2:30 pm (CIS 3064) == Overview == This is the first part of a 2-semester course in thermodynamics. This course will cover the mathematical theory of chemical equilibrium, heat, and work. These are the driving forces behind the operation of Le Châtelier's principle, and are routinely used to understand and control chemical reactions, states of matter, and amount and efficiency of energy production. == Textbooks == * McQuarrie and Simon, Physical Chemistry: A Molecular Approach, University Science Books, 1997. ISBN: 0935702997. == Resources == * [http://hyperphysics.phy-astr.gsu.edu/hbase/kinetic/ktcon.html Kinetic Theory] at HyperPhysics * [http://hyperphysics.phy-astr.gsu.edu/hbase/heacon.html Heat Concepts] at HyperPhysics ** Note: McQuarrie says dU = dQ + dW, while Nave says dU = dQ - dW. There is no contradiction, since McQuarrie's dW = -P dV (work done on the system), while Nave's dW = P dV (work done by the system). I prefer the first definition. * News from the frontlines of exploring entropy: [http://scitation.aip.org/content/aip/magazine/physicstoday/article/68/9/10.1063/PT.3.2912 Information: From Maxwell’s demon to Landauer’s eraser] * [[Media:Transforms.pdf|Notes]] on transformations of variables. * [[PChemFall2017 | Course Page from 2017]] * [[PChemFall2016 | Course Page from 2016]] * [[PChemFall2015 | Course Page from 2015]] -- contains previous quizzes and keys. * [https://predictivestatmech.org/papers/quiz0.pdf Pretest key] * [https://predictivestatmech.org/papers/quiz1_2018.pdf Quiz 1 Key] -- for more information and practice problems, see The Vallance Chemistry Group, U. Oxford (http://vallance.chem.ox.ac.uk under Teaching -> Units and Dimensions). * Gas Thermodynamics Videos: ** P-V work demonstrated by a [https://youtu.be/j0TQxYemrgg?t=75 Steel Drum Implosion] ** Adiabatic Compression in a [https://youtu.be/4qe1Ueifekg?t=144 Fire Piston] ** Complete thermodynamic cycle [https://youtu.be/EtF3-YmHp_0?t=29 Stirling Engine] ** Pressure (concentration gradient) driven chemical work [https://youtu.be/3y1dO4nNaKY?t=95 ATP Synthetase] == Topics == # Moving Freely in P-V-T space (Chapter H, with examples from Ch. 16-[2,3,5,6,7], 17-[4,5], and 19-1) #* Isobaric, isothermal, and isochoric processes #* State functions #* Implicit, partial, and total derivatives #* Integration along a path #* Relations between partial derivatives #** Transformations using substitution #** Transformations using the chain rule #* Visualizing isosurfaces #* Using P(V,T) / V(P,T) / T(P,V) # First Law of Thermodynamics – conserved quantities (Ch. 19-[2 to 9]) #* Mechanisms of energy flow: work, heat, mass/chemical #* Integrating work and heat for common processes #* Energy of a molecule vs. a collection – translation, rotation, intermolecular, etc. #* Extensive and intensive quantities #* Using energy balance for fun and profit. # Standard States and Energies (Ch. 19-[10,11,12], Ch 26-[3,6,7,8,9]) #* Connecting to analytical chemistry. #* Spontaneous, irreversible, processes vs. quasistatic processes. #* Experimentally measuring reaction constants and heats. (Ch. 21-5) # The Second Law of Thermodynamics: Energy, Enthalpy, Entropy, and Free Energy (Ch. 20) #* The absolute temperature scale. (Ch. 16-1) #* Inequalities followed by each path type. (Ch. 22-[1,2]) #* Heat, measurement, information, Maxwell’s demon and Landauer’s principle. # Basic Probability #* Simple counting (Ch. J) #* Velocity distribution function (Ch 27-[1,2,3,4]) #* Boltzmann distributions (Ch. 17-[1,2,3,6 to 8]) # Applications: #* Quantitative Prediction of Reaction Equilibria (Ch. 26) #* Liquid solutions: osmotic pressure, vapor pressure, Henry’s and Raoult’s Laws (Ch. 24) #* Phase Equilibria and Basic Phase Diagrams (Ch. 23) #* Thermodynamic Cycles, Examples with Refrigeration and Galvanic Cell (Ch. 20-7) == Assigned Homework Problems == # Moving Freely in P-V-T space #* H: 1-5,7,10-14 #* 16:1-21,25,26(1st part),29,35-42,44-45,52-56,58-59,33(optional) #** sketch a plot for 16.4 and 16.5 #* 17: 9-17 # First Law (sec. 19-1 through 19-9) #* 19:1-31 #* You can skip 19-27 and 28 (we'll do in class) # Standard States and Energies (sec. 19-10 through 19-12, 21-5 and 26-3 through 26-9) #* 19:34-49 #* 21: 1-7, 10-26, 29, 48, 42-43, 45-47 #* 26: 2-17, 21, 33, 62-65 #* 26:59 [on the van't Hoff plot] # Entropy, Free Energy and the Second Law (all of Ch. 20, sections 16:1, 22:1-2) #* 20: 2-4, 6-16, 18-19, 24-25, 27-30, 32-33 #* 22: 1-5 (for 4 and 5 use 1st law and Gibbs relation from A) #* 16: 4,6-11 == Online Tutorials == There are some excellent introductory videos on Khan Academy that are useful if you need a refresher or extra practice with some of the topics in the course. # Moving Freely in P-V-T space #* Isobars & Work [https://www.khanacademy.org/test-prep/mcat/chemical-processes/thermodynamics-mcat/v/pv-diagrams-part-1-work-and-isobaric-processes] #* Isotherms, Isochors, Adiabats [https://www.khanacademy.org/test-prep/mcat/chemical-processes/thermodynamics-mcat/v/pv-diagrams-part-2-isothermal-isometric-adiabatic-processes] #* Implicit Derivatives (explained with practice problems) [https://www.khanacademy.org/math/ap-calculus-ab/ab-derivatives-advanced/ab-implicit-diff/v/implicit-differentiation-1] #* Partial Derivatives (explained with practice problems) [https://www.khanacademy.org/math/multivariable-calculus/multivariable-derivatives/partial-derivatives/v/partial-derivatives-introduction] #* State Functions (Macrostates vs Microstates) [https://www.khanacademy.org/science/chemistry/thermodynamics-chemistry/internal-energy-sal/v/macrostates-and-microstates] #* Quasistatic and Reversible Processes [https://www.khanacademy.org/science/chemistry/thermodynamics-chemistry/internal-energy-sal/v/quasistatic-and-reversible-processes] #* Integration along a path (using PV-diagrams and expansion/compression Work) [https://www.khanacademy.org/science/chemistry/thermodynamics-chemistry/internal-energy-sal/v/pv-diagrams-and-expansion-work] # First Law of Thermodynamics – conserved quantities (Ch. 19-[2 to 9]) #* PV work [https://www.khanacademy.org/science/chemistry/thermodynamics-chemistry/internal-energy-sal/a/pressure-volume-work] 506d8ee51843b161e52394f67a6ab6cceff62c77 701 700 2018-10-26T17:32:46Z David M. Rogers 2 /* Assigned Homework Problems */ wikitext text/x-wiki '''<BIG>Physical Chemistry I</BIG>''' Course Info * Course Numbers CHM 4410-001 * Credit Hours: 4 * Meeting Dates: Aug. 21 - Nov. 27, 2018 ** No Class Aug. 24 or Nov. 22-23 * Meeting Times: Tues. and Thurs., 3:30-4:45 pm in CIS 3064 ** Regular quizzes on Tuesdays ** Problem Sessions: Fri., 2-2:50 pm in CIS 3064 ** Office Hours: Tues. and Thurs., 2:30-3:20 pm in IDR 200 * Grading: ** Quiz (40%) *** To succeed in the quiz, complete the homework and study the topics covered in the previous week! ** Midterm (30%) Thurs., Oct. 11 3:30-4:45 pm (CIS 3064) ** Final (30%) Thurs., Dec. 6 12:30-2:30 pm (CIS 3064) == Overview == This is the first part of a 2-semester course in thermodynamics. This course will cover the mathematical theory of chemical equilibrium, heat, and work. These are the driving forces behind the operation of Le Châtelier's principle, and are routinely used to understand and control chemical reactions, states of matter, and amount and efficiency of energy production. == Textbooks == * McQuarrie and Simon, Physical Chemistry: A Molecular Approach, University Science Books, 1997. ISBN: 0935702997. == Resources == * [http://hyperphysics.phy-astr.gsu.edu/hbase/kinetic/ktcon.html Kinetic Theory] at HyperPhysics * [http://hyperphysics.phy-astr.gsu.edu/hbase/heacon.html Heat Concepts] at HyperPhysics ** Note: McQuarrie says dU = dQ + dW, while Nave says dU = dQ - dW. There is no contradiction, since McQuarrie's dW = -P dV (work done on the system), while Nave's dW = P dV (work done by the system). I prefer the first definition. * News from the frontlines of exploring entropy: [http://scitation.aip.org/content/aip/magazine/physicstoday/article/68/9/10.1063/PT.3.2912 Information: From Maxwell’s demon to Landauer’s eraser] * [[Media:Transforms.pdf|Notes]] on transformations of variables. * [[PChemFall2017 | Course Page from 2017]] * [[PChemFall2016 | Course Page from 2016]] * [[PChemFall2015 | Course Page from 2015]] -- contains previous quizzes and keys. * [https://predictivestatmech.org/papers/quiz0.pdf Pretest key] * [https://predictivestatmech.org/papers/quiz1_2018.pdf Quiz 1 Key] -- for more information and practice problems, see The Vallance Chemistry Group, U. Oxford (http://vallance.chem.ox.ac.uk under Teaching -> Units and Dimensions). * Gas Thermodynamics Videos: ** P-V work demonstrated by a [https://youtu.be/j0TQxYemrgg?t=75 Steel Drum Implosion] ** Adiabatic Compression in a [https://youtu.be/4qe1Ueifekg?t=144 Fire Piston] ** Complete thermodynamic cycle [https://youtu.be/EtF3-YmHp_0?t=29 Stirling Engine] ** Pressure (concentration gradient) driven chemical work [https://youtu.be/3y1dO4nNaKY?t=95 ATP Synthetase] == Topics == # Moving Freely in P-V-T space (Chapter H, with examples from Ch. 16-[2,3,5,6,7], 17-[4,5], and 19-1) #* Isobaric, isothermal, and isochoric processes #* State functions #* Implicit, partial, and total derivatives #* Integration along a path #* Relations between partial derivatives #** Transformations using substitution #** Transformations using the chain rule #* Visualizing isosurfaces #* Using P(V,T) / V(P,T) / T(P,V) # First Law of Thermodynamics – conserved quantities (Ch. 19-[2 to 9]) #* Mechanisms of energy flow: work, heat, mass/chemical #* Integrating work and heat for common processes #* Energy of a molecule vs. a collection – translation, rotation, intermolecular, etc. #* Extensive and intensive quantities #* Using energy balance for fun and profit. # Standard States and Energies (Ch. 19-[10,11,12], Ch 26-[3,6,7,8,9]) #* Connecting to analytical chemistry. #* Spontaneous, irreversible, processes vs. quasistatic processes. #* Experimentally measuring reaction constants and heats. (Ch. 21-5) # The Second Law of Thermodynamics: Energy, Enthalpy, Entropy, and Free Energy (Ch. 20) #* The absolute temperature scale. (Ch. 16-1) #* Inequalities followed by each path type. (Ch. 22-[1,2]) #* Heat, measurement, information, Maxwell’s demon and Landauer’s principle. # Basic Probability #* Simple counting (Ch. J) #* Velocity distribution function (Ch 27-[1,2,3,4]) #* Boltzmann distributions (Ch. 17-[1,2,3,6 to 8]) # Applications: #* Quantitative Prediction of Reaction Equilibria (Ch. 26) #* Liquid solutions: osmotic pressure, vapor pressure, Henry’s and Raoult’s Laws (Ch. 24) #* Phase Equilibria and Basic Phase Diagrams (Ch. 23) #* Thermodynamic Cycles, Examples with Refrigeration and Galvanic Cell (Ch. 20-7) == Assigned Homework Problems == # Moving Freely in P-V-T space #* H: 1-5,7,10-14 #* 16:1-21,25,26(1st part),29,35-42,44-45,52-56,58-59,33(optional) #** sketch a plot for 16.4 and 16.5 #* 17: 9-17 # First Law (sec. 19-1 through 19-9) #* 19:1-31 #* You can skip 19-27 and 28 (we'll do in class) # Standard States and Energies (sec. 19-10 through 19-12, 21-5 and 26-3 through 26-9) #* 19:34-49 #* 21: 1-7, 10-26, 29, 48, 42-43, 45-47 #* 26: 2,6,8-11,13,16-17,21 #* 26: 61 -- only integrate dG = V dP at constant V=1/rho. # Midterm! # Entropy, Free Energy and the Second Law (all of Ch. 20, sections 16:1, 22:1-2) #* 20: 2-4, 6-16, 18-19, 24-25, 27-30, 32-33 #* 22: 1-5 (for 4 and 5 use 1st law and Gibbs relation from A) #* 16: 4,6-11 # Basic Probability (Ch. J, 17 and 27) #* J: 1-7 #* 17: 1, 3, 4, 7-8 [for 7, use a 3-state system with E(0) = 0, E(-1) = -1, E(1) = 1] #* 27:1-9 # Applications: ## Reaction Equilibria (Ch. 26) ##* 26: 3-7, 12, 14-15, 33, 59, 61, 62-65 ## Phase Equilibria and Basic Phase Diagrams (Ch. 23) ## Liquid Solutions: Osmotic Pressure, Henry's and Raoult's Law (Ch. 24) == Online Tutorials == There are some excellent introductory videos on Khan Academy that are useful if you need a refresher or extra practice with some of the topics in the course. # Moving Freely in P-V-T space #* Isobars & Work [https://www.khanacademy.org/test-prep/mcat/chemical-processes/thermodynamics-mcat/v/pv-diagrams-part-1-work-and-isobaric-processes] #* Isotherms, Isochors, Adiabats [https://www.khanacademy.org/test-prep/mcat/chemical-processes/thermodynamics-mcat/v/pv-diagrams-part-2-isothermal-isometric-adiabatic-processes] #* Implicit Derivatives (explained with practice problems) [https://www.khanacademy.org/math/ap-calculus-ab/ab-derivatives-advanced/ab-implicit-diff/v/implicit-differentiation-1] #* Partial Derivatives (explained with practice problems) [https://www.khanacademy.org/math/multivariable-calculus/multivariable-derivatives/partial-derivatives/v/partial-derivatives-introduction] #* State Functions (Macrostates vs Microstates) [https://www.khanacademy.org/science/chemistry/thermodynamics-chemistry/internal-energy-sal/v/macrostates-and-microstates] #* Quasistatic and Reversible Processes [https://www.khanacademy.org/science/chemistry/thermodynamics-chemistry/internal-energy-sal/v/quasistatic-and-reversible-processes] #* Integration along a path (using PV-diagrams and expansion/compression Work) [https://www.khanacademy.org/science/chemistry/thermodynamics-chemistry/internal-energy-sal/v/pv-diagrams-and-expansion-work] # First Law of Thermodynamics – conserved quantities (Ch. 19-[2 to 9]) #* PV work [https://www.khanacademy.org/science/chemistry/thermodynamics-chemistry/internal-energy-sal/a/pressure-volume-work] 3c06d6d7ecfaf82034b54354aaa95af5f58e60a7 Courses 0 16 696 613 2018-09-27T18:32:52Z David M. Rogers 2 /* Courses */ wikitext text/x-wiki Here's a list of courses with useful online materials: == Courses == * [[PChemFall2018| USF Physical Chemistry I (2018)]] * [[PChemFall2017| USF Physical Chemistry I (2017)]] * [[PChemFall2016| USF Physical Chemistry I (2016)]] * [[GradQuantumFall2013| USF Graduate Quantum Mechanics I]] * [[GradQuantumSpring2014| USF Graduate Quantum Mechanics II]] * [[CompSciSpring2018|Introduction to Scientific Computing (2018)]] * [[CompSciSpring2017|Introduction to Scientific Computing (2017)]] * [[CompSciSpring2016|Introduction to Scientific Computing (2016)]] * [[CompSciFall2014|Introduction to Scientific Computing (2014)]] * [http://lambda-the-ultimate.org/classic/Courses.html Functional Programming] == Lecture Series == * [http://www.esqc.org/lectures European Summer School in Quantum Chemistry] == Tutorials == * [[HowTo:Fourier|Fourier transforms]] * [http://www.mathematica-journal.com/2012/02/evaluation-of-gaussian-molecular-integrals Evaluating Matrix Elements] * [http://www.haskell.org/tutorial/ Haskell] * [http://monads.haskell.cz/html/index.html Monads] * [http://www.yosefk.com/blog/my-history-with-forth-stack-machines.html The Forth Language] == Reference Material == * [http://dft.sandia.gov/Quest/DFT_codes.html List of DFT Codes] * [http://docs.python.org/3/tutorial/ Python Tutorial] * [http://www.nwchem-sw.org/index.php/Release62:NWChem_Documentation NWChem Documentation] * [http://www.ebi.ac.uk/pdbe-srv/pdbechem/ PDB Ligand Structures] 524b5d64876289ac2018e5e60f55433a794d88d7 Research 0 11 698 67 2018-09-28T15:54:00Z David M. Rogers 2 wikitext text/x-wiki [https://predictivestatmech.org/papers/CV.pdf Prof. David Rogers' CV] = Nonequilibrium Statistical Mechanics = The first law of thermodynamics states that energy can flow into a system both as heat and work. The second law states that heat divided by temperature is a particularly pernicious quantity. It represents an increase in something like a debt which can never be bought down, only exported somewhere else. Recent discoveries in nonequilibrium statistical mechanics have centered around the microscopic origins of this 'irreversibility.' We have uncovered surprising new connections to observable information. For example, energy rejected from a process, but not used to do work, has to be counted as heat. The more statistical information we have about a process, the more avenues we have to extract some of that energy, shifting it under the heading of 'work.' We are investigating these microscopic processes through simulations on nanoscale energy conversion devices. = Local Free Energy Methods = Molecule partitioning underlies drug activity, separation and extraction, and solid/liquid phase stability. A variety of factors come together to determine the part of a solution that a molecule will take up residence, and more than one explanation is possible. The most useful of these for designing new molecular and solvent structures is a local picture, where a free energy for moving a molecule to different points in solution acts like a voltage probe in an electric circuit. The energy required for moving a molecule to any point in solution can be divided into molecular packing, direct energetic interaction with a surrounding set of ligands, and long-range solvent polarization terms. We are building models for these components that will greatly simplify the process of designing better devices using molecular information. = More Research = In and around [http://sciences.cas.usf.edu/research_clusters/ USF] and elsewhere, there's a huge effort to understand these problems in testable, analytical and computable ways. Check the [[Links]] page for more ideas. 20763bd503200e77b563ebb2c94a8207c678ba3b Courses/PChemSpring2019 0 159 703 2019-01-07T18:17:42Z David M. Rogers 2 Created page with "'''<BIG>Physical Chemistry II</BIG>''' Course Info * Course Numbers CHM 4411-001 * Credit Hours: 4 * Meeting Dates: Jan. 8 - Apr. 23, 2019 ** No Class Mar. 11-17 * Meeting Ti..." wikitext text/x-wiki '''<BIG>Physical Chemistry II</BIG>''' Course Info * Course Numbers CHM 4411-001 * Credit Hours: 4 * Meeting Dates: Jan. 8 - Apr. 23, 2019 ** No Class Mar. 11-17 * Meeting Times: Tues. and Thurs., 9:30-10:45 am in ISA 3048 ** Problem Sessions: Fri., 11am-12 pm in ISA 3050 ** Regular quizzes on Fridays ** Office Hours: Fri., 10-11 am in IDR 200 * Grading: ** Quiz (30%) *** To succeed in the quiz, complete the homework and study the topics covered in the previous week! ** Exam 1 (20%) Fri., Feb. 8 11am-12pm (ISA 3050) ** Exam 2 (20%) Fri., Mar. 8, 11am-12pm (ISA 3050) ** Final (30%) Thurs., May 2 7:30-9:30am (ISA 3048) == Overview and Objectives == This course will introduce you to quantum theory, important for quantitatively describing atomic and molecular structure, chemical bonding and spectra. Students in this course will demonstrate the ability to apply the following ideas: * Relationship between mathematical models and intermolecular forces. * Explaining quantum states and their mathematical and physical properties. * Connecting observed molecular properties with quantum measurements. * Calculation of quantum energy levels and spectra. == Textbooks == * McQuarrie and Simon, Physical Chemistry: A Molecular Approach, University Science Books, 1997. ISBN: 0935702997. == Assigned Homework Problems == fbfffb178c9657430e623d0402d59a200ca52755 704 703 2019-01-08T16:26:15Z David M. Rogers 2 wikitext text/x-wiki '''<BIG>Physical Chemistry II</BIG>''' Course Info * Course Numbers CHM 4411-001 * Credit Hours: 4 * Meeting Dates: Jan. 8 - Apr. 23, 2019 ** No Class Mar. 11-17 * Meeting Times: Tues. and Thurs., 9:30-10:45 am in ISA 3048 ** Problem Sessions: Fri., 11am-12 pm in ISA 3050 ** Regular quizzes on Fridays ** Office Hours: Fri., 10-11 am in IDR 200 * Grading: ** Quiz (30%) *** To succeed in the quiz, complete the homework and study the topics covered in the previous week! ** Exam 1 (20%) Fri., Feb. 8 11am-12pm (ISA 3050) ** Exam 2 (20%) Fri., Mar. 8, 11am-12pm (ISA 3050) ** Final (30%) Thurs., May 2 7:30-9:30am (ISA 3048) == Overview and Objectives == This course will introduce you to quantum theory, important for quantitatively describing atomic and molecular structure, chemical bonding and spectra. Students in this course will demonstrate the ability to apply the following ideas: * Relationship between mathematical models and intermolecular forces. * Explaining quantum states and their mathematical and physical properties. * Connecting observed molecular properties with quantum measurements. * Calculation of quantum energy levels and spectra. == Textbooks == * McQuarrie and Simon, Physical Chemistry: A Molecular Approach, University Science Books, 1997. ISBN: 0935702997. == Assigned Homework Problems == # Part 1: Origins (Ch. 1, A, and 2) #* Ch. 1, 1-40 (we'll do 41-44 in class) #* Ch. A, 1-14 #** Hint on 12: use i = exp(...) #* Ch. 2, 1-16, 19 #** Hint on 1,2, and 4: use y(x) = A exp(ax) + B exp(bx) and check #** Hint on 5: use exp(i omega t) = ... 7272223a130e9fc9bcc003e5e1a79dadeaa9c063 705 704 2019-01-12T00:20:36Z David M. Rogers 2 wikitext text/x-wiki '''<BIG>Physical Chemistry II</BIG>''' Course Info * Course Numbers CHM 4411-001 * Credit Hours: 4 * Meeting Dates: Jan. 8 - Apr. 23, 2019 ** No Class Mar. 11-17 * Meeting Times: Tues. and Thurs., 9:30-10:45 am in ISA 3048 ** Problem Sessions: Fri., 11am-12 pm in ISA 3050 ** Regular quizzes on Fridays ** Office Hours: Fri., 10-11 am in IDR 200 * Grading: ** Quiz (30%) *** To succeed in the quiz, complete the homework and study the topics covered in the previous week! ** Exam 1 (20%) Fri., Feb. 8 11am-12pm (ISA 3050) ** Exam 2 (20%) Fri., Mar. 8, 11am-12pm (ISA 3050) ** Final (30%) Thurs., May 2 7:30-9:30am (ISA 3048) == Overview and Objectives == This course will introduce you to quantum theory, important for quantitatively describing atomic and molecular structure, chemical bonding and spectra. Students in this course will demonstrate the ability to apply the following ideas: * Relationship between mathematical models and intermolecular forces. * Explaining quantum states and their mathematical and physical properties. * Connecting observed molecular properties with quantum measurements. * Calculation of quantum energy levels and spectra. == Textbooks == * McQuarrie and Simon, Physical Chemistry: A Molecular Approach, University Science Books, 1997. ISBN: 0935702997. == Resources == * Visualization of Modes: ** [https://www.youtube.com/watch?v=BE827gwnnk4 Wine Glass] ** [https://www.youtube.com/watch?v=v4ELxKKT5Rw&t=4s Drum Head] [https://youtu.be/QksHbCwYngw?t=5 see also] *** Note: Modes are indexed by 2 numbers for a 2D surface. ** [https://www.youtube.com/watch?v=Qf0t4qIVWF4 Another 2D example] *** This one is part-way between a particle in a 2D box and a circular drum, since the center is a special point. ** [https://www.youtube.com/watch?v=6JeyiM0YNo4 Violin String] *** Note: This looks like a sawtooth wave, so is less connected to quantum and more related to classical solitons. ** [https://youtu.be/0Ddr_ipAMqE?t=224 Cymbals] *** Note: This shows many modes excited at once, so it is not a simple shape. Quantum-mechanically, this situation is called a superposition. ** [https://www.youtube.com/watch?v=fMsjyQHtmiU Tacoma Narrows Bridge] *** Acoustic and vibrational modes are very important in mechanical structures. We will calculate them for atoms and optical cavities. == Assigned Homework Problems == # Part 1: Origins (Ch. 1, A, and 2) #* Ch. 1, 1-40 (we'll do 41-44 in class) #* Ch. A, 1-14 #** Hint on 12: use i = exp(...) #* Ch. 2, 1-16, 19 #** Hint on 1,2, and 4: use y(x) = A exp(ax) + B exp(b\x) and check #** Hint on 5: use exp(i omega t) = ... 6c596661c089daa0df1eae1bd20c5518b88cef8a 707 705 2019-01-14T19:48:38Z David M. Rogers 2 wikitext text/x-wiki '''<BIG>Physical Chemistry II</BIG>''' Course Info * Course Numbers CHM 4411-001 * Credit Hours: 4 * Meeting Dates: Jan. 8 - Apr. 23, 2019 ** No Class Mar. 11-17 * Meeting Times: Tues. and Thurs., 9:30-10:45 am in ISA 3048 ** Problem Sessions: Fri., 11am-12 pm in ISA 3050 ** Regular quizzes on Fridays ** Office Hours: Fri., 10-11 am in IDR 200 * Grading: ** Quiz (30%) *** To succeed in the quiz, complete the homework and study the topics covered in the previous week! ** Exam 1 (20%) Fri., Feb. 8 11am-12pm (ISA 3050) ** Exam 2 (20%) Fri., Mar. 8, 11am-12pm (ISA 3050) ** Final (30%) Thurs., May 2 7:30-9:30am (ISA 3048) == Overview and Objectives == This course will introduce you to quantum theory, important for quantitatively describing atomic and molecular structure, chemical bonding and spectra. Students in this course will demonstrate the ability to apply the following ideas: * Relationship between mathematical models and intermolecular forces. * Explaining quantum states and their mathematical and physical properties. * Connecting observed molecular properties with quantum measurements. * Calculation of quantum energy levels and spectra. == Textbooks == * McQuarrie and Simon, Physical Chemistry: A Molecular Approach, University Science Books, 1997. ISBN: 0935702997. == Resources == * Visualization of Modes: ** [https://www.youtube.com/watch?v=BE827gwnnk4 Wine Glass] ** [https://www.youtube.com/watch?v=v4ELxKKT5Rw&t=4s Drum Head] [https://youtu.be/QksHbCwYngw?t=5 see also] *** Note: Modes are indexed by 2 numbers for a 2D surface. ** [https://www.youtube.com/watch?v=Qf0t4qIVWF4 Another 2D example] *** This one is part-way between a particle in a 2D box and a circular drum, since the center is a special point. ** [https://www.youtube.com/watch?v=6JeyiM0YNo4 Violin String] *** Note: This looks like a sawtooth wave, so is less connected to quantum and more related to classical solitons. ** [https://youtu.be/0Ddr_ipAMqE?t=224 Cymbals] *** Note: This shows many modes excited at once, so it is not a simple shape. Quantum-mechanically, this situation is called a superposition. ** [https://www.youtube.com/watch?v=fMsjyQHtmiU Tacoma Narrows Bridge] *** Acoustic and vibrational modes are very important in mechanical structures. We will calculate them for atoms and optical cavities. * Fundamental Dogma of Spectroscopy, <math>|E_2 - E_1| = h\nu</math> ** Here is Henri Poincaré's [https://www.gutenberg.org/files/37157/37157-pdf.pdf Science and Hypothesis], 1905. <blockquote> [On finding atomic causes of laboratory observations,] I shall only give one example which has always struck me rather forcibly. If I decompose white light, I shall be able to isolate a portion of the spectrum, but however small it may be, it will always be a certain width. In the same way the natural lights which are called monochromatic give us a very fine ray, but one which is not, however, infinitely fine. It might be supposed that in the experimental study of the properties of these natural lights, by operating with finer and finer rays, and passing on at last to the limit, so to speak, we should eventually obtain the properties of a rigorously monochromatic light. That would not be accurate. I assume that two rays emanate from the same source, that they are first polarised in planes at right angles, that they are then brought back again to the same plane of polarisation, and that we try to obtain interference. If the light were rigorously monochromatic, there would be interference; but with our nearly monochromatic lights, there will be no interference, and that, however narrow the ray may be. For it to be otherwise, the ray would have to be several million times finer than the finest known rays. </blockquote> ** He is saying that sunlight and light from incandescent bulbs has a continuous spectrum of all frequencies. Light from atomic transitions (like a high-pressure sodium lamp) has discrete spectral lines, but those ''still'' have a tiny line-width and two independent polarizations. This was not understood before the fundamental dogma of spectroscopy. The line-width is due to the energy-time uncertainty principle. == Assigned Homework Problems == # Part 1: Origins (Ch. 1, A, and 2) #* Ch. 1, 1-40 (we'll do 41-44 in class) #* Ch. A, 1-14 #** Hint on 12: use i = exp(...) #* Ch. 2, 1-16, 19 #** Hint on 1,2, and 4: use y(x) = A exp(ax) + B exp(b\x) and check #** Hint on 5: use exp(i omega t) = ... f067fb641755fc50ca671ce2189a41c312ce8493 708 707 2019-01-14T20:06:02Z David M. Rogers 2 /* Resources */ wikitext text/x-wiki '''<BIG>Physical Chemistry II</BIG>''' Course Info * Course Numbers CHM 4411-001 * Credit Hours: 4 * Meeting Dates: Jan. 8 - Apr. 23, 2019 ** No Class Mar. 11-17 * Meeting Times: Tues. and Thurs., 9:30-10:45 am in ISA 3048 ** Problem Sessions: Fri., 11am-12 pm in ISA 3050 ** Regular quizzes on Fridays ** Office Hours: Fri., 10-11 am in IDR 200 * Grading: ** Quiz (30%) *** To succeed in the quiz, complete the homework and study the topics covered in the previous week! ** Exam 1 (20%) Fri., Feb. 8 11am-12pm (ISA 3050) ** Exam 2 (20%) Fri., Mar. 8, 11am-12pm (ISA 3050) ** Final (30%) Thurs., May 2 7:30-9:30am (ISA 3048) == Overview and Objectives == This course will introduce you to quantum theory, important for quantitatively describing atomic and molecular structure, chemical bonding and spectra. Students in this course will demonstrate the ability to apply the following ideas: * Relationship between mathematical models and intermolecular forces. * Explaining quantum states and their mathematical and physical properties. * Connecting observed molecular properties with quantum measurements. * Calculation of quantum energy levels and spectra. == Textbooks == * McQuarrie and Simon, Physical Chemistry: A Molecular Approach, University Science Books, 1997. ISBN: 0935702997. == Resources == * Visualization of Modes: ** [https://www.youtube.com/watch?v=BE827gwnnk4 Wine Glass] ** [https://www.youtube.com/watch?v=v4ELxKKT5Rw&t=4s Drum Head] [https://youtu.be/QksHbCwYngw?t=5 see also] *** Note: Modes are indexed by 2 numbers for a 2D surface. ** [https://www.youtube.com/watch?v=Qf0t4qIVWF4 Another 2D example] *** This one is part-way between a particle in a 2D box and a circular drum, since the center is a special point. ** [https://www.youtube.com/watch?v=6JeyiM0YNo4 Violin String] *** Note: This looks like a sawtooth wave, so is less connected to quantum and more related to classical solitons. ** [https://youtu.be/0Ddr_ipAMqE?t=224 Cymbals] *** Note: This shows many modes excited at once, so it is not a simple shape. Quantum-mechanically, this situation is called a superposition. ** [https://www.youtube.com/watch?v=fMsjyQHtmiU Tacoma Narrows Bridge] *** Acoustic and vibrational modes are very important in mechanical structures. We will calculate them for atoms and optical cavities. * Fundamental Dogma of Spectroscopy, <math>|E_2 - E_1| = h\nu</math> ** Here is Henri Poincaré's [https://www.gutenberg.org/files/37157/37157-pdf.pdf Science and Hypothesis], 1905. <blockquote> [On finding atomic causes of laboratory observations,] I shall only give one example which has always struck me rather forcibly. If I decompose white light, I shall be able to isolate a portion of the spectrum, but however small it may be, it will always be a certain width. In the same way the natural lights which are called monochromatic give us a very fine ray, but one which is not, however, infinitely fine. It might be supposed that in the experimental study of the properties of these natural lights, by operating with finer and finer rays, and passing on at last to the limit, so to speak, we should eventually obtain the properties of a rigorously monochromatic light. That would not be accurate. I assume that two rays emanate from the same source, that they are first polarised in planes at right angles, that they are then brought back again to the same plane of polarisation, and that we try to obtain interference. If the light were rigorously monochromatic, there would be interference; but with our nearly monochromatic lights, there will be no interference, and that, however narrow the ray may be. For it to be otherwise, the ray would have to be several million times finer than the finest known rays. </blockquote> ** He is saying that sunlight and light from incandescent bulbs has a continuous spectrum of all frequencies. Light from atomic transitions (like a high-pressure sodium lamp) has discrete spectral lines, but those ''still'' have a tiny line-width and two independent polarizations. This was not understood before the fundamental dogma of spectroscopy. The line-width is due to the energy-time uncertainty principle. * [Complex Algebra http://www.feynmanlectures.caltech.edu/I_22.html] * [Harmonic Resonance Phenomena http://www.feynmanlectures.caltech.edu/I_23.html] == Assigned Homework Problems == # Part 1: Origins (Ch. 1, A, and 2) #* Ch. 1, 1-40 (we'll do 41-44 in class) #* Ch. A, 1-14 #** Hint on 12: use i = exp(...) #* Ch. 2, 1-16, 19 #** Hint on 1,2, and 4: use y(x) = A exp(ax) + B exp(b\x) and check #** Hint on 5: use exp(i omega t) = ... 367d60fd5972b3cbe919a9c67ac99e5d190d6933 709 708 2019-01-14T20:07:03Z David M. Rogers 2 /* Resources */ wikitext text/x-wiki '''<BIG>Physical Chemistry II</BIG>''' Course Info * Course Numbers CHM 4411-001 * Credit Hours: 4 * Meeting Dates: Jan. 8 - Apr. 23, 2019 ** No Class Mar. 11-17 * Meeting Times: Tues. and Thurs., 9:30-10:45 am in ISA 3048 ** Problem Sessions: Fri., 11am-12 pm in ISA 3050 ** Regular quizzes on Fridays ** Office Hours: Fri., 10-11 am in IDR 200 * Grading: ** Quiz (30%) *** To succeed in the quiz, complete the homework and study the topics covered in the previous week! ** Exam 1 (20%) Fri., Feb. 8 11am-12pm (ISA 3050) ** Exam 2 (20%) Fri., Mar. 8, 11am-12pm (ISA 3050) ** Final (30%) Thurs., May 2 7:30-9:30am (ISA 3048) == Overview and Objectives == This course will introduce you to quantum theory, important for quantitatively describing atomic and molecular structure, chemical bonding and spectra. Students in this course will demonstrate the ability to apply the following ideas: * Relationship between mathematical models and intermolecular forces. * Explaining quantum states and their mathematical and physical properties. * Connecting observed molecular properties with quantum measurements. * Calculation of quantum energy levels and spectra. == Textbooks == * McQuarrie and Simon, Physical Chemistry: A Molecular Approach, University Science Books, 1997. ISBN: 0935702997. == Resources == * Visualization of Modes: ** [https://www.youtube.com/watch?v=BE827gwnnk4 Wine Glass] ** [https://www.youtube.com/watch?v=v4ELxKKT5Rw&t=4s Drum Head] [https://youtu.be/QksHbCwYngw?t=5 see also] *** Note: Modes are indexed by 2 numbers for a 2D surface. ** [https://www.youtube.com/watch?v=Qf0t4qIVWF4 Another 2D example] *** This one is part-way between a particle in a 2D box and a circular drum, since the center is a special point. ** [https://www.youtube.com/watch?v=6JeyiM0YNo4 Violin String] *** Note: This looks like a sawtooth wave, so is less connected to quantum and more related to classical solitons. ** [https://youtu.be/0Ddr_ipAMqE?t=224 Cymbals] *** Note: This shows many modes excited at once, so it is not a simple shape. Quantum-mechanically, this situation is called a superposition. ** [https://www.youtube.com/watch?v=fMsjyQHtmiU Tacoma Narrows Bridge] *** Acoustic and vibrational modes are very important in mechanical structures. We will calculate them for atoms and optical cavities. * Fundamental Dogma of Spectroscopy, <math>|E_2 - E_1| = h\nu</math> ** Here is Henri Poincaré's [https://www.gutenberg.org/files/37157/37157-pdf.pdf Science and Hypothesis], 1905. <blockquote> [On finding atomic causes of laboratory observations,] I shall only give one example which has always struck me rather forcibly. If I decompose white light, I shall be able to isolate a portion of the spectrum, but however small it may be, it will always be a certain width. In the same way the natural lights which are called monochromatic give us a very fine ray, but one which is not, however, infinitely fine. It might be supposed that in the experimental study of the properties of these natural lights, by operating with finer and finer rays, and passing on at last to the limit, so to speak, we should eventually obtain the properties of a rigorously monochromatic light. That would not be accurate. I assume that two rays emanate from the same source, that they are first polarised in planes at right angles, that they are then brought back again to the same plane of polarisation, and that we try to obtain interference. If the light were rigorously monochromatic, there would be interference; but with our nearly monochromatic lights, there will be no interference, and that, however narrow the ray may be. For it to be otherwise, the ray would have to be several million times finer than the finest known rays. </blockquote> ** He is saying that sunlight and light from incandescent bulbs has a continuous spectrum of all frequencies. Light from atomic transitions (like a high-pressure sodium lamp) has discrete spectral lines, but those ''still'' have a tiny line-width and two independent polarizations. This was not understood before the fundamental dogma of spectroscopy. The line-width is due to the energy-time uncertainty principle. * [http://www.feynmanlectures.caltech.edu/I_22.html Complex Algebra] * [http://www.feynmanlectures.caltech.edu/I_23.html Damped, Driven Harmonic Oscillator] == Assigned Homework Problems == # Part 1: Origins (Ch. 1, A, and 2) #* Ch. 1, 1-40 (we'll do 41-44 in class) #* Ch. A, 1-14 #** Hint on 12: use i = exp(...) #* Ch. 2, 1-16, 19 #** Hint on 1,2, and 4: use y(x) = A exp(ax) + B exp(b\x) and check #** Hint on 5: use exp(i omega t) = ... 129c8a4b704ff127b1a5ac62e65d8ee750fa50b8 710 709 2019-01-31T20:36:01Z David M. Rogers 2 wikitext text/x-wiki '''<BIG>Physical Chemistry II</BIG>''' Course Info * Course Numbers CHM 4411-001 * Credit Hours: 4 * Meeting Dates: Jan. 8 - Apr. 23, 2019 ** No Class Mar. 11-17 * Meeting Times: Tues. and Thurs., 9:30-10:45 am in ISA 3048 ** Problem Sessions: Fri., 11am-12 pm in ISA 3050 ** Regular quizzes on Fridays ** Office Hours: Fri., 10-11 am in IDR 200 * Grading: ** Quiz (30%) *** To succeed in the quiz, complete the homework and study the topics covered in the previous week! ** Exam 1 (20%) Fri., Feb. 8 11am-12pm (ISA 3050) ** Exam 2 (20%) Fri., Mar. 8, 11am-12pm (ISA 3050) ** Final (30%) Thurs., May 2 7:30-9:30am (ISA 3048) == Overview and Objectives == This course will introduce you to quantum theory, important for quantitatively describing atomic and molecular structure, chemical bonding and spectra. Students in this course will demonstrate the ability to apply the following ideas: * Relationship between mathematical models and intermolecular forces. * Explaining quantum states and their mathematical and physical properties. * Connecting observed molecular properties with quantum measurements. * Calculation of quantum energy levels and spectra. == Textbooks == * McQuarrie and Simon, Physical Chemistry: A Molecular Approach, University Science Books, 1997. ISBN: 0935702997. * Optional Extras: ** [https://dx.doi.org/10.1093/acprof:oso/9780198509141.001.0001 Exploring the Quantum: Atoms, Cavities, and Photons] ** [http://www.feynmanlectures.caltech.edu/I_22.html Complex Algebra] ** [http://www.feynmanlectures.caltech.edu/I_23.html Damped, Driven Harmonic Oscillator] == Resources == * Visualization of Modes: ** [https://www.youtube.com/watch?v=BE827gwnnk4 Wine Glass] ** [https://www.youtube.com/watch?v=v4ELxKKT5Rw&t=4s Drum Head] [https://youtu.be/QksHbCwYngw?t=5 see also] *** Note: Modes are indexed by 2 numbers for a 2D surface. ** [https://www.youtube.com/watch?v=Qf0t4qIVWF4 Another 2D example] *** This one is part-way between a particle in a 2D box and a circular drum, since the center is a special point. ** [https://www.youtube.com/watch?v=6JeyiM0YNo4 Violin String] *** Note: This looks like a sawtooth wave, so is less connected to quantum and more related to classical solitons. ** [https://youtu.be/0Ddr_ipAMqE?t=224 Cymbals] *** Note: This shows many modes excited at once, so it is not a simple shape. Quantum-mechanically, this situation is called a superposition. ** [https://www.youtube.com/watch?v=fMsjyQHtmiU Tacoma Narrows Bridge] *** Acoustic and vibrational modes are very important in mechanical structures. We will calculate them for atoms and optical cavities. * [https://www.youtube.com/watch?v=RXPlHa5mRBE Audio in general] * Fundamental Dogma of Spectroscopy, <math>|E_2 - E_1| = h\nu</math> ** Here is Henri Poincaré's [https://www.gutenberg.org/files/37157/37157-pdf.pdf Science and Hypothesis], 1905. <blockquote> [On finding atomic causes of laboratory observations,] I shall only give one example which has always struck me rather forcibly. If I decompose white light, I shall be able to isolate a portion of the spectrum, but however small it may be, it will always be a certain width. In the same way the natural lights which are called monochromatic give us a very fine ray, but one which is not, however, infinitely fine. It might be supposed that in the experimental study of the properties of these natural lights, by operating with finer and finer rays, and passing on at last to the limit, so to speak, we should eventually obtain the properties of a rigorously monochromatic light. That would not be accurate. I assume that two rays emanate from the same source, that they are first polarised in planes at right angles, that they are then brought back again to the same plane of polarisation, and that we try to obtain interference. If the light were rigorously monochromatic, there would be interference; but with our nearly monochromatic lights, there will be no interference, and that, however narrow the ray may be. For it to be otherwise, the ray would have to be several million times finer than the finest known rays. </blockquote> ** He is saying that sunlight and light from incandescent bulbs has a continuous spectrum of all frequencies. Light from atomic transitions (like a high-pressure sodium lamp) has discrete spectral lines, but those ''still'' have a tiny line-width and two independent polarizations. This was not understood before the fundamental dogma of spectroscopy. The line-width is due to the energy-time uncertainty principle. == Assigned Homework Problems == # Part 1: Origins (Ch. 1, A, and 2) #* Ch. 1, 1-40 (we'll do 41-44 in class) #* Ch. A, 1-14 #** Hint on 12: use i = exp(...) #* Ch. 2, 1-16, 19 #** Hint on 1,2, and 4: use y(x) = A exp(ax) + B exp(b\x) and check #** Hint on 5: use exp(i omega t) = ... #* Ch. 3, 1-19,24,25,28,29,30,32,35 b1954d2b8e710dec9c3aabca4741c3a952d7f288 Quotes 0 160 706 2019-01-14T19:34:11Z David M. Rogers 2 Created page with " <blockquote> The day will perhaps come when physicists will no longer concern themselves with questions which are inaccessible to positive methods, and will leave them to the..." wikitext text/x-wiki <blockquote> The day will perhaps come when physicists will no longer concern themselves with questions which are inaccessible to positive methods, and will leave them to the metaphysicians. That day has not yet come; man does not so easily resign himself to remaining for ever ignorant of the causes of things. Henri Poincaré, Science and Hypothesis, p. 249 (1905) </blockquote> df8a1d04339861b571e55259daab373f5cfb7f1a Courses/PChemSpring2019 0 159 711 710 2019-01-31T21:10:52Z David M. Rogers 2 wikitext text/x-wiki '''<BIG>Physical Chemistry II</BIG>''' Course Info * Course Numbers CHM 4411-001 * Credit Hours: 4 * Meeting Dates: Jan. 8 - Apr. 23, 2019 ** No Class Mar. 11-17 * Meeting Times: Tues. and Thurs., 9:30-10:45 am in ISA 3048 ** Problem Sessions: Fri., 11am-12 pm in ISA 3050 ** Regular quizzes on Fridays ** Office Hours: Fri., 10-11 am in IDR 200 * Grading: ** Quiz (30%) *** To succeed in the quiz, complete the homework and study the topics covered in the previous week! ** Exam 1 (20%) Fri., Feb. 8 11am-12pm (ISA 3050) ** Exam 2 (20%) Fri., Mar. 8, 11am-12pm (ISA 3050) ** Final (30%) Thurs., May 2 7:30-9:30am (ISA 3048) == Overview and Objectives == This course will introduce you to quantum theory, important for quantitatively describing atomic and molecular structure, chemical bonding and spectra. Students in this course will demonstrate the ability to apply the following ideas: * Relationship between mathematical models and intermolecular forces. * Explaining quantum states and their mathematical and physical properties. * Connecting observed molecular properties with quantum measurements. * Calculation of quantum energy levels and spectra. == Textbooks == * McQuarrie and Simon, Physical Chemistry: A Molecular Approach, University Science Books, 1997. ISBN: 0935702997. * Optional Extras: ** [http://www.feynmanlectures.caltech.edu/I_22.html Complex Algebra] ** [http://www.feynmanlectures.caltech.edu/I_23.html Damped, Driven Harmonic Oscillator] * Quantum Advances Nobel Prize Lectures ** [https://www.nobelprize.org/prizes/chemistry/2013/karplus/facts/ Karplus, Levitt and Warshel, 2013] ** [https://www.nobelprize.org/prizes/physics/2012/haroche/facts/ Haroche and Wineland, 2012] ** [https://www.nobelprize.org/prizes/physics/2005/hall/facts/ Glauber, Hall, and Hänsch, 2005] ** [https://www.nobelprize.org/prizes/chemistry/1998/kohn/facts/ Kohn and Pople, 1998] ** [https://www.nobelprize.org/prizes/chemistry/1992/marcus/facts/ Rudolph Marcus, 1992] ** [https://www.nobelprize.org/prizes/chemistry/1991/ernst/facts/ Richard Ernst, 1991] ** [https://www.nobelprize.org/prizes/physics/1954/born/facts/ Born and Bothe, 1954] ** [https://www.nobelprize.org/prizes/physics/1952/bloch/biographical/ Bloch and Purcell, 1952] ** [https://www.nobelprize.org/prizes/physics/1945/pauli/facts/ Wolfgang Pauli, 1945] ** [https://www.nobelprize.org/prizes/physics/1933/schrodinger/facts/ Schrödinger and Dirac, 1933] ** [https://www.nobelprize.org/prizes/physics/1932/heisenberg/facts/ Werner Heisenberg, 1932] ** [https://www.nobelprize.org/prizes/physics/1921/einstein/facts/ Albert Einstein, 1921] ** [https://www.nobelprize.org/prizes/physics/1918/planck/facts/ Max Planck, 1918] * Advanced reading: ** [https://dx.doi.org/10.1093/acprof:oso/9780198509141.001.0001 Exploring the Quantum: Atoms, Cavities, and Photons] (Haroche and Raimond's book) * Super-advanced reading: ** [https://doi.org/10.1017/9781316995457 Collapse of The Wave Function] == Resources == * Visualization of Modes: ** [https://www.youtube.com/watch?v=BE827gwnnk4 Wine Glass] ** [https://www.youtube.com/watch?v=v4ELxKKT5Rw&t=4s Drum Head] [https://youtu.be/QksHbCwYngw?t=5 see also] *** Note: Modes are indexed by 2 numbers for a 2D surface. ** [https://www.youtube.com/watch?v=Qf0t4qIVWF4 Another 2D example] *** This one is part-way between a particle in a 2D box and a circular drum, since the center is a special point. ** [https://www.youtube.com/watch?v=6JeyiM0YNo4 Violin String] *** Note: This looks like a sawtooth wave, so is less connected to quantum and more related to classical solitons. ** [https://youtu.be/0Ddr_ipAMqE?t=224 Cymbals] *** Note: This shows many modes excited at once, so it is not a simple shape. Quantum-mechanically, this situation is called a superposition. ** [https://www.youtube.com/watch?v=fMsjyQHtmiU Tacoma Narrows Bridge] *** Acoustic and vibrational modes are very important in mechanical structures. We will calculate them for atoms and optical cavities. * [https://www.youtube.com/watch?v=RXPlHa5mRBE Audio in general] * Fundamental Dogma of Spectroscopy, <math>|E_2 - E_1| = h\nu</math> ** Here is Henri Poincaré's [https://www.gutenberg.org/files/37157/37157-pdf.pdf Science and Hypothesis], 1905. <blockquote> [On finding atomic causes of laboratory observations,] I shall only give one example which has always struck me rather forcibly. If I decompose white light, I shall be able to isolate a portion of the spectrum, but however small it may be, it will always be a certain width. In the same way the natural lights which are called monochromatic give us a very fine ray, but one which is not, however, infinitely fine. It might be supposed that in the experimental study of the properties of these natural lights, by operating with finer and finer rays, and passing on at last to the limit, so to speak, we should eventually obtain the properties of a rigorously monochromatic light. That would not be accurate. I assume that two rays emanate from the same source, that they are first polarised in planes at right angles, that they are then brought back again to the same plane of polarisation, and that we try to obtain interference. If the light were rigorously monochromatic, there would be interference; but with our nearly monochromatic lights, there will be no interference, and that, however narrow the ray may be. For it to be otherwise, the ray would have to be several million times finer than the finest known rays. </blockquote> ** He is saying that sunlight and light from incandescent bulbs has a continuous spectrum of all frequencies. Light from atomic transitions (like a high-pressure sodium lamp) has discrete spectral lines, but those ''still'' have a tiny line-width and two independent polarizations. This was not understood before the fundamental dogma of spectroscopy. The line-width is due to the energy-time uncertainty principle. == Assigned Homework Problems == # Part 1: Origins (Ch. 1, A, and 2) #* Ch. 1, 1-40 (we'll do 41-44 in class) #* Ch. A, 1-14 #** Hint on 12: use i = exp(...) #* Ch. 2, 1-16, 19 #** Hint on 1,2, and 4: use y(x) = A exp(ax) + B exp(b\x) and check #** Hint on 5: use exp(i omega t) = ... #* Ch. 3, 1-19,24,25,28,29,30,32,35 396da5549f62622d092b129e3739c11ab21c97bc 712 711 2019-02-12T16:04:21Z David M. Rogers 2 wikitext text/x-wiki '''<BIG>Physical Chemistry II</BIG>''' Course Info * Course Numbers CHM 4411-001 * Credit Hours: 4 * Meeting Dates: Jan. 8 - Apr. 23, 2019 ** No Class Mar. 11-17 * Meeting Times: Tues. and Thurs., 9:30-10:45 am in ISA 3048 ** Problem Sessions: Fri., 11am-12 pm in ISA 3050 ** Regular quizzes on Fridays ** Office Hours: Fri., 10-11 am in IDR 200 * Grading: ** Quiz (30%) *** To succeed in the quiz, complete the homework and study the topics covered in the previous week! ** Exam 1 (20%) Fri., Feb. 8 11am-12pm (ISA 3050) ** Exam 2 (20%) Fri., Mar. 8, 11am-12pm (ISA 3050) ** Final (30%) Thurs., May 2 7:30-9:30am (ISA 3048) == Overview and Objectives == This course will introduce you to quantum theory, important for quantitatively describing atomic and molecular structure, chemical bonding and spectra. Students in this course will demonstrate the ability to apply the following ideas: * Relationship between mathematical models and intermolecular forces. * Explaining quantum states and their mathematical and physical properties. * Connecting observed molecular properties with quantum measurements. * Calculation of quantum energy levels and spectra. == Textbooks == * McQuarrie and Simon, Physical Chemistry: A Molecular Approach, University Science Books, 1997. ISBN: 0935702997. * Optional Extras: ** [http://www.feynmanlectures.caltech.edu/I_22.html Complex Algebra] ** [http://www.feynmanlectures.caltech.edu/I_23.html Damped, Driven Harmonic Oscillator] * Quantum Advances Nobel Prize Lectures ** [https://www.nobelprize.org/prizes/chemistry/2013/karplus/facts/ Karplus, Levitt and Warshel, 2013] ** [https://www.nobelprize.org/prizes/physics/2012/haroche/facts/ Haroche and Wineland, 2012] ** [https://www.nobelprize.org/prizes/physics/2005/hall/facts/ Glauber, Hall, and Hänsch, 2005] ** [https://www.nobelprize.org/prizes/chemistry/1998/kohn/facts/ Kohn and Pople, 1998] ** [https://www.nobelprize.org/prizes/chemistry/1992/marcus/facts/ Rudolph Marcus, 1992] ** [https://www.nobelprize.org/prizes/chemistry/1991/ernst/facts/ Richard Ernst, 1991] ** [https://www.nobelprize.org/prizes/physics/1954/born/facts/ Born and Bothe, 1954] ** [https://www.nobelprize.org/prizes/physics/1952/bloch/biographical/ Bloch and Purcell, 1952] ** [https://www.nobelprize.org/prizes/physics/1945/pauli/facts/ Wolfgang Pauli, 1945] ** [https://www.nobelprize.org/prizes/physics/1933/schrodinger/facts/ Schrödinger and Dirac, 1933] ** [https://www.nobelprize.org/prizes/physics/1932/heisenberg/facts/ Werner Heisenberg, 1932] ** [https://www.nobelprize.org/prizes/physics/1921/einstein/facts/ Albert Einstein, 1921] ** [https://www.nobelprize.org/prizes/physics/1918/planck/facts/ Max Planck, 1918] * Advanced reading: ** [https://dx.doi.org/10.1093/acprof:oso/9780198509141.001.0001 Exploring the Quantum: Atoms, Cavities, and Photons] (Haroche and Raimond's book) * Super-advanced reading: ** [https://doi.org/10.1017/9781316995457 Collapse of The Wave Function] == Resources == * Visualization of Modes: ** [https://www.youtube.com/watch?v=BE827gwnnk4 Wine Glass] ** [https://www.youtube.com/watch?v=v4ELxKKT5Rw&t=4s Drum Head] [https://youtu.be/QksHbCwYngw?t=5 see also] *** Note: Modes are indexed by 2 numbers for a 2D surface. ** [https://www.youtube.com/watch?v=Qf0t4qIVWF4 Another 2D example] *** This one is part-way between a particle in a 2D box and a circular drum, since the center is a special point. ** [https://www.youtube.com/watch?v=6JeyiM0YNo4 Violin String] *** Note: This looks like a sawtooth wave, so is less connected to quantum and more related to classical solitons. ** [https://youtu.be/0Ddr_ipAMqE?t=224 Cymbals] *** Note: This shows many modes excited at once, so it is not a simple shape. Quantum-mechanically, this situation is called a superposition. ** [https://www.youtube.com/watch?v=fMsjyQHtmiU Tacoma Narrows Bridge] *** Acoustic and vibrational modes are very important in mechanical structures. We will calculate them for atoms and optical cavities. * [https://www.youtube.com/watch?v=RXPlHa5mRBE Audio in general] * Fundamental Dogma of Spectroscopy, <math>|E_2 - E_1| = h\nu</math> ** Here is Henri Poincaré's [https://www.gutenberg.org/files/37157/37157-pdf.pdf Science and Hypothesis], 1905. <blockquote> [On finding atomic causes of laboratory observations,] I shall only give one example which has always struck me rather forcibly. If I decompose white light, I shall be able to isolate a portion of the spectrum, but however small it may be, it will always be a certain width. In the same way the natural lights which are called monochromatic give us a very fine ray, but one which is not, however, infinitely fine. It might be supposed that in the experimental study of the properties of these natural lights, by operating with finer and finer rays, and passing on at last to the limit, so to speak, we should eventually obtain the properties of a rigorously monochromatic light. That would not be accurate. I assume that two rays emanate from the same source, that they are first polarised in planes at right angles, that they are then brought back again to the same plane of polarisation, and that we try to obtain interference. If the light were rigorously monochromatic, there would be interference; but with our nearly monochromatic lights, there will be no interference, and that, however narrow the ray may be. For it to be otherwise, the ray would have to be several million times finer than the finest known rays. </blockquote> ** He is saying that sunlight and light from incandescent bulbs has a continuous spectrum of all frequencies. Light from atomic transitions (like a high-pressure sodium lamp) has discrete spectral lines, but those ''still'' have a tiny line-width and two independent polarizations. This was not understood before the fundamental dogma of spectroscopy. The line-width is due to the energy-time uncertainty principle. == Assigned Homework Problems == # Part 1: Origins (Ch. 1, A, and 2) #* Ch. 1, 1-40 (we'll do 41-44 in class) #* Ch. A, 1-14 #** Hint on 12: use i = exp(...) #* Ch. 2, 1-16, 19 #** Hint on 1,2, and 4: use y(x) = A exp(ax) + B exp(b\x) and check #** Hint on 5: use exp(i omega t) = ... #* Ch. 3, 1-19,24,25,28,29,30,32,35 #* Ch. C, all problems except 10; Ch. E, prob. 7; and Ch. F, prob. 1-2,7,11 #** We will only multiply and take determinants of 2x2 matrices in this class, but adding larger matrices should be simple. cf8fe6aaa3451fb4a79b8065dd16638f43a621ca 713 712 2019-02-12T16:12:24Z David M. Rogers 2 /* Assigned Homework Problems */ wikitext text/x-wiki '''<BIG>Physical Chemistry II</BIG>''' Course Info * Course Numbers CHM 4411-001 * Credit Hours: 4 * Meeting Dates: Jan. 8 - Apr. 23, 2019 ** No Class Mar. 11-17 * Meeting Times: Tues. and Thurs., 9:30-10:45 am in ISA 3048 ** Problem Sessions: Fri., 11am-12 pm in ISA 3050 ** Regular quizzes on Fridays ** Office Hours: Fri., 10-11 am in IDR 200 * Grading: ** Quiz (30%) *** To succeed in the quiz, complete the homework and study the topics covered in the previous week! ** Exam 1 (20%) Fri., Feb. 8 11am-12pm (ISA 3050) ** Exam 2 (20%) Fri., Mar. 8, 11am-12pm (ISA 3050) ** Final (30%) Thurs., May 2 7:30-9:30am (ISA 3048) == Overview and Objectives == This course will introduce you to quantum theory, important for quantitatively describing atomic and molecular structure, chemical bonding and spectra. Students in this course will demonstrate the ability to apply the following ideas: * Relationship between mathematical models and intermolecular forces. * Explaining quantum states and their mathematical and physical properties. * Connecting observed molecular properties with quantum measurements. * Calculation of quantum energy levels and spectra. == Textbooks == * McQuarrie and Simon, Physical Chemistry: A Molecular Approach, University Science Books, 1997. ISBN: 0935702997. * Optional Extras: ** [http://www.feynmanlectures.caltech.edu/I_22.html Complex Algebra] ** [http://www.feynmanlectures.caltech.edu/I_23.html Damped, Driven Harmonic Oscillator] * Quantum Advances Nobel Prize Lectures ** [https://www.nobelprize.org/prizes/chemistry/2013/karplus/facts/ Karplus, Levitt and Warshel, 2013] ** [https://www.nobelprize.org/prizes/physics/2012/haroche/facts/ Haroche and Wineland, 2012] ** [https://www.nobelprize.org/prizes/physics/2005/hall/facts/ Glauber, Hall, and Hänsch, 2005] ** [https://www.nobelprize.org/prizes/chemistry/1998/kohn/facts/ Kohn and Pople, 1998] ** [https://www.nobelprize.org/prizes/chemistry/1992/marcus/facts/ Rudolph Marcus, 1992] ** [https://www.nobelprize.org/prizes/chemistry/1991/ernst/facts/ Richard Ernst, 1991] ** [https://www.nobelprize.org/prizes/physics/1954/born/facts/ Born and Bothe, 1954] ** [https://www.nobelprize.org/prizes/physics/1952/bloch/biographical/ Bloch and Purcell, 1952] ** [https://www.nobelprize.org/prizes/physics/1945/pauli/facts/ Wolfgang Pauli, 1945] ** [https://www.nobelprize.org/prizes/physics/1933/schrodinger/facts/ Schrödinger and Dirac, 1933] ** [https://www.nobelprize.org/prizes/physics/1932/heisenberg/facts/ Werner Heisenberg, 1932] ** [https://www.nobelprize.org/prizes/physics/1921/einstein/facts/ Albert Einstein, 1921] ** [https://www.nobelprize.org/prizes/physics/1918/planck/facts/ Max Planck, 1918] * Advanced reading: ** [https://dx.doi.org/10.1093/acprof:oso/9780198509141.001.0001 Exploring the Quantum: Atoms, Cavities, and Photons] (Haroche and Raimond's book) * Super-advanced reading: ** [https://doi.org/10.1017/9781316995457 Collapse of The Wave Function] == Resources == * Visualization of Modes: ** [https://www.youtube.com/watch?v=BE827gwnnk4 Wine Glass] ** [https://www.youtube.com/watch?v=v4ELxKKT5Rw&t=4s Drum Head] [https://youtu.be/QksHbCwYngw?t=5 see also] *** Note: Modes are indexed by 2 numbers for a 2D surface. ** [https://www.youtube.com/watch?v=Qf0t4qIVWF4 Another 2D example] *** This one is part-way between a particle in a 2D box and a circular drum, since the center is a special point. ** [https://www.youtube.com/watch?v=6JeyiM0YNo4 Violin String] *** Note: This looks like a sawtooth wave, so is less connected to quantum and more related to classical solitons. ** [https://youtu.be/0Ddr_ipAMqE?t=224 Cymbals] *** Note: This shows many modes excited at once, so it is not a simple shape. Quantum-mechanically, this situation is called a superposition. ** [https://www.youtube.com/watch?v=fMsjyQHtmiU Tacoma Narrows Bridge] *** Acoustic and vibrational modes are very important in mechanical structures. We will calculate them for atoms and optical cavities. * [https://www.youtube.com/watch?v=RXPlHa5mRBE Audio in general] * Fundamental Dogma of Spectroscopy, <math>|E_2 - E_1| = h\nu</math> ** Here is Henri Poincaré's [https://www.gutenberg.org/files/37157/37157-pdf.pdf Science and Hypothesis], 1905. <blockquote> [On finding atomic causes of laboratory observations,] I shall only give one example which has always struck me rather forcibly. If I decompose white light, I shall be able to isolate a portion of the spectrum, but however small it may be, it will always be a certain width. In the same way the natural lights which are called monochromatic give us a very fine ray, but one which is not, however, infinitely fine. It might be supposed that in the experimental study of the properties of these natural lights, by operating with finer and finer rays, and passing on at last to the limit, so to speak, we should eventually obtain the properties of a rigorously monochromatic light. That would not be accurate. I assume that two rays emanate from the same source, that they are first polarised in planes at right angles, that they are then brought back again to the same plane of polarisation, and that we try to obtain interference. If the light were rigorously monochromatic, there would be interference; but with our nearly monochromatic lights, there will be no interference, and that, however narrow the ray may be. For it to be otherwise, the ray would have to be several million times finer than the finest known rays. </blockquote> ** He is saying that sunlight and light from incandescent bulbs has a continuous spectrum of all frequencies. Light from atomic transitions (like a high-pressure sodium lamp) has discrete spectral lines, but those ''still'' have a tiny line-width and two independent polarizations. This was not understood before the fundamental dogma of spectroscopy. The line-width is due to the energy-time uncertainty principle. == Assigned Homework Problems == # Part 1: Origins (Ch. 1, A, and 2) #* Ch. 1, 1-40 (we'll do 41-44 in class) #* Ch. A, 1-14 #** Hint on 12: use i = exp(...) #* Ch. 2, 1-16, 19 #** Hint on 1,2, and 4: use y(x) = A exp(ax) + B exp(b x) and check #** Hint on 5: use exp(i omega t) = ... #* Ch. 3, 1-19,24,25,28,29,30,32,35 #* Ch. C, all problems except 10; Ch. E, prob. 7; and Ch. F, prob. 1-2,7,11 #** We will only multiply and take determinants of 2x2 matrices in this class, but adding larger matrices should be simple. 4886d0900cbc308dee5eeb45e55b436f065cbe88 714 713 2019-02-15T19:49:13Z David M. Rogers 2 /* Assigned Homework Problems */ wikitext text/x-wiki '''<BIG>Physical Chemistry II</BIG>''' Course Info * Course Numbers CHM 4411-001 * Credit Hours: 4 * Meeting Dates: Jan. 8 - Apr. 23, 2019 ** No Class Mar. 11-17 * Meeting Times: Tues. and Thurs., 9:30-10:45 am in ISA 3048 ** Problem Sessions: Fri., 11am-12 pm in ISA 3050 ** Regular quizzes on Fridays ** Office Hours: Fri., 10-11 am in IDR 200 * Grading: ** Quiz (30%) *** To succeed in the quiz, complete the homework and study the topics covered in the previous week! ** Exam 1 (20%) Fri., Feb. 8 11am-12pm (ISA 3050) ** Exam 2 (20%) Fri., Mar. 8, 11am-12pm (ISA 3050) ** Final (30%) Thurs., May 2 7:30-9:30am (ISA 3048) == Overview and Objectives == This course will introduce you to quantum theory, important for quantitatively describing atomic and molecular structure, chemical bonding and spectra. Students in this course will demonstrate the ability to apply the following ideas: * Relationship between mathematical models and intermolecular forces. * Explaining quantum states and their mathematical and physical properties. * Connecting observed molecular properties with quantum measurements. * Calculation of quantum energy levels and spectra. == Textbooks == * McQuarrie and Simon, Physical Chemistry: A Molecular Approach, University Science Books, 1997. ISBN: 0935702997. * Optional Extras: ** [http://www.feynmanlectures.caltech.edu/I_22.html Complex Algebra] ** [http://www.feynmanlectures.caltech.edu/I_23.html Damped, Driven Harmonic Oscillator] * Quantum Advances Nobel Prize Lectures ** [https://www.nobelprize.org/prizes/chemistry/2013/karplus/facts/ Karplus, Levitt and Warshel, 2013] ** [https://www.nobelprize.org/prizes/physics/2012/haroche/facts/ Haroche and Wineland, 2012] ** [https://www.nobelprize.org/prizes/physics/2005/hall/facts/ Glauber, Hall, and Hänsch, 2005] ** [https://www.nobelprize.org/prizes/chemistry/1998/kohn/facts/ Kohn and Pople, 1998] ** [https://www.nobelprize.org/prizes/chemistry/1992/marcus/facts/ Rudolph Marcus, 1992] ** [https://www.nobelprize.org/prizes/chemistry/1991/ernst/facts/ Richard Ernst, 1991] ** [https://www.nobelprize.org/prizes/physics/1954/born/facts/ Born and Bothe, 1954] ** [https://www.nobelprize.org/prizes/physics/1952/bloch/biographical/ Bloch and Purcell, 1952] ** [https://www.nobelprize.org/prizes/physics/1945/pauli/facts/ Wolfgang Pauli, 1945] ** [https://www.nobelprize.org/prizes/physics/1933/schrodinger/facts/ Schrödinger and Dirac, 1933] ** [https://www.nobelprize.org/prizes/physics/1932/heisenberg/facts/ Werner Heisenberg, 1932] ** [https://www.nobelprize.org/prizes/physics/1921/einstein/facts/ Albert Einstein, 1921] ** [https://www.nobelprize.org/prizes/physics/1918/planck/facts/ Max Planck, 1918] * Advanced reading: ** [https://dx.doi.org/10.1093/acprof:oso/9780198509141.001.0001 Exploring the Quantum: Atoms, Cavities, and Photons] (Haroche and Raimond's book) * Super-advanced reading: ** [https://doi.org/10.1017/9781316995457 Collapse of The Wave Function] == Resources == * Visualization of Modes: ** [https://www.youtube.com/watch?v=BE827gwnnk4 Wine Glass] ** [https://www.youtube.com/watch?v=v4ELxKKT5Rw&t=4s Drum Head] [https://youtu.be/QksHbCwYngw?t=5 see also] *** Note: Modes are indexed by 2 numbers for a 2D surface. ** [https://www.youtube.com/watch?v=Qf0t4qIVWF4 Another 2D example] *** This one is part-way between a particle in a 2D box and a circular drum, since the center is a special point. ** [https://www.youtube.com/watch?v=6JeyiM0YNo4 Violin String] *** Note: This looks like a sawtooth wave, so is less connected to quantum and more related to classical solitons. ** [https://youtu.be/0Ddr_ipAMqE?t=224 Cymbals] *** Note: This shows many modes excited at once, so it is not a simple shape. Quantum-mechanically, this situation is called a superposition. ** [https://www.youtube.com/watch?v=fMsjyQHtmiU Tacoma Narrows Bridge] *** Acoustic and vibrational modes are very important in mechanical structures. We will calculate them for atoms and optical cavities. * [https://www.youtube.com/watch?v=RXPlHa5mRBE Audio in general] * Fundamental Dogma of Spectroscopy, <math>|E_2 - E_1| = h\nu</math> ** Here is Henri Poincaré's [https://www.gutenberg.org/files/37157/37157-pdf.pdf Science and Hypothesis], 1905. <blockquote> [On finding atomic causes of laboratory observations,] I shall only give one example which has always struck me rather forcibly. If I decompose white light, I shall be able to isolate a portion of the spectrum, but however small it may be, it will always be a certain width. In the same way the natural lights which are called monochromatic give us a very fine ray, but one which is not, however, infinitely fine. It might be supposed that in the experimental study of the properties of these natural lights, by operating with finer and finer rays, and passing on at last to the limit, so to speak, we should eventually obtain the properties of a rigorously monochromatic light. That would not be accurate. I assume that two rays emanate from the same source, that they are first polarised in planes at right angles, that they are then brought back again to the same plane of polarisation, and that we try to obtain interference. If the light were rigorously monochromatic, there would be interference; but with our nearly monochromatic lights, there will be no interference, and that, however narrow the ray may be. For it to be otherwise, the ray would have to be several million times finer than the finest known rays. </blockquote> ** He is saying that sunlight and light from incandescent bulbs has a continuous spectrum of all frequencies. Light from atomic transitions (like a high-pressure sodium lamp) has discrete spectral lines, but those ''still'' have a tiny line-width and two independent polarizations. This was not understood before the fundamental dogma of spectroscopy. The line-width is due to the energy-time uncertainty principle. == Assigned Homework Problems == # Part 1: Origins (Ch. 1, A, and 2) #* Ch. 1, 1-40 (we'll do 41-44 in class) #* Ch. A, 1-14 #** Hint on 12: use i = exp(...) #* Ch. 2, 1-16, 19 #** Hint on 1,2, and 4: use y(x) = A exp(ax) + B exp(b x) and check #** Hint on 5: use exp(i omega t) = ... #* Ch. 3, 1-19,24,25,28,29,30,32,35 #* Ch. C, all problems except 10; Ch. E, prob. 7; and Ch. F, prob. 1-2,7,11 #** We will only multiply and take determinants of 2x2 matrices in this class, but adding larger matrices should be simple. === Special Assignment for Quiz 4 === {| class="wikitable" |- | <math> f_1(x) = e^{ikx} </math> | <math> f_2(x) = 2 i e^{-2x} </math> | <math> f_3(x) = 7 x </math> | <math> f_4(x) = x^2 - 1 </math> | <math> f_5(x) = sin(2 \pi x/a) </math> |} # For each of the following operators, list all of the functions above which are eigenfunctions. There may be more than one. For each, also identify the corresponding eigenvalue. #* <math>\hat P = -i\hbar \frac{d}{dx}</math> #* <math>\hat S = 3</math> #* <math>\hat R = 2 x \frac{d}{dx} - 1</math> #* <math>\hat H = -c \frac{d^2}{dx^2} </math> # Find the normalization constant needed for each of the functions, <math>f_1 -- f_5</math> so that <math>\int_0^a (A_n f_n(x))^2 = 1</math> #* <math>A_1 = </math> #* <math>A_2 = </math> #* <math>A_3 = </math> #* <math>A_4 = </math> #* <math>A_5 = </math> # Complete the following problems from the text: #* 3-1 #* 3-3 #* 3-4 #* 3-5 #* 3-10 3c74e2a614c2e16e8d2a2eb9c440af5a1684468c 717 714 2019-02-25T21:49:25Z David M. Rogers 2 wikitext text/x-wiki '''<BIG>Physical Chemistry II</BIG>''' Course Info * Course Numbers CHM 4411-001 * Credit Hours: 4 * Meeting Dates: Jan. 8 - Apr. 23, 2019 ** No Class Mar. 11-17 * Meeting Times: Tues. and Thurs., 9:30-10:45 am in ISA 3048 ** Problem Sessions: Fri., 11am-12 pm in ISA 3050 ** Regular quizzes on Fridays ** Office Hours: Fri., 10-11 am in IDR 200 * Grading: ** Quiz (30%) *** To succeed in the quiz, complete the homework and study the topics covered in the previous week! ** Exam 1 (20%) Fri., Feb. 8 11am-12pm (ISA 3050) ** Exam 2 (20%) Fri., Mar. 8, 11am-12pm (ISA 3050) ** Final (30%) Thurs., May 2 7:30-9:30am (ISA 3048) == Overview and Objectives == This course will introduce you to quantum theory, important for quantitatively describing atomic and molecular structure, chemical bonding and spectra. Students in this course will demonstrate the ability to apply the following ideas: * Relationship between mathematical models and intermolecular forces. * Explaining quantum states and their mathematical and physical properties. * Connecting observed molecular properties with quantum measurements. * Calculation of quantum energy levels and spectra. == Textbooks == * McQuarrie and Simon, Physical Chemistry: A Molecular Approach, University Science Books, 1997. ISBN: 0935702997. * Optional Extras: ** [http://www.feynmanlectures.caltech.edu/I_22.html Complex Algebra] ** [http://www.feynmanlectures.caltech.edu/I_23.html Damped, Driven Harmonic Oscillator] ** [http://www.feynmanlectures.caltech.edu/III_09.html The Ammonia Maser] * Quantum Advances Nobel Prize Lectures ** [https://www.nobelprize.org/prizes/chemistry/2013/karplus/facts/ Karplus, Levitt and Warshel, 2013] ** [https://www.nobelprize.org/prizes/physics/2012/haroche/facts/ Haroche and Wineland, 2012] ** [https://www.nobelprize.org/prizes/physics/2005/hall/facts/ Glauber, Hall, and Hänsch, 2005] ** [https://www.nobelprize.org/prizes/chemistry/1998/kohn/facts/ Kohn and Pople, 1998] ** [https://www.nobelprize.org/prizes/chemistry/1992/marcus/facts/ Rudolph Marcus, 1992] ** [https://www.nobelprize.org/prizes/chemistry/1991/ernst/facts/ Richard Ernst, 1991] ** [https://www.nobelprize.org/prizes/physics/1954/born/facts/ Born and Bothe, 1954] ** [https://www.nobelprize.org/prizes/physics/1952/bloch/biographical/ Bloch and Purcell, 1952] ** [https://www.nobelprize.org/prizes/physics/1945/pauli/facts/ Wolfgang Pauli, 1945] ** [https://www.nobelprize.org/prizes/physics/1933/schrodinger/facts/ Schrödinger and Dirac, 1933] ** [https://www.nobelprize.org/prizes/physics/1932/heisenberg/facts/ Werner Heisenberg, 1932] ** [https://www.nobelprize.org/prizes/physics/1921/einstein/facts/ Albert Einstein, 1921] ** [https://www.nobelprize.org/prizes/physics/1918/planck/facts/ Max Planck, 1918] * Advanced reading: ** [https://dx.doi.org/10.1093/acprof:oso/9780198509141.001.0001 Exploring the Quantum: Atoms, Cavities, and Photons] (Haroche and Raimond's book) * Super-advanced reading: ** [https://doi.org/10.1017/9781316995457 Collapse of The Wave Function] == Resources == * Visualization of Modes: ** [https://www.youtube.com/watch?v=BE827gwnnk4 Wine Glass] ** [https://www.youtube.com/watch?v=v4ELxKKT5Rw&t=4s Drum Head] [https://youtu.be/QksHbCwYngw?t=5 see also] *** Note: Modes are indexed by 2 numbers for a 2D surface. ** [https://www.youtube.com/watch?v=Qf0t4qIVWF4 Another 2D example] *** This one is part-way between a particle in a 2D box and a circular drum, since the center is a special point. ** [https://www.youtube.com/watch?v=6JeyiM0YNo4 Violin String] *** Note: This looks like a sawtooth wave, so is less connected to quantum and more related to classical solitons. ** [https://youtu.be/0Ddr_ipAMqE?t=224 Cymbals] *** Note: This shows many modes excited at once, so it is not a simple shape. Quantum-mechanically, this situation is called a superposition. ** [https://www.youtube.com/watch?v=fMsjyQHtmiU Tacoma Narrows Bridge] *** Acoustic and vibrational modes are very important in mechanical structures. We will calculate them for atoms and optical cavities. * [https://www.youtube.com/watch?v=RXPlHa5mRBE Audio in general] * Fundamental Dogma of Spectroscopy, <math>|E_2 - E_1| = h\nu</math> ** Here is Henri Poincaré's [https://www.gutenberg.org/files/37157/37157-pdf.pdf Science and Hypothesis], 1905. <blockquote> [On finding atomic causes of laboratory observations,] I shall only give one example which has always struck me rather forcibly. If I decompose white light, I shall be able to isolate a portion of the spectrum, but however small it may be, it will always be a certain width. In the same way the natural lights which are called monochromatic give us a very fine ray, but one which is not, however, infinitely fine. It might be supposed that in the experimental study of the properties of these natural lights, by operating with finer and finer rays, and passing on at last to the limit, so to speak, we should eventually obtain the properties of a rigorously monochromatic light. That would not be accurate. I assume that two rays emanate from the same source, that they are first polarised in planes at right angles, that they are then brought back again to the same plane of polarisation, and that we try to obtain interference. If the light were rigorously monochromatic, there would be interference; but with our nearly monochromatic lights, there will be no interference, and that, however narrow the ray may be. For it to be otherwise, the ray would have to be several million times finer than the finest known rays. </blockquote> ** He is saying that sunlight and light from incandescent bulbs has a continuous spectrum of all frequencies. Light from atomic transitions (like a high-pressure sodium lamp) has discrete spectral lines, but those ''still'' have a tiny line-width and two independent polarizations. This was not understood before the fundamental dogma of spectroscopy. The line-width is due to the energy-time uncertainty principle. == Assigned Homework Problems == # Part 1: Origins (Ch. 1, A, and 2) #* Ch. 1, 1-40 (we'll do 41-44 in class) #* Ch. A, 1-14 #** Hint on 12: use i = exp(...) #* Ch. 2, 1-16, 19 #** Hint on 1,2, and 4: use y(x) = A exp(ax) + B exp(b x) and check #** Hint on 5: use exp(i omega t) = ... #* Ch. 3, 1-19,24,25,28,29,30,32,35 #* Ch. C, all problems except 10; Ch. E, prob. 7; and Ch. F, prob. 1-2,7,11 #** We will only multiply and take determinants of 2x2 matrices in this class, but adding larger matrices should be simple. === Special Assignment for Quiz 4 === {| class="wikitable" |- | <math> f_1(x) = e^{ikx} </math> | <math> f_2(x) = 2 i e^{-2x} </math> | <math> f_3(x) = 7 x </math> | <math> f_4(x) = x^2 - 1 </math> | <math> f_5(x) = sin(2 \pi x/a) </math> |} # For each of the following operators, list all of the functions above which are eigenfunctions. There may be more than one. For each, also identify the corresponding eigenvalue. #* <math>\hat P = -i\hbar \frac{d}{dx}</math> #* <math>\hat S = 3</math> #* <math>\hat R = 2 x \frac{d}{dx} - 1</math> #* <math>\hat H = -c \frac{d^2}{dx^2} </math> # Find the normalization constant needed for each of the functions, <math>f_1 -- f_5</math> so that <math>\int_0^a (A_n f_n(x))^2 = 1</math> #* <math>A_1 = </math> #* <math>A_2 = </math> #* <math>A_3 = </math> #* <math>A_4 = </math> #* <math>A_5 = </math> # Complete the following problems from the text: #* 3-1 #* 3-3 #* 3-4 #* 3-5 #* 3-10 b85a50c64b795085e29586da755c7391ca2945f6 718 717 2019-02-25T22:08:54Z David M. Rogers 2 wikitext text/x-wiki '''<BIG>Physical Chemistry II</BIG>''' Course Info * Course Numbers CHM 4411-001 * Credit Hours: 4 * Meeting Dates: Jan. 8 - Apr. 23, 2019 ** No Class Mar. 11-17 * Meeting Times: Tues. and Thurs., 9:30-10:45 am in ISA 3048 ** Problem Sessions: Fri., 11am-12 pm in ISA 3050 ** Regular quizzes on Fridays ** Office Hours: Fri., 10-11 am in IDR 200 * Grading: ** Quiz (30%) *** To succeed in the quiz, complete the homework and study the topics covered in the previous week! ** Exam 1 (20%) Fri., Feb. 8 11am-12pm (ISA 3050) ** Exam 2 (20%) Fri., Mar. 8, 11am-12pm (ISA 3050) ** Final (30%) Thurs., May 2 7:30-9:30am (ISA 3048) == Overview and Objectives == This course will introduce you to quantum theory, important for quantitatively describing atomic and molecular structure, chemical bonding and spectra. Students in this course will demonstrate the ability to apply the following ideas: * Relationship between mathematical models and intermolecular forces. * Explaining quantum states and their mathematical and physical properties. * Connecting observed molecular properties with quantum measurements. * Calculation of quantum energy levels and spectra. == Textbooks == * McQuarrie and Simon, Physical Chemistry: A Molecular Approach, University Science Books, 1997. ISBN: 0935702997. * Optional Extras: ** [http://www.feynmanlectures.caltech.edu/I_22.html Complex Algebra] ** [http://www.feynmanlectures.caltech.edu/I_23.html Damped, Driven Harmonic Oscillator] ** [http://www.feynmanlectures.caltech.edu/III_09.html The Ammonia Maser] ** [https://quantumexperience.ng.bluemix.net/qx/experience Experiment with IBM's Quantum Computer] * Quantum Advances Nobel Prize Lectures ** [https://www.nobelprize.org/prizes/chemistry/2013/karplus/facts/ Karplus, Levitt and Warshel, 2013] ** [https://www.nobelprize.org/prizes/physics/2012/haroche/facts/ Haroche and Wineland, 2012] ** [https://www.nobelprize.org/prizes/physics/2005/hall/facts/ Glauber, Hall, and Hänsch, 2005] ** [https://www.nobelprize.org/prizes/chemistry/1998/kohn/facts/ Kohn and Pople, 1998] ** [https://www.nobelprize.org/prizes/chemistry/1992/marcus/facts/ Rudolph Marcus, 1992] ** [https://www.nobelprize.org/prizes/chemistry/1991/ernst/facts/ Richard Ernst, 1991] ** [https://www.nobelprize.org/prizes/physics/1954/born/facts/ Born and Bothe, 1954] ** [https://www.nobelprize.org/prizes/physics/1952/bloch/biographical/ Bloch and Purcell, 1952] ** [https://www.nobelprize.org/prizes/physics/1945/pauli/facts/ Wolfgang Pauli, 1945] ** [https://www.nobelprize.org/prizes/physics/1933/schrodinger/facts/ Schrödinger and Dirac, 1933] ** [https://www.nobelprize.org/prizes/physics/1932/heisenberg/facts/ Werner Heisenberg, 1932] ** [https://www.nobelprize.org/prizes/physics/1921/einstein/facts/ Albert Einstein, 1921] ** [https://www.nobelprize.org/prizes/physics/1918/planck/facts/ Max Planck, 1918] * Advanced reading: ** [https://dx.doi.org/10.1093/acprof:oso/9780198509141.001.0001 Exploring the Quantum: Atoms, Cavities, and Photons] (Haroche and Raimond's book) * Super-advanced reading: ** [https://doi.org/10.1017/9781316995457 Collapse of The Wave Function] == Resources == * Visualization of Modes: ** [https://www.youtube.com/watch?v=BE827gwnnk4 Wine Glass] ** [https://www.youtube.com/watch?v=v4ELxKKT5Rw&t=4s Drum Head] [https://youtu.be/QksHbCwYngw?t=5 see also] *** Note: Modes are indexed by 2 numbers for a 2D surface. ** [https://www.youtube.com/watch?v=Qf0t4qIVWF4 Another 2D example] *** This one is part-way between a particle in a 2D box and a circular drum, since the center is a special point. ** [https://www.youtube.com/watch?v=6JeyiM0YNo4 Violin String] *** Note: This looks like a sawtooth wave, so is less connected to quantum and more related to classical solitons. ** [https://youtu.be/0Ddr_ipAMqE?t=224 Cymbals] *** Note: This shows many modes excited at once, so it is not a simple shape. Quantum-mechanically, this situation is called a superposition. ** [https://www.youtube.com/watch?v=fMsjyQHtmiU Tacoma Narrows Bridge] *** Acoustic and vibrational modes are very important in mechanical structures. We will calculate them for atoms and optical cavities. * [https://www.youtube.com/watch?v=RXPlHa5mRBE Audio in general] * Fundamental Dogma of Spectroscopy, <math>|E_2 - E_1| = h\nu</math> ** Here is Henri Poincaré's [https://www.gutenberg.org/files/37157/37157-pdf.pdf Science and Hypothesis], 1905. <blockquote> [On finding atomic causes of laboratory observations,] I shall only give one example which has always struck me rather forcibly. If I decompose white light, I shall be able to isolate a portion of the spectrum, but however small it may be, it will always be a certain width. In the same way the natural lights which are called monochromatic give us a very fine ray, but one which is not, however, infinitely fine. It might be supposed that in the experimental study of the properties of these natural lights, by operating with finer and finer rays, and passing on at last to the limit, so to speak, we should eventually obtain the properties of a rigorously monochromatic light. That would not be accurate. I assume that two rays emanate from the same source, that they are first polarised in planes at right angles, that they are then brought back again to the same plane of polarisation, and that we try to obtain interference. If the light were rigorously monochromatic, there would be interference; but with our nearly monochromatic lights, there will be no interference, and that, however narrow the ray may be. For it to be otherwise, the ray would have to be several million times finer than the finest known rays. </blockquote> ** He is saying that sunlight and light from incandescent bulbs has a continuous spectrum of all frequencies. Light from atomic transitions (like a high-pressure sodium lamp) has discrete spectral lines, but those ''still'' have a tiny line-width and two independent polarizations. This was not understood before the fundamental dogma of spectroscopy. The line-width is due to the energy-time uncertainty principle. == Assigned Homework Problems == # Part 1: Origins (Ch. 1, A, and 2) #* Ch. 1, 1-40 (we'll do 41-44 in class) #* Ch. A, 1-14 #** Hint on 12: use i = exp(...) #* Ch. 2, 1-16, 19 #** Hint on 1,2, and 4: use y(x) = A exp(ax) + B exp(b x) and check #** Hint on 5: use exp(i omega t) = ... #* Ch. 3, 1-19,24,25,28,29,30,32,35 #* Ch. C, all problems except 10; Ch. E, prob. 7; and Ch. F, prob. 1-2,7,11 #** We will only multiply and take determinants of 2x2 matrices in this class, but adding larger matrices should be simple. === Special Assignment for Quiz 4 === {| class="wikitable" |- | <math> f_1(x) = e^{ikx} </math> | <math> f_2(x) = 2 i e^{-2x} </math> | <math> f_3(x) = 7 x </math> | <math> f_4(x) = x^2 - 1 </math> | <math> f_5(x) = sin(2 \pi x/a) </math> |} # For each of the following operators, list all of the functions above which are eigenfunctions. There may be more than one. For each, also identify the corresponding eigenvalue. #* <math>\hat P = -i\hbar \frac{d}{dx}</math> #* <math>\hat S = 3</math> #* <math>\hat R = 2 x \frac{d}{dx} - 1</math> #* <math>\hat H = -c \frac{d^2}{dx^2} </math> # Find the normalization constant needed for each of the functions, <math>f_1 -- f_5</math> so that <math>\int_0^a (A_n f_n(x))^2 = 1</math> #* <math>A_1 = </math> #* <math>A_2 = </math> #* <math>A_3 = </math> #* <math>A_4 = </math> #* <math>A_5 = </math> # Complete the following problems from the text: #* 3-1 #* 3-3 #* 3-4 #* 3-5 #* 3-10 a5fc649ac1afac5f511b54f0d29205d151ac21c3 720 718 2019-02-26T17:43:11Z David M. Rogers 2 wikitext text/x-wiki '''<BIG>Physical Chemistry II</BIG>''' Course Info * Course Numbers CHM 4411-001 * Credit Hours: 4 * Meeting Dates: Jan. 8 - Apr. 23, 2019 ** No Class Mar. 11-17 * Meeting Times: Tues. and Thurs., 9:30-10:45 am in ISA 3048 ** Problem Sessions: Fri., 11am-12 pm in ISA 3050 ** Regular quizzes on Fridays ** Office Hours: Fri., 10-11 am in IDR 200 * Grading: ** Quiz (30%) *** To succeed in the quiz, complete the homework and study the topics covered in the previous week! ** Exam 1 (20%) Fri., Feb. 8 11am-12pm (ISA 3050) ** Exam 2 (20%) Fri., Mar. 8, 11am-12pm (ISA 3050) ** Final (30%) Thurs., May 2 7:30-9:30am (ISA 3048) == Overview and Objectives == This course will introduce you to quantum theory, important for quantitatively describing atomic and molecular structure, chemical bonding and spectra. Students in this course will demonstrate the ability to apply the following ideas: * Relationship between mathematical models and intermolecular forces. * Explaining quantum states and their mathematical and physical properties. * Connecting observed molecular properties with quantum measurements. * Calculation of quantum energy levels and spectra. == Textbooks == * McQuarrie and Simon, Physical Chemistry: A Molecular Approach, University Science Books, 1997. ISBN: 0935702997. * Optional Extras: ** [http://www.feynmanlectures.caltech.edu/I_22.html Complex Algebra] ** [http://www.feynmanlectures.caltech.edu/I_23.html Damped, Driven Harmonic Oscillator] ** [http://www.feynmanlectures.caltech.edu/III_09.html The Ammonia Maser] ** [https://quantumexperience.ng.bluemix.net/qx/experience Experiment with IBM's Quantum Computer] * Quantum Advances Nobel Prize Lectures ** [https://www.nobelprize.org/prizes/chemistry/2013/karplus/facts/ Karplus, Levitt and Warshel, 2013] ** [https://www.nobelprize.org/prizes/physics/2012/haroche/facts/ Haroche and Wineland, 2012] ** [https://www.nobelprize.org/prizes/physics/2005/hall/facts/ Glauber, Hall, and Hänsch, 2005] ** [https://www.nobelprize.org/prizes/chemistry/1998/kohn/facts/ Kohn and Pople, 1998] ** [https://www.nobelprize.org/prizes/chemistry/1992/marcus/facts/ Rudolph Marcus, 1992] ** [https://www.nobelprize.org/prizes/chemistry/1991/ernst/facts/ Richard Ernst, 1991] ** [https://www.nobelprize.org/prizes/physics/1954/born/facts/ Born and Bothe, 1954] ** [https://www.nobelprize.org/prizes/physics/1952/bloch/biographical/ Bloch and Purcell, 1952] ** [https://www.nobelprize.org/prizes/physics/1945/pauli/facts/ Wolfgang Pauli, 1945] ** [https://www.nobelprize.org/prizes/physics/1933/schrodinger/facts/ Schrödinger and Dirac, 1933] ** [https://www.nobelprize.org/prizes/physics/1932/heisenberg/facts/ Werner Heisenberg, 1932] ** [https://www.nobelprize.org/prizes/physics/1921/einstein/facts/ Albert Einstein, 1921] ** [https://www.nobelprize.org/prizes/physics/1918/planck/facts/ Max Planck, 1918] * Advanced reading: ** [https://dx.doi.org/10.1093/acprof:oso/9780198509141.001.0001 Exploring the Quantum: Atoms, Cavities, and Photons] (Haroche and Raimond's book) * Super-advanced reading: ** [https://doi.org/10.1017/9781316995457 Collapse of The Wave Function] == Resources == * Visualization of Modes: ** [https://www.youtube.com/watch?v=BE827gwnnk4 Wine Glass] ** [https://www.youtube.com/watch?v=v4ELxKKT5Rw&t=4s Drum Head] [https://youtu.be/QksHbCwYngw?t=5 see also] *** Note: Modes are indexed by 2 numbers for a 2D surface. ** [https://www.youtube.com/watch?v=Qf0t4qIVWF4 Another 2D example] *** This one is part-way between a particle in a 2D box and a circular drum, since the center is a special point. ** [https://www.youtube.com/watch?v=6JeyiM0YNo4 Violin String] *** Note: This looks like a sawtooth wave, so is less connected to quantum and more related to classical solitons. ** [https://youtu.be/0Ddr_ipAMqE?t=224 Cymbals] *** Note: This shows many modes excited at once, so it is not a simple shape. Quantum-mechanically, this situation is called a superposition. ** [https://www.youtube.com/watch?v=fMsjyQHtmiU Tacoma Narrows Bridge] *** Acoustic and vibrational modes are very important in mechanical structures. We will calculate them for atoms and optical cavities. * [https://www.youtube.com/watch?v=RXPlHa5mRBE Audio in general] * Fundamental Dogma of Spectroscopy, <math>|E_2 - E_1| = h\nu</math> ** Here is Henri Poincaré's [https://www.gutenberg.org/files/37157/37157-pdf.pdf Science and Hypothesis], 1905. <blockquote> [On finding atomic causes of laboratory observations,] I shall only give one example which has always struck me rather forcibly. If I decompose white light, I shall be able to isolate a portion of the spectrum, but however small it may be, it will always be a certain width. In the same way the natural lights which are called monochromatic give us a very fine ray, but one which is not, however, infinitely fine. It might be supposed that in the experimental study of the properties of these natural lights, by operating with finer and finer rays, and passing on at last to the limit, so to speak, we should eventually obtain the properties of a rigorously monochromatic light. That would not be accurate. I assume that two rays emanate from the same source, that they are first polarised in planes at right angles, that they are then brought back again to the same plane of polarisation, and that we try to obtain interference. If the light were rigorously monochromatic, there would be interference; but with our nearly monochromatic lights, there will be no interference, and that, however narrow the ray may be. For it to be otherwise, the ray would have to be several million times finer than the finest known rays. </blockquote> ** He is saying that sunlight and light from incandescent bulbs has a continuous spectrum of all frequencies. Light from atomic transitions (like a high-pressure sodium lamp) has discrete spectral lines, but those ''still'' have a tiny line-width and two independent polarizations. This was not understood before the fundamental dogma of spectroscopy. The line-width is due to the energy-time uncertainty principle. == Assigned Homework Problems == # Part 1: Origins (Ch. 1, A, and 2) #* Ch. 1, 1-40 (we'll do 41-44 in class) #* Ch. A, 1-14 #** Hint on 12: use i = exp(...) #* Ch. 2, 1-16, 19 #** Hint on 1,2, and 4: use y(x) = A exp(ax) + B exp(b x) and check #** Hint on 5: use exp(i omega t) = ... #* Ch. 3, 1-19,24,25,28,29,30,32,35 #* Ch. C, all problems except 10; Ch. E, prob. 7; and Ch. F, prob. 1-2,7,11 #** We will only multiply and take determinants of 2x2 matrices in this class, but adding larger matrices should be simple. #* [[Media:HW6.pdf | Supplemental Homework for Quiz 6]] === Special Assignment for Quiz 4 === {| class="wikitable" |- | <math> f_1(x) = e^{ikx} </math> | <math> f_2(x) = 2 i e^{-2x} </math> | <math> f_3(x) = 7 x </math> | <math> f_4(x) = x^2 - 1 </math> | <math> f_5(x) = sin(2 \pi x/a) </math> |} # For each of the following operators, list all of the functions above which are eigenfunctions. There may be more than one. For each, also identify the corresponding eigenvalue. #* <math>\hat P = -i\hbar \frac{d}{dx}</math> #* <math>\hat S = 3</math> #* <math>\hat R = 2 x \frac{d}{dx} - 1</math> #* <math>\hat H = -c \frac{d^2}{dx^2} </math> # Find the normalization constant needed for each of the functions, <math>f_1 -- f_5</math> so that <math>\int_0^a (A_n f_n(x))^2 = 1</math> #* <math>A_1 = </math> #* <math>A_2 = </math> #* <math>A_3 = </math> #* <math>A_4 = </math> #* <math>A_5 = </math> # Complete the following problems from the text: #* 3-1 #* 3-3 #* 3-4 #* 3-5 #* 3-10 624f2f5964b3a49814932f31796d1f65c7e1aaf3 721 720 2019-03-04T22:32:38Z David M. Rogers 2 wikitext text/x-wiki '''<BIG>Physical Chemistry II</BIG>''' Course Info * Course Numbers CHM 4411-001 * Credit Hours: 4 * Meeting Dates: Jan. 8 - Apr. 23, 2019 ** No Class Mar. 11-17 * Meeting Times: Tues. and Thurs., 9:30-10:45 am in ISA 3048 ** Problem Sessions: Fri., 11am-12 pm in ISA 3050 ** Regular quizzes on Fridays ** Office Hours: Fri., 10-11 am in IDR 200 * Grading: ** Quiz (30%) *** To succeed in the quiz, complete the homework and study the topics covered in the previous week! ** Exam 1 (20%) Fri., Feb. 8 11am-12pm (ISA 3050) ** Exam 2 (20%) Fri., Mar. 8, 11am-12pm (ISA 3050) ** Final (30%) Thurs., May 2 7:30-9:30am (ISA 3048) == Overview and Objectives == This course will introduce you to quantum theory, important for quantitatively describing atomic and molecular structure, chemical bonding and spectra. Students in this course will demonstrate the ability to apply the following ideas: * Relationship between mathematical models and intermolecular forces. * Explaining quantum states and their mathematical and physical properties. * Connecting observed molecular properties with quantum measurements. * Calculation of quantum energy levels and spectra. == Textbooks == * McQuarrie and Simon, Physical Chemistry: A Molecular Approach, University Science Books, 1997. ISBN: 0935702997. * Optional Extras: ** [http://www.feynmanlectures.caltech.edu/I_22.html Complex Algebra] ** [http://www.feynmanlectures.caltech.edu/I_23.html Damped, Driven Harmonic Oscillator] ** [http://www.feynmanlectures.caltech.edu/III_09.html The Ammonia Maser] ** [https://physicstoday.scitation.org/doi/10.1063/PT.3.2550 The Quantum Credo] * Quantum Advances Nobel Prize Lectures ** [https://www.nobelprize.org/prizes/chemistry/2013/karplus/facts/ Karplus, Levitt and Warshel, 2013] ** [https://www.nobelprize.org/prizes/physics/2012/haroche/facts/ Haroche and Wineland, 2012] ** [https://www.nobelprize.org/prizes/physics/2005/hall/facts/ Glauber, Hall, and Hänsch, 2005] ** [https://www.nobelprize.org/prizes/chemistry/1998/kohn/facts/ Kohn and Pople, 1998] ** [https://www.nobelprize.org/prizes/chemistry/1992/marcus/facts/ Rudolph Marcus, 1992] ** [https://www.nobelprize.org/prizes/chemistry/1991/ernst/facts/ Richard Ernst, 1991] ** [https://www.nobelprize.org/prizes/physics/1954/born/facts/ Born and Bothe, 1954] ** [https://www.nobelprize.org/prizes/physics/1952/bloch/biographical/ Bloch and Purcell, 1952] ** [https://www.nobelprize.org/prizes/physics/1945/pauli/facts/ Wolfgang Pauli, 1945] ** [https://www.nobelprize.org/prizes/physics/1933/schrodinger/facts/ Schrödinger and Dirac, 1933] ** [https://www.nobelprize.org/prizes/physics/1932/heisenberg/facts/ Werner Heisenberg, 1932] ** [https://www.nobelprize.org/prizes/physics/1921/einstein/facts/ Albert Einstein, 1921] ** [https://www.nobelprize.org/prizes/physics/1918/planck/facts/ Max Planck, 1918] * Advanced reading: ** [https://dx.doi.org/10.1093/acprof:oso/9780198509141.001.0001 Exploring the Quantum: Atoms, Cavities, and Photons] (Haroche and Raimond's book) * Super-advanced reading: ** [https://doi.org/10.1017/9781316995457 Collapse of The Wave Function] == Resources == * Visualization of Modes: ** [https://www.youtube.com/watch?v=BE827gwnnk4 Wine Glass] ** [https://www.youtube.com/watch?v=v4ELxKKT5Rw&t=4s Drum Head] [https://youtu.be/QksHbCwYngw?t=5 see also] *** Note: Modes are indexed by 2 numbers for a 2D surface. ** [https://www.youtube.com/watch?v=Qf0t4qIVWF4 Another 2D example] *** This one is part-way between a particle in a 2D box and a circular drum, since the center is a special point. ** [https://www.youtube.com/watch?v=6JeyiM0YNo4 Violin String] *** Note: This looks like a sawtooth wave, so is less connected to quantum and more related to classical solitons. ** [https://youtu.be/0Ddr_ipAMqE?t=224 Cymbals] *** Note: This shows many modes excited at once, so it is not a simple shape. Quantum-mechanically, this situation is called a superposition. ** [https://www.youtube.com/watch?v=fMsjyQHtmiU Tacoma Narrows Bridge] *** Acoustic and vibrational modes are very important in mechanical structures. We will calculate them for atoms and optical cavities. ** [https://www.youtube.com/watch?v=RXPlHa5mRBE Audio in general] * Fundamental Dogma of Spectroscopy, <math>|E_2 - E_1| = h\nu</math> ** Here is Henri Poincaré's [https://www.gutenberg.org/files/37157/37157-pdf.pdf Science and Hypothesis], 1905. <blockquote> [On finding atomic causes of laboratory observations,] I shall only give one example which has always struck me rather forcibly. If I decompose white light, I shall be able to isolate a portion of the spectrum, but however small it may be, it will always be a certain width. In the same way the natural lights which are called monochromatic give us a very fine ray, but one which is not, however, infinitely fine. It might be supposed that in the experimental study of the properties of these natural lights, by operating with finer and finer rays, and passing on at last to the limit, so to speak, we should eventually obtain the properties of a rigorously monochromatic light. That would not be accurate. I assume that two rays emanate from the same source, that they are first polarised in planes at right angles, that they are then brought back again to the same plane of polarisation, and that we try to obtain interference. If the light were rigorously monochromatic, there would be interference; but with our nearly monochromatic lights, there will be no interference, and that, however narrow the ray may be. For it to be otherwise, the ray would have to be several million times finer than the finest known rays. </blockquote> ** He is saying that sunlight and light from incandescent bulbs has a continuous spectrum of all frequencies. Light from atomic transitions (like a high-pressure sodium lamp) has discrete spectral lines, but those ''still'' have a tiny line-width and two independent polarizations. This was not understood before the fundamental dogma of spectroscopy. The line-width is due to the energy-time uncertainty principle. * Quantum Computing ** [https://quantumexperience.ng.bluemix.net/qx/experience Experiment with IBM's Quantum Computer] == Assigned Homework Problems == # Part 1: Origins (Ch. 1, A, and 2) #* Ch. 1, 1-40 (we'll do 41-44 in class) #* Ch. A, 1-14 #** Hint on 12: use i = exp(...) #* Ch. 2, 1-16, 19 #** Hint on 1,2, and 4: use y(x) = A exp(ax) + B exp(b x) and check #** Hint on 5: use exp(i omega t) = ... #* Ch. 3, 1-19,24,25,28,29,30,32,35 #* Ch. C, all problems except 10; Ch. E, prob. 7; and Ch. F, prob. 1-2,7,11 #** We will only multiply and take determinants of 2x2 matrices in this class, but adding larger matrices should be simple. #* [[Media:HW6.pdf | Supplemental Homework for Quiz 6]] === Special Assignment for Quiz 4 === {| class="wikitable" |- | <math> f_1(x) = e^{ikx} </math> | <math> f_2(x) = 2 i e^{-2x} </math> | <math> f_3(x) = 7 x </math> | <math> f_4(x) = x^2 - 1 </math> | <math> f_5(x) = sin(2 \pi x/a) </math> |} # For each of the following operators, list all of the functions above which are eigenfunctions. There may be more than one. For each, also identify the corresponding eigenvalue. #* <math>\hat P = -i\hbar \frac{d}{dx}</math> #* <math>\hat S = 3</math> #* <math>\hat R = 2 x \frac{d}{dx} - 1</math> #* <math>\hat H = -c \frac{d^2}{dx^2} </math> # Find the normalization constant needed for each of the functions, <math>f_1 -- f_5</math> so that <math>\int_0^a (A_n f_n(x))^2 = 1</math> #* <math>A_1 = </math> #* <math>A_2 = </math> #* <math>A_3 = </math> #* <math>A_4 = </math> #* <math>A_5 = </math> # Complete the following problems from the text: #* 3-1 #* 3-3 #* 3-4 #* 3-5 #* 3-10 bc8ac1286d288c19bdc2ab5a88c6c4bc8581f5cd 722 721 2019-03-04T22:51:03Z David M. Rogers 2 wikitext text/x-wiki '''<BIG>Physical Chemistry II</BIG>''' Course Info * Course Numbers CHM 4411-001 * Credit Hours: 4 * Meeting Dates: Jan. 8 - Apr. 23, 2019 ** No Class Mar. 11-17 * Meeting Times: Tues. and Thurs., 9:30-10:45 am in ISA 3048 ** Problem Sessions: Fri., 11am-12 pm in ISA 3050 ** Regular quizzes on Fridays ** Office Hours: Fri., 10-11 am in IDR 200 * Grading: ** Quiz (30%) *** To succeed in the quiz, complete the homework and study the topics covered in the previous week! ** Exam 1 (20%) Fri., Feb. 8 11am-12pm (ISA 3050) ** Exam 2 (20%) Fri., Mar. 8, 11am-12pm (ISA 3050) ** Final (30%) Thurs., May 2 7:30-9:30am (ISA 3048) == Overview and Objectives == This course will introduce you to quantum theory, important for quantitatively describing atomic and molecular structure, chemical bonding and spectra. Students in this course will demonstrate the ability to apply the following ideas: * Relationship between mathematical models and intermolecular forces. * Explaining quantum states and their mathematical and physical properties. * Connecting observed molecular properties with quantum measurements. * Calculation of quantum energy levels and spectra. == Textbooks == * McQuarrie and Simon, Physical Chemistry: A Molecular Approach, University Science Books, 1997. ISBN: 0935702997. * Optional Extras: ** [http://www.feynmanlectures.caltech.edu/I_22.html Complex Algebra] ** [http://www.feynmanlectures.caltech.edu/I_23.html Damped, Driven Harmonic Oscillator] ** [http://www.feynmanlectures.caltech.edu/III_09.html The Ammonia Maser] ** [https://physicstoday.scitation.org/doi/10.1063/PT.3.2550 The Quantum Credo] * Quantum Advances Nobel Prize Lectures ** [https://www.nobelprize.org/prizes/chemistry/2013/karplus/facts/ Karplus, Levitt and Warshel, 2013] ** [https://www.nobelprize.org/prizes/physics/2012/haroche/facts/ Haroche and Wineland, 2012] ** [https://www.nobelprize.org/prizes/physics/2005/hall/facts/ Glauber, Hall, and Hänsch, 2005] ** [https://www.nobelprize.org/prizes/chemistry/1998/kohn/facts/ Kohn and Pople, 1998] ** [https://www.nobelprize.org/prizes/chemistry/1992/marcus/facts/ Rudolph Marcus, 1992] ** [https://www.nobelprize.org/prizes/chemistry/1991/ernst/facts/ Richard Ernst, 1991] ** [https://www.nobelprize.org/prizes/physics/1954/born/facts/ Born and Bothe, 1954] ** [https://www.nobelprize.org/prizes/physics/1952/bloch/biographical/ Bloch and Purcell, 1952] ** [https://www.nobelprize.org/prizes/physics/1945/pauli/facts/ Wolfgang Pauli, 1945] ** [https://www.nobelprize.org/prizes/physics/1933/schrodinger/facts/ Schrödinger and Dirac, 1933] ** [https://www.nobelprize.org/prizes/physics/1932/heisenberg/facts/ Werner Heisenberg, 1932] ** [https://www.nobelprize.org/prizes/physics/1921/einstein/facts/ Albert Einstein, 1921] ** [https://www.nobelprize.org/prizes/physics/1918/planck/facts/ Max Planck, 1918] * Advanced reading: ** [https://dx.doi.org/10.1093/acprof:oso/9780198509141.001.0001 Exploring the Quantum: Atoms, Cavities, and Photons] (Haroche and Raimond's book) * Super-advanced reading: ** [https://doi.org/10.1017/9781316995457 Collapse of The Wave Function] == Resources == * Visualization of Modes: ** [https://www.youtube.com/watch?v=BE827gwnnk4 Wine Glass] ** [https://www.youtube.com/watch?v=v4ELxKKT5Rw&t=4s Drum Head] [https://youtu.be/QksHbCwYngw?t=5 see also] *** Note: Modes are indexed by 2 numbers for a 2D surface. ** [https://www.youtube.com/watch?v=Qf0t4qIVWF4 Another 2D example] *** This one is part-way between a particle in a 2D box and a circular drum, since the center is a special point. ** [https://www.youtube.com/watch?v=6JeyiM0YNo4 Violin String] *** Note: This looks like a sawtooth wave, so is less connected to quantum and more related to classical solitons. ** [https://youtu.be/0Ddr_ipAMqE?t=224 Cymbals] *** Note: This shows many modes excited at once, so it is not a simple shape. Quantum-mechanically, this situation is called a superposition. ** [https://www.youtube.com/watch?v=fMsjyQHtmiU Tacoma Narrows Bridge] *** Acoustic and vibrational modes are very important in mechanical structures. We will calculate them for atoms and optical cavities. ** [https://www.youtube.com/watch?v=RXPlHa5mRBE Audio in general] * Fundamental Dogma of Spectroscopy, <math>|E_2 - E_1| = h\nu</math> ** Here is Henri Poincaré's [https://www.gutenberg.org/files/37157/37157-pdf.pdf Science and Hypothesis], 1905. <blockquote> [On finding atomic causes of laboratory observations,] I shall only give one example which has always struck me rather forcibly. If I decompose white light, I shall be able to isolate a portion of the spectrum, but however small it may be, it will always be a certain width. In the same way the natural lights which are called monochromatic give us a very fine ray, but one which is not, however, infinitely fine. It might be supposed that in the experimental study of the properties of these natural lights, by operating with finer and finer rays, and passing on at last to the limit, so to speak, we should eventually obtain the properties of a rigorously monochromatic light. That would not be accurate. I assume that two rays emanate from the same source, that they are first polarised in planes at right angles, that they are then brought back again to the same plane of polarisation, and that we try to obtain interference. If the light were rigorously monochromatic, there would be interference; but with our nearly monochromatic lights, there will be no interference, and that, however narrow the ray may be. For it to be otherwise, the ray would have to be several million times finer than the finest known rays. </blockquote> ** He is saying that sunlight and light from incandescent bulbs has a continuous spectrum of all frequencies. Light from atomic transitions (like a high-pressure sodium lamp) has discrete spectral lines, but those ''still'' have a tiny line-width and two independent polarizations. This was not understood before the fundamental dogma of spectroscopy. The line-width is due to the energy-time uncertainty principle. * Quantum Computing ** [https://quantumexperience.ng.bluemix.net/qx/experience Experiment with IBM's Quantum Computer] == Assigned Homework Problems == # Part 1: Origins (Ch. 1, A, and 2) #* Ch. 1, 1-40 (we'll do 41-44 in class) #* Ch. A, 1-14 #** Hint on 12: use i = exp(...) #* Ch. 2, 1-16, 19 #** Hint on 1,2, and 4: use y(x) = A exp(ax) + B exp(b x) and check #** Hint on 5: use exp(i omega t) = ... # Part 2: First Schrodinger Solutions (Ch. 3, C, E, F) #* Ch. 3, 1-19,24,25,28,29,30,32,35 #* Ch. C, all problems except 10; Ch. E, prob. 7; and Ch. F, prob. 1-2,7,11 #** We will only multiply and take determinants of 2x2 matrices in this class, but adding larger matrices should be simple. #* [[Media:HW6.pdf | Supplemental Homework for Quiz 6]] # Part 3: Measurement, Observables, Speakable and Unspeakable (Ch. 4-5) #* Ch. 4, 1-3, 5, 7, 11, 14-16, 21-22 === Special Assignment for Quiz 4 === {| class="wikitable" |- | <math> f_1(x) = e^{ikx} </math> | <math> f_2(x) = 2 i e^{-2x} </math> | <math> f_3(x) = 7 x </math> | <math> f_4(x) = x^2 - 1 </math> | <math> f_5(x) = sin(2 \pi x/a) </math> |} # For each of the following operators, list all of the functions above which are eigenfunctions. There may be more than one. For each, also identify the corresponding eigenvalue. #* <math>\hat P = -i\hbar \frac{d}{dx}</math> #* <math>\hat S = 3</math> #* <math>\hat R = 2 x \frac{d}{dx} - 1</math> #* <math>\hat H = -c \frac{d^2}{dx^2} </math> # Find the normalization constant needed for each of the functions, <math>f_1 -- f_5</math> so that <math>\int_0^a (A_n f_n(x))^2 = 1</math> #* <math>A_1 = </math> #* <math>A_2 = </math> #* <math>A_3 = </math> #* <math>A_4 = </math> #* <math>A_5 = </math> # Complete the following problems from the text: #* 3-1 #* 3-3 #* 3-4 #* 3-5 #* 3-10 34fb69ac3fda5697196018e684cc3924eb3a2047 723 722 2019-03-08T15:15:17Z David M. Rogers 2 wikitext text/x-wiki '''<BIG>Physical Chemistry II</BIG>''' Course Info * Course Numbers CHM 4411-001 * Credit Hours: 4 * Meeting Dates: Jan. 8 - Apr. 23, 2019 ** No Class Mar. 11-17 * Meeting Times: Tues. and Thurs., 9:30-10:45 am in ISA 3048 ** Problem Sessions: Fri., 11am-12 pm in ISA 3050 ** Regular quizzes on Fridays ** Office Hours: Fri., 10-11 am in IDR 200 * Grading: ** Quiz (30%) *** To succeed in the quiz, complete the homework and study the topics covered in the previous week! ** Exam 1 (20%) Fri., Feb. 8 11am-12pm (ISA 3050) ** Exam 2 (20%) Fri., Mar. 8, 11am-12pm (ISA 3050) ** Final (30%) Thurs., May 2 7:30-9:30am (ISA 3048) == Overview and Objectives == This course will introduce you to quantum theory, important for quantitatively describing atomic and molecular structure, chemical bonding and spectra. Students in this course will demonstrate the ability to apply the following ideas: * Relationship between mathematical models and intermolecular forces. * Explaining quantum states and their mathematical and physical properties. * Connecting observed molecular properties with quantum measurements. * Calculation of quantum energy levels and spectra. == Textbooks == * McQuarrie and Simon, Physical Chemistry: A Molecular Approach, University Science Books, 1997. ISBN: 0935702997. * Optional Extras: ** [http://www.feynmanlectures.caltech.edu/I_22.html Complex Algebra] ** [http://www.feynmanlectures.caltech.edu/I_23.html Damped, Driven Harmonic Oscillator] ** [http://www.feynmanlectures.caltech.edu/III_09.html The Ammonia Maser] ** [https://physicstoday.scitation.org/doi/10.1063/PT.3.2550 The Quantum Credo] ** [https://quantummechanics.ucsd.edu/ph130a/130_notes/130_notes.html Quantum Physics Online] (full year course) * Quantum Advances Nobel Prize Lectures ** [https://www.nobelprize.org/prizes/chemistry/2013/karplus/facts/ Karplus, Levitt and Warshel, 2013] ** [https://www.nobelprize.org/prizes/physics/2012/haroche/facts/ Haroche and Wineland, 2012] ** [https://www.nobelprize.org/prizes/physics/2005/hall/facts/ Glauber, Hall, and Hänsch, 2005] ** [https://www.nobelprize.org/prizes/chemistry/1998/kohn/facts/ Kohn and Pople, 1998] ** [https://www.nobelprize.org/prizes/chemistry/1992/marcus/facts/ Rudolph Marcus, 1992] ** [https://www.nobelprize.org/prizes/chemistry/1991/ernst/facts/ Richard Ernst, 1991] ** [https://www.nobelprize.org/prizes/physics/1954/born/facts/ Born and Bothe, 1954] ** [https://www.nobelprize.org/prizes/physics/1952/bloch/biographical/ Bloch and Purcell, 1952] ** [https://www.nobelprize.org/prizes/physics/1945/pauli/facts/ Wolfgang Pauli, 1945] ** [https://www.nobelprize.org/prizes/physics/1933/schrodinger/facts/ Schrödinger and Dirac, 1933] ** [https://www.nobelprize.org/prizes/physics/1932/heisenberg/facts/ Werner Heisenberg, 1932] ** [https://www.nobelprize.org/prizes/physics/1921/einstein/facts/ Albert Einstein, 1921] ** [https://www.nobelprize.org/prizes/physics/1918/planck/facts/ Max Planck, 1918] * Advanced reading: ** [https://dx.doi.org/10.1093/acprof:oso/9780198509141.001.0001 Exploring the Quantum: Atoms, Cavities, and Photons] (Haroche and Raimond's book) * Super-advanced reading: ** [https://doi.org/10.1017/9781316995457 Collapse of The Wave Function] == Resources == * Visualization of Modes: ** [https://www.youtube.com/watch?v=BE827gwnnk4 Wine Glass] ** [https://www.youtube.com/watch?v=v4ELxKKT5Rw&t=4s Drum Head] [https://youtu.be/QksHbCwYngw?t=5 see also] *** Note: Modes are indexed by 2 numbers for a 2D surface. ** [https://www.youtube.com/watch?v=Qf0t4qIVWF4 Another 2D example] *** This one is part-way between a particle in a 2D box and a circular drum, since the center is a special point. ** [https://www.youtube.com/watch?v=6JeyiM0YNo4 Violin String] *** Note: This looks like a sawtooth wave, so is less connected to quantum and more related to classical solitons. ** [https://youtu.be/0Ddr_ipAMqE?t=224 Cymbals] *** Note: This shows many modes excited at once, so it is not a simple shape. Quantum-mechanically, this situation is called a superposition. ** [https://www.youtube.com/watch?v=fMsjyQHtmiU Tacoma Narrows Bridge] *** Acoustic and vibrational modes are very important in mechanical structures. We will calculate them for atoms and optical cavities. ** [https://www.youtube.com/watch?v=RXPlHa5mRBE Audio in general] * Fundamental Dogma of Spectroscopy, <math>|E_2 - E_1| = h\nu</math> ** Here is Henri Poincaré's [https://www.gutenberg.org/files/37157/37157-pdf.pdf Science and Hypothesis], 1905. <blockquote> [On finding atomic causes of laboratory observations,] I shall only give one example which has always struck me rather forcibly. If I decompose white light, I shall be able to isolate a portion of the spectrum, but however small it may be, it will always be a certain width. In the same way the natural lights which are called monochromatic give us a very fine ray, but one which is not, however, infinitely fine. It might be supposed that in the experimental study of the properties of these natural lights, by operating with finer and finer rays, and passing on at last to the limit, so to speak, we should eventually obtain the properties of a rigorously monochromatic light. That would not be accurate. I assume that two rays emanate from the same source, that they are first polarised in planes at right angles, that they are then brought back again to the same plane of polarisation, and that we try to obtain interference. If the light were rigorously monochromatic, there would be interference; but with our nearly monochromatic lights, there will be no interference, and that, however narrow the ray may be. For it to be otherwise, the ray would have to be several million times finer than the finest known rays. </blockquote> ** He is saying that sunlight and light from incandescent bulbs has a continuous spectrum of all frequencies. Light from atomic transitions (like a high-pressure sodium lamp) has discrete spectral lines, but those ''still'' have a tiny line-width and two independent polarizations. This was not understood before the fundamental dogma of spectroscopy. The line-width is due to the energy-time uncertainty principle. * Quantum Computing ** [https://quantumexperience.ng.bluemix.net/qx/experience Experiment with IBM's Quantum Computer] == Assigned Homework Problems == # Part 1: Origins (Ch. 1, A, and 2) #* Ch. 1, 1-40 (we'll do 41-44 in class) #* Ch. A, 1-14 #** Hint on 12: use i = exp(...) #* Ch. 2, 1-16, 19 #** Hint on 1,2, and 4: use y(x) = A exp(ax) + B exp(b x) and check #** Hint on 5: use exp(i omega t) = ... # Part 2: First Schrodinger Solutions (Ch. 3, C, E, F) #* Ch. 3, 1-19,24,25,28,29,30,32,35 #* Ch. C, all problems except 10; Ch. E, prob. 7; and Ch. F, prob. 1-2,7,11 #** We will only multiply and take determinants of 2x2 matrices in this class, but adding larger matrices should be simple. #* [[Media:HW6.pdf | Supplemental Homework for Quiz 6]] # Part 3: Measurement, Observables, Speakable and Unspeakable (Ch. 4-5) #* Ch. 4, 1-3, 5, 7, 11, 14-16, 21-22 === Special Assignment for Quiz 4 === {| class="wikitable" |- | <math> f_1(x) = e^{ikx} </math> | <math> f_2(x) = 2 i e^{-2x} </math> | <math> f_3(x) = 7 x </math> | <math> f_4(x) = x^2 - 1 </math> | <math> f_5(x) = sin(2 \pi x/a) </math> |} # For each of the following operators, list all of the functions above which are eigenfunctions. There may be more than one. For each, also identify the corresponding eigenvalue. #* <math>\hat P = -i\hbar \frac{d}{dx}</math> #* <math>\hat S = 3</math> #* <math>\hat R = 2 x \frac{d}{dx} - 1</math> #* <math>\hat H = -c \frac{d^2}{dx^2} </math> # Find the normalization constant needed for each of the functions, <math>f_1 -- f_5</math> so that <math>\int_0^a (A_n f_n(x))^2 = 1</math> #* <math>A_1 = </math> #* <math>A_2 = </math> #* <math>A_3 = </math> #* <math>A_4 = </math> #* <math>A_5 = </math> # Complete the following problems from the text: #* 3-1 #* 3-3 #* 3-4 #* 3-5 #* 3-10 829273e97348e27e5a6bcf709a21f4ac9b04f411 724 723 2019-03-18T21:58:19Z David M. Rogers 2 wikitext text/x-wiki '''<BIG>Physical Chemistry II</BIG>''' Course Info * Course Numbers CHM 4411-001 * Credit Hours: 4 * Meeting Dates: Jan. 8 - Apr. 23, 2019 ** No Class Mar. 11-17 * Meeting Times: Tues. and Thurs., 9:30-10:45 am in ISA 3048 ** Problem Sessions: Fri., 11am-12 pm in ISA 3050 ** Regular quizzes on Fridays ** Office Hours: Fri., 10-11 am in IDR 200 * Grading: ** Quiz (30%) *** To succeed in the quiz, complete the homework and study the topics covered in the previous week! ** Exam 1 (20%) Fri., Feb. 8 11am-12pm (ISA 3050) ** Exam 2 (20%) Fri., Mar. 8, 11am-12pm (ISA 3050) ** Final (30%) Thurs., May 2 7:30-9:30am (ISA 3048) == Overview and Objectives == This course will introduce you to quantum theory, important for quantitatively describing atomic and molecular structure, chemical bonding and spectra. Students in this course will demonstrate the ability to apply the following ideas: * Relationship between mathematical models and intermolecular forces. * Explaining quantum states and their mathematical and physical properties. * Connecting observed molecular properties with quantum measurements. * Calculation of quantum energy levels and spectra. == Textbooks == * McQuarrie and Simon, Physical Chemistry: A Molecular Approach, University Science Books, 1997. ISBN: 0935702997. * Optional Extras: ** [http://www.feynmanlectures.caltech.edu/I_22.html Complex Algebra] ** [http://www.feynmanlectures.caltech.edu/I_23.html Damped, Driven Harmonic Oscillator] ** [http://www.feynmanlectures.caltech.edu/III_09.html The Ammonia Maser] ** [https://physicstoday.scitation.org/doi/10.1063/PT.3.2550 The Quantum Credo] ** [https://quantummechanics.ucsd.edu/ph130a/130_notes/130_notes.html Quantum Physics Online] (full year course) * Quantum Advances Nobel Prize Lectures ** [https://www.nobelprize.org/prizes/chemistry/2013/karplus/facts/ Karplus, Levitt and Warshel, 2013] ** [https://www.nobelprize.org/prizes/physics/2012/haroche/facts/ Haroche and Wineland, 2012] ** [https://www.nobelprize.org/prizes/physics/2005/hall/facts/ Glauber, Hall, and Hänsch, 2005] ** [https://www.nobelprize.org/prizes/chemistry/1998/kohn/facts/ Kohn and Pople, 1998] ** [https://www.nobelprize.org/prizes/chemistry/1992/marcus/facts/ Rudolph Marcus, 1992] ** [https://www.nobelprize.org/prizes/chemistry/1991/ernst/facts/ Richard Ernst, 1991] ** [https://www.nobelprize.org/prizes/physics/1954/born/facts/ Born and Bothe, 1954] ** [https://www.nobelprize.org/prizes/physics/1952/bloch/biographical/ Bloch and Purcell, 1952] ** [https://www.nobelprize.org/prizes/physics/1945/pauli/facts/ Wolfgang Pauli, 1945] ** [https://www.nobelprize.org/prizes/physics/1933/schrodinger/facts/ Schrödinger and Dirac, 1933] ** [https://www.nobelprize.org/prizes/physics/1932/heisenberg/facts/ Werner Heisenberg, 1932] ** [https://www.nobelprize.org/prizes/physics/1921/einstein/facts/ Albert Einstein, 1921] ** [https://www.nobelprize.org/prizes/physics/1918/planck/facts/ Max Planck, 1918] * Advanced reading: ** [https://dx.doi.org/10.1093/acprof:oso/9780198509141.001.0001 Exploring the Quantum: Atoms, Cavities, and Photons] (Haroche and Raimond's book) * Super-advanced reading: ** [https://doi.org/10.1017/9781316995457 Collapse of The Wave Function] == Resources == * Visualization of Modes: ** [https://www.youtube.com/watch?v=BE827gwnnk4 Wine Glass] ** [https://www.youtube.com/watch?v=v4ELxKKT5Rw&t=4s Drum Head] [https://youtu.be/QksHbCwYngw?t=5 see also] *** Note: Modes are indexed by 2 numbers for a 2D surface. ** [https://www.youtube.com/watch?v=Qf0t4qIVWF4 Another 2D example] *** This one is part-way between a particle in a 2D box and a circular drum, since the center is a special point. ** [https://www.youtube.com/watch?v=6JeyiM0YNo4 Violin String] *** Note: This looks like a sawtooth wave, so is less connected to quantum and more related to classical solitons. ** [https://youtu.be/0Ddr_ipAMqE?t=224 Cymbals] *** Note: This shows many modes excited at once, so it is not a simple shape. Quantum-mechanically, this situation is called a superposition. ** [https://www.youtube.com/watch?v=fMsjyQHtmiU Tacoma Narrows Bridge] *** Acoustic and vibrational modes are very important in mechanical structures. We will calculate them for atoms and optical cavities. ** [https://www.youtube.com/watch?v=RXPlHa5mRBE Audio in general] * Fundamental Dogma of Spectroscopy, <math>|E_2 - E_1| = h\nu</math> ** Here is Henri Poincaré's [https://www.gutenberg.org/files/37157/37157-pdf.pdf Science and Hypothesis], 1905. <blockquote> [On finding atomic causes of laboratory observations,] I shall only give one example which has always struck me rather forcibly. If I decompose white light, I shall be able to isolate a portion of the spectrum, but however small it may be, it will always be a certain width. In the same way the natural lights which are called monochromatic give us a very fine ray, but one which is not, however, infinitely fine. It might be supposed that in the experimental study of the properties of these natural lights, by operating with finer and finer rays, and passing on at last to the limit, so to speak, we should eventually obtain the properties of a rigorously monochromatic light. That would not be accurate. I assume that two rays emanate from the same source, that they are first polarised in planes at right angles, that they are then brought back again to the same plane of polarisation, and that we try to obtain interference. If the light were rigorously monochromatic, there would be interference; but with our nearly monochromatic lights, there will be no interference, and that, however narrow the ray may be. For it to be otherwise, the ray would have to be several million times finer than the finest known rays. </blockquote> ** He is saying that sunlight and light from incandescent bulbs has a continuous spectrum of all frequencies. Light from atomic transitions (like a high-pressure sodium lamp) has discrete spectral lines, but those ''still'' have a tiny line-width and two independent polarizations. This was not understood before the fundamental dogma of spectroscopy. The line-width is due to the energy-time uncertainty principle. * Quantum Computing ** [https://quantumexperience.ng.bluemix.net/qx/experience Experiment with IBM's Quantum Computer] * [https://predictivestatmech.org/papers/LifeAfterGraduation.pdf Life After Graduation] == Assigned Homework Problems == # Part 1: Origins (Ch. 1, A, and 2) #* Ch. 1, 1-40 (we'll do 41-44 in class) #* Ch. A, 1-14 #** Hint on 12: use i = exp(...) #* Ch. 2, 1-16, 19 #** Hint on 1,2, and 4: use y(x) = A exp(ax) + B exp(b x) and check #** Hint on 5: use exp(i omega t) = ... # Part 2: First Schrodinger Solutions (Ch. 3, C, E, F) #* Ch. 3, 1-19,24,25,28,29,30,32,35 #* Ch. C, all problems except 10; Ch. E, prob. 7; and Ch. F, prob. 1-2,7,11 #** We will only multiply and take determinants of 2x2 matrices in this class, but adding larger matrices should be simple. #* [[Media:HW6.pdf | Supplemental Homework for Quiz 6]] # Part 3: Measurement, Observables, Speakable and Unspeakable (Ch. 4-5) #* Ch. 4, 1-3, 5, 7, 11, 14-16, 21-22 === Special Assignment for Quiz 4 === {| class="wikitable" |- | <math> f_1(x) = e^{ikx} </math> | <math> f_2(x) = 2 i e^{-2x} </math> | <math> f_3(x) = 7 x </math> | <math> f_4(x) = x^2 - 1 </math> | <math> f_5(x) = sin(2 \pi x/a) </math> |} # For each of the following operators, list all of the functions above which are eigenfunctions. There may be more than one. For each, also identify the corresponding eigenvalue. #* <math>\hat P = -i\hbar \frac{d}{dx}</math> #* <math>\hat S = 3</math> #* <math>\hat R = 2 x \frac{d}{dx} - 1</math> #* <math>\hat H = -c \frac{d^2}{dx^2} </math> # Find the normalization constant needed for each of the functions, <math>f_1 -- f_5</math> so that <math>\int_0^a (A_n f_n(x))^2 = 1</math> #* <math>A_1 = </math> #* <math>A_2 = </math> #* <math>A_3 = </math> #* <math>A_4 = </math> #* <math>A_5 = </math> # Complete the following problems from the text: #* 3-1 #* 3-3 #* 3-4 #* 3-5 #* 3-10 7d9fa0f93b04989f1671528b8db42718802f4b44 726 724 2019-03-18T22:54:10Z David M. Rogers 2 /* Resources */ wikitext text/x-wiki '''<BIG>Physical Chemistry II</BIG>''' Course Info * Course Numbers CHM 4411-001 * Credit Hours: 4 * Meeting Dates: Jan. 8 - Apr. 23, 2019 ** No Class Mar. 11-17 * Meeting Times: Tues. and Thurs., 9:30-10:45 am in ISA 3048 ** Problem Sessions: Fri., 11am-12 pm in ISA 3050 ** Regular quizzes on Fridays ** Office Hours: Fri., 10-11 am in IDR 200 * Grading: ** Quiz (30%) *** To succeed in the quiz, complete the homework and study the topics covered in the previous week! ** Exam 1 (20%) Fri., Feb. 8 11am-12pm (ISA 3050) ** Exam 2 (20%) Fri., Mar. 8, 11am-12pm (ISA 3050) ** Final (30%) Thurs., May 2 7:30-9:30am (ISA 3048) == Overview and Objectives == This course will introduce you to quantum theory, important for quantitatively describing atomic and molecular structure, chemical bonding and spectra. Students in this course will demonstrate the ability to apply the following ideas: * Relationship between mathematical models and intermolecular forces. * Explaining quantum states and their mathematical and physical properties. * Connecting observed molecular properties with quantum measurements. * Calculation of quantum energy levels and spectra. == Textbooks == * McQuarrie and Simon, Physical Chemistry: A Molecular Approach, University Science Books, 1997. ISBN: 0935702997. * Optional Extras: ** [http://www.feynmanlectures.caltech.edu/I_22.html Complex Algebra] ** [http://www.feynmanlectures.caltech.edu/I_23.html Damped, Driven Harmonic Oscillator] ** [http://www.feynmanlectures.caltech.edu/III_09.html The Ammonia Maser] ** [https://physicstoday.scitation.org/doi/10.1063/PT.3.2550 The Quantum Credo] ** [https://quantummechanics.ucsd.edu/ph130a/130_notes/130_notes.html Quantum Physics Online] (full year course) * Quantum Advances Nobel Prize Lectures ** [https://www.nobelprize.org/prizes/chemistry/2013/karplus/facts/ Karplus, Levitt and Warshel, 2013] ** [https://www.nobelprize.org/prizes/physics/2012/haroche/facts/ Haroche and Wineland, 2012] ** [https://www.nobelprize.org/prizes/physics/2005/hall/facts/ Glauber, Hall, and Hänsch, 2005] ** [https://www.nobelprize.org/prizes/chemistry/1998/kohn/facts/ Kohn and Pople, 1998] ** [https://www.nobelprize.org/prizes/chemistry/1992/marcus/facts/ Rudolph Marcus, 1992] ** [https://www.nobelprize.org/prizes/chemistry/1991/ernst/facts/ Richard Ernst, 1991] ** [https://www.nobelprize.org/prizes/physics/1954/born/facts/ Born and Bothe, 1954] ** [https://www.nobelprize.org/prizes/physics/1952/bloch/biographical/ Bloch and Purcell, 1952] ** [https://www.nobelprize.org/prizes/physics/1945/pauli/facts/ Wolfgang Pauli, 1945] ** [https://www.nobelprize.org/prizes/physics/1933/schrodinger/facts/ Schrödinger and Dirac, 1933] ** [https://www.nobelprize.org/prizes/physics/1932/heisenberg/facts/ Werner Heisenberg, 1932] ** [https://www.nobelprize.org/prizes/physics/1921/einstein/facts/ Albert Einstein, 1921] ** [https://www.nobelprize.org/prizes/physics/1918/planck/facts/ Max Planck, 1918] * Advanced reading: ** [https://dx.doi.org/10.1093/acprof:oso/9780198509141.001.0001 Exploring the Quantum: Atoms, Cavities, and Photons] (Haroche and Raimond's book) * Super-advanced reading: ** [https://doi.org/10.1017/9781316995457 Collapse of The Wave Function] == Resources == * Visualization of Modes: ** [https://www.youtube.com/watch?v=BE827gwnnk4 Wine Glass] ** [https://www.youtube.com/watch?v=v4ELxKKT5Rw&t=4s Drum Head] [https://youtu.be/QksHbCwYngw?t=5 see also] *** Note: Modes are indexed by 2 numbers for a 2D surface. ** [https://www.youtube.com/watch?v=Qf0t4qIVWF4 Another 2D example] *** This one is part-way between a particle in a 2D box and a circular drum, since the center is a special point. ** [https://www.youtube.com/watch?v=6JeyiM0YNo4 Violin String] *** Note: This looks like a sawtooth wave, so is less connected to quantum and more related to classical solitons. ** [https://youtu.be/0Ddr_ipAMqE?t=224 Cymbals] *** Note: This shows many modes excited at once, so it is not a simple shape. Quantum-mechanically, this situation is called a superposition. ** [https://www.youtube.com/watch?v=fMsjyQHtmiU Tacoma Narrows Bridge] *** Acoustic and vibrational modes are very important in mechanical structures. We will calculate them for atoms and optical cavities. ** [https://www.youtube.com/watch?v=RXPlHa5mRBE Audio in general] * Fundamental Dogma of Spectroscopy, <math>|E_2 - E_1| = h\nu</math> ** Here is Henri Poincaré's [https://www.gutenberg.org/files/37157/37157-pdf.pdf Science and Hypothesis], 1905. <blockquote> [On finding atomic causes of laboratory observations,] I shall only give one example which has always struck me rather forcibly. If I decompose white light, I shall be able to isolate a portion of the spectrum, but however small it may be, it will always be a certain width. In the same way the natural lights which are called monochromatic give us a very fine ray, but one which is not, however, infinitely fine. It might be supposed that in the experimental study of the properties of these natural lights, by operating with finer and finer rays, and passing on at last to the limit, so to speak, we should eventually obtain the properties of a rigorously monochromatic light. That would not be accurate. I assume that two rays emanate from the same source, that they are first polarised in planes at right angles, that they are then brought back again to the same plane of polarisation, and that we try to obtain interference. If the light were rigorously monochromatic, there would be interference; but with our nearly monochromatic lights, there will be no interference, and that, however narrow the ray may be. For it to be otherwise, the ray would have to be several million times finer than the finest known rays. </blockquote> ** He is saying that sunlight and light from incandescent bulbs has a continuous spectrum of all frequencies. Light from atomic transitions (like a high-pressure sodium lamp) has discrete spectral lines, but those ''still'' have a tiny line-width and two independent polarizations. This was not understood before the fundamental dogma of spectroscopy. The line-width is due to the energy-time uncertainty principle. * Quantum Computing ** [https://quantumexperience.ng.bluemix.net/qx/experience Experiment with IBM's Quantum Computer] * [https://predictivestatmech.org/papers/LifeAfterGraduation.pdf Life After Graduation] ** Sign up to [https://www.usf.edu/system/board-of-trustees/presidential-search-committee/meeting-schedule.aspx Attend an Executive Interview] == Assigned Homework Problems == # Part 1: Origins (Ch. 1, A, and 2) #* Ch. 1, 1-40 (we'll do 41-44 in class) #* Ch. A, 1-14 #** Hint on 12: use i = exp(...) #* Ch. 2, 1-16, 19 #** Hint on 1,2, and 4: use y(x) = A exp(ax) + B exp(b x) and check #** Hint on 5: use exp(i omega t) = ... # Part 2: First Schrodinger Solutions (Ch. 3, C, E, F) #* Ch. 3, 1-19,24,25,28,29,30,32,35 #* Ch. C, all problems except 10; Ch. E, prob. 7; and Ch. F, prob. 1-2,7,11 #** We will only multiply and take determinants of 2x2 matrices in this class, but adding larger matrices should be simple. #* [[Media:HW6.pdf | Supplemental Homework for Quiz 6]] # Part 3: Measurement, Observables, Speakable and Unspeakable (Ch. 4-5) #* Ch. 4, 1-3, 5, 7, 11, 14-16, 21-22 === Special Assignment for Quiz 4 === {| class="wikitable" |- | <math> f_1(x) = e^{ikx} </math> | <math> f_2(x) = 2 i e^{-2x} </math> | <math> f_3(x) = 7 x </math> | <math> f_4(x) = x^2 - 1 </math> | <math> f_5(x) = sin(2 \pi x/a) </math> |} # For each of the following operators, list all of the functions above which are eigenfunctions. There may be more than one. For each, also identify the corresponding eigenvalue. #* <math>\hat P = -i\hbar \frac{d}{dx}</math> #* <math>\hat S = 3</math> #* <math>\hat R = 2 x \frac{d}{dx} - 1</math> #* <math>\hat H = -c \frac{d^2}{dx^2} </math> # Find the normalization constant needed for each of the functions, <math>f_1 -- f_5</math> so that <math>\int_0^a (A_n f_n(x))^2 = 1</math> #* <math>A_1 = </math> #* <math>A_2 = </math> #* <math>A_3 = </math> #* <math>A_4 = </math> #* <math>A_5 = </math> # Complete the following problems from the text: #* 3-1 #* 3-3 #* 3-4 #* 3-5 #* 3-10 89af3c71496bf21d2218575fc551ed53c19af390 727 726 2019-03-19T19:30:15Z David M. Rogers 2 wikitext text/x-wiki '''<BIG>Physical Chemistry II</BIG>''' Course Info * Course Numbers CHM 4411-001 * Credit Hours: 4 * Meeting Dates: Jan. 8 - Apr. 23, 2019 ** No Class Mar. 11-17 * Meeting Times: Tues. and Thurs., 9:30-10:45 am in ISA 3048 ** Problem Sessions: Fri., 11am-12 pm in ISA 3050 ** Regular quizzes on Fridays ** Office Hours: Fri., 10-11 am in IDR 200 * Grading: ** Quiz (30%) *** To succeed in the quiz, complete the homework and study the topics covered in the previous week! ** Exam 1 (20%) Fri., Feb. 8 11am-12pm (ISA 3050) ** Exam 2 (20%) Fri., Mar. 8, 11am-12pm (ISA 3050) ** Final (30%) Thurs., May 2 7:30-9:30am (ISA 3048) == Overview and Objectives == This course will introduce you to quantum theory, important for quantitatively describing atomic and molecular structure, chemical bonding and spectra. Students in this course will demonstrate the ability to apply the following ideas: * Relationship between mathematical models and intermolecular forces. * Explaining quantum states and their mathematical and physical properties. * Connecting observed molecular properties with quantum measurements. * Calculation of quantum energy levels and spectra. == Textbooks == * McQuarrie and Simon, Physical Chemistry: A Molecular Approach, University Science Books, 1997. ISBN: 0935702997. * Optional Extras: ** [http://www.feynmanlectures.caltech.edu/I_22.html Complex Algebra] ** [http://www.feynmanlectures.caltech.edu/I_23.html Damped, Driven Harmonic Oscillator] ** [http://www.feynmanlectures.caltech.edu/III_09.html The Ammonia Maser] ** [https://physicstoday.scitation.org/doi/10.1063/PT.3.2550 The Quantum Credo] ** [https://quantummechanics.ucsd.edu/ph130a/130_notes/130_notes.html Quantum Physics Online] (full year course) * Quantum Advances Nobel Prize Lectures ** [https://www.nobelprize.org/prizes/chemistry/2013/karplus/facts/ Karplus, Levitt and Warshel, 2013] ** [https://www.nobelprize.org/prizes/physics/2012/haroche/facts/ Haroche and Wineland, 2012] ** [https://www.nobelprize.org/prizes/physics/2005/hall/facts/ Glauber, Hall, and Hänsch, 2005] ** [https://www.nobelprize.org/prizes/chemistry/1998/kohn/facts/ Kohn and Pople, 1998] ** [https://www.nobelprize.org/prizes/chemistry/1992/marcus/facts/ Rudolph Marcus, 1992] ** [https://www.nobelprize.org/prizes/chemistry/1991/ernst/facts/ Richard Ernst, 1991] ** [https://www.nobelprize.org/prizes/physics/1954/born/facts/ Born and Bothe, 1954] ** [https://www.nobelprize.org/prizes/physics/1952/bloch/biographical/ Bloch and Purcell, 1952] ** [https://www.nobelprize.org/prizes/physics/1945/pauli/facts/ Wolfgang Pauli, 1945] ** [https://www.nobelprize.org/prizes/physics/1933/schrodinger/facts/ Schrödinger and Dirac, 1933] ** [https://www.nobelprize.org/prizes/physics/1932/heisenberg/facts/ Werner Heisenberg, 1932] ** [https://www.nobelprize.org/prizes/physics/1921/einstein/facts/ Albert Einstein, 1921] ** [https://www.nobelprize.org/prizes/physics/1918/planck/facts/ Max Planck, 1918] * Advanced reading: ** [https://dx.doi.org/10.1093/acprof:oso/9780198509141.001.0001 Exploring the Quantum: Atoms, Cavities, and Photons] (Haroche and Raimond's book) * Super-advanced reading: ** [https://doi.org/10.1017/9781316995457 Collapse of The Wave Function] == Resources == * Visualization of Modes: ** [https://www.youtube.com/watch?v=BE827gwnnk4 Wine Glass] ** [https://www.youtube.com/watch?v=v4ELxKKT5Rw&t=4s Drum Head] [https://youtu.be/QksHbCwYngw?t=5 see also] *** Note: Modes are indexed by 2 numbers for a 2D surface. ** [https://www.youtube.com/watch?v=Qf0t4qIVWF4 Another 2D example] *** This one is part-way between a particle in a 2D box and a circular drum, since the center is a special point. ** [https://www.youtube.com/watch?v=6JeyiM0YNo4 Violin String] *** Note: This looks like a sawtooth wave, so is less connected to quantum and more related to classical solitons. ** [https://youtu.be/0Ddr_ipAMqE?t=224 Cymbals] *** Note: This shows many modes excited at once, so it is not a simple shape. Quantum-mechanically, this situation is called a superposition. ** [https://www.youtube.com/watch?v=fMsjyQHtmiU Tacoma Narrows Bridge] *** Acoustic and vibrational modes are very important in mechanical structures. We will calculate them for atoms and optical cavities. ** [https://www.youtube.com/watch?v=RXPlHa5mRBE Audio in general] * Fundamental Dogma of Spectroscopy, <math>|E_2 - E_1| = h\nu</math> ** Here is Henri Poincaré's [https://www.gutenberg.org/files/37157/37157-pdf.pdf Science and Hypothesis], 1905. <blockquote> [On finding atomic causes of laboratory observations,] I shall only give one example which has always struck me rather forcibly. If I decompose white light, I shall be able to isolate a portion of the spectrum, but however small it may be, it will always be a certain width. In the same way the natural lights which are called monochromatic give us a very fine ray, but one which is not, however, infinitely fine. It might be supposed that in the experimental study of the properties of these natural lights, by operating with finer and finer rays, and passing on at last to the limit, so to speak, we should eventually obtain the properties of a rigorously monochromatic light. That would not be accurate. I assume that two rays emanate from the same source, that they are first polarised in planes at right angles, that they are then brought back again to the same plane of polarisation, and that we try to obtain interference. If the light were rigorously monochromatic, there would be interference; but with our nearly monochromatic lights, there will be no interference, and that, however narrow the ray may be. For it to be otherwise, the ray would have to be several million times finer than the finest known rays. </blockquote> ** He is saying that sunlight and light from incandescent bulbs has a continuous spectrum of all frequencies. Light from atomic transitions (like a high-pressure sodium lamp) has discrete spectral lines, but those ''still'' have a tiny line-width and two independent polarizations. This was not understood before the fundamental dogma of spectroscopy. The line-width is due to the energy-time uncertainty principle. * Quantum Computing ** [https://quantumexperience.ng.bluemix.net/qx/experience Experiment with IBM's Quantum Computer] * [https://predictivestatmech.org/papers/LifeAfterGraduation.pdf Life After Graduation] ** Sign up to [https://www.usf.edu/system/board-of-trustees/presidential-search-committee/meeting-schedule.aspx Attend an Executive Interview] == Group Work == [[File:MeasProb1.jpg]] == Assigned Homework Problems == # Part 1: Origins (Ch. 1, A, and 2) #* Ch. 1, 1-40 (we'll do 41-44 in class) #* Ch. A, 1-14 #** Hint on 12: use i = exp(...) #* Ch. 2, 1-16, 19 #** Hint on 1,2, and 4: use y(x) = A exp(ax) + B exp(b x) and check #** Hint on 5: use exp(i omega t) = ... # Part 2: First Schrodinger Solutions (Ch. 3, C, E, F) #* Ch. 3, 1-19,24,25,28,29,30,32,35 #* Ch. C, all problems except 10; Ch. E, prob. 7; and Ch. F, prob. 1-2,7,11 #** We will only multiply and take determinants of 2x2 matrices in this class, but adding larger matrices should be simple. #* [[Media:HW6.pdf | Supplemental Homework for Quiz 6]] # Part 3: Measurement, Observables, Speakable and Unspeakable (Ch. 4-5) #* Ch. 4, 1-3, 5, 7, 11, 14-16, 21-22 === Special Assignment for Quiz 4 === {| class="wikitable" |- | <math> f_1(x) = e^{ikx} </math> | <math> f_2(x) = 2 i e^{-2x} </math> | <math> f_3(x) = 7 x </math> | <math> f_4(x) = x^2 - 1 </math> | <math> f_5(x) = sin(2 \pi x/a) </math> |} # For each of the following operators, list all of the functions above which are eigenfunctions. There may be more than one. For each, also identify the corresponding eigenvalue. #* <math>\hat P = -i\hbar \frac{d}{dx}</math> #* <math>\hat S = 3</math> #* <math>\hat R = 2 x \frac{d}{dx} - 1</math> #* <math>\hat H = -c \frac{d^2}{dx^2} </math> # Find the normalization constant needed for each of the functions, <math>f_1 -- f_5</math> so that <math>\int_0^a (A_n f_n(x))^2 = 1</math> #* <math>A_1 = </math> #* <math>A_2 = </math> #* <math>A_3 = </math> #* <math>A_4 = </math> #* <math>A_5 = </math> # Complete the following problems from the text: #* 3-1 #* 3-3 #* 3-4 #* 3-5 #* 3-10 a89895f02ba2cd0d6bd7692b0137f3c540b33339 728 727 2019-03-19T19:30:39Z David M. Rogers 2 /* Group Work */ wikitext text/x-wiki '''<BIG>Physical Chemistry II</BIG>''' Course Info * Course Numbers CHM 4411-001 * Credit Hours: 4 * Meeting Dates: Jan. 8 - Apr. 23, 2019 ** No Class Mar. 11-17 * Meeting Times: Tues. and Thurs., 9:30-10:45 am in ISA 3048 ** Problem Sessions: Fri., 11am-12 pm in ISA 3050 ** Regular quizzes on Fridays ** Office Hours: Fri., 10-11 am in IDR 200 * Grading: ** Quiz (30%) *** To succeed in the quiz, complete the homework and study the topics covered in the previous week! ** Exam 1 (20%) Fri., Feb. 8 11am-12pm (ISA 3050) ** Exam 2 (20%) Fri., Mar. 8, 11am-12pm (ISA 3050) ** Final (30%) Thurs., May 2 7:30-9:30am (ISA 3048) == Overview and Objectives == This course will introduce you to quantum theory, important for quantitatively describing atomic and molecular structure, chemical bonding and spectra. Students in this course will demonstrate the ability to apply the following ideas: * Relationship between mathematical models and intermolecular forces. * Explaining quantum states and their mathematical and physical properties. * Connecting observed molecular properties with quantum measurements. * Calculation of quantum energy levels and spectra. == Textbooks == * McQuarrie and Simon, Physical Chemistry: A Molecular Approach, University Science Books, 1997. ISBN: 0935702997. * Optional Extras: ** [http://www.feynmanlectures.caltech.edu/I_22.html Complex Algebra] ** [http://www.feynmanlectures.caltech.edu/I_23.html Damped, Driven Harmonic Oscillator] ** [http://www.feynmanlectures.caltech.edu/III_09.html The Ammonia Maser] ** [https://physicstoday.scitation.org/doi/10.1063/PT.3.2550 The Quantum Credo] ** [https://quantummechanics.ucsd.edu/ph130a/130_notes/130_notes.html Quantum Physics Online] (full year course) * Quantum Advances Nobel Prize Lectures ** [https://www.nobelprize.org/prizes/chemistry/2013/karplus/facts/ Karplus, Levitt and Warshel, 2013] ** [https://www.nobelprize.org/prizes/physics/2012/haroche/facts/ Haroche and Wineland, 2012] ** [https://www.nobelprize.org/prizes/physics/2005/hall/facts/ Glauber, Hall, and Hänsch, 2005] ** [https://www.nobelprize.org/prizes/chemistry/1998/kohn/facts/ Kohn and Pople, 1998] ** [https://www.nobelprize.org/prizes/chemistry/1992/marcus/facts/ Rudolph Marcus, 1992] ** [https://www.nobelprize.org/prizes/chemistry/1991/ernst/facts/ Richard Ernst, 1991] ** [https://www.nobelprize.org/prizes/physics/1954/born/facts/ Born and Bothe, 1954] ** [https://www.nobelprize.org/prizes/physics/1952/bloch/biographical/ Bloch and Purcell, 1952] ** [https://www.nobelprize.org/prizes/physics/1945/pauli/facts/ Wolfgang Pauli, 1945] ** [https://www.nobelprize.org/prizes/physics/1933/schrodinger/facts/ Schrödinger and Dirac, 1933] ** [https://www.nobelprize.org/prizes/physics/1932/heisenberg/facts/ Werner Heisenberg, 1932] ** [https://www.nobelprize.org/prizes/physics/1921/einstein/facts/ Albert Einstein, 1921] ** [https://www.nobelprize.org/prizes/physics/1918/planck/facts/ Max Planck, 1918] * Advanced reading: ** [https://dx.doi.org/10.1093/acprof:oso/9780198509141.001.0001 Exploring the Quantum: Atoms, Cavities, and Photons] (Haroche and Raimond's book) * Super-advanced reading: ** [https://doi.org/10.1017/9781316995457 Collapse of The Wave Function] == Resources == * Visualization of Modes: ** [https://www.youtube.com/watch?v=BE827gwnnk4 Wine Glass] ** [https://www.youtube.com/watch?v=v4ELxKKT5Rw&t=4s Drum Head] [https://youtu.be/QksHbCwYngw?t=5 see also] *** Note: Modes are indexed by 2 numbers for a 2D surface. ** [https://www.youtube.com/watch?v=Qf0t4qIVWF4 Another 2D example] *** This one is part-way between a particle in a 2D box and a circular drum, since the center is a special point. ** [https://www.youtube.com/watch?v=6JeyiM0YNo4 Violin String] *** Note: This looks like a sawtooth wave, so is less connected to quantum and more related to classical solitons. ** [https://youtu.be/0Ddr_ipAMqE?t=224 Cymbals] *** Note: This shows many modes excited at once, so it is not a simple shape. Quantum-mechanically, this situation is called a superposition. ** [https://www.youtube.com/watch?v=fMsjyQHtmiU Tacoma Narrows Bridge] *** Acoustic and vibrational modes are very important in mechanical structures. We will calculate them for atoms and optical cavities. ** [https://www.youtube.com/watch?v=RXPlHa5mRBE Audio in general] * Fundamental Dogma of Spectroscopy, <math>|E_2 - E_1| = h\nu</math> ** Here is Henri Poincaré's [https://www.gutenberg.org/files/37157/37157-pdf.pdf Science and Hypothesis], 1905. <blockquote> [On finding atomic causes of laboratory observations,] I shall only give one example which has always struck me rather forcibly. If I decompose white light, I shall be able to isolate a portion of the spectrum, but however small it may be, it will always be a certain width. In the same way the natural lights which are called monochromatic give us a very fine ray, but one which is not, however, infinitely fine. It might be supposed that in the experimental study of the properties of these natural lights, by operating with finer and finer rays, and passing on at last to the limit, so to speak, we should eventually obtain the properties of a rigorously monochromatic light. That would not be accurate. I assume that two rays emanate from the same source, that they are first polarised in planes at right angles, that they are then brought back again to the same plane of polarisation, and that we try to obtain interference. If the light were rigorously monochromatic, there would be interference; but with our nearly monochromatic lights, there will be no interference, and that, however narrow the ray may be. For it to be otherwise, the ray would have to be several million times finer than the finest known rays. </blockquote> ** He is saying that sunlight and light from incandescent bulbs has a continuous spectrum of all frequencies. Light from atomic transitions (like a high-pressure sodium lamp) has discrete spectral lines, but those ''still'' have a tiny line-width and two independent polarizations. This was not understood before the fundamental dogma of spectroscopy. The line-width is due to the energy-time uncertainty principle. * Quantum Computing ** [https://quantumexperience.ng.bluemix.net/qx/experience Experiment with IBM's Quantum Computer] * [https://predictivestatmech.org/papers/LifeAfterGraduation.pdf Life After Graduation] ** Sign up to [https://www.usf.edu/system/board-of-trustees/presidential-search-committee/meeting-schedule.aspx Attend an Executive Interview] == Group Work == [[File:MeasProb1.jpg]] [[File:MeasProb2.jpg]] [[File:MeasProb3.jpg]] [[File:MeasProb4.jpg]] [[File:MeasProb5.jpg]] == Assigned Homework Problems == # Part 1: Origins (Ch. 1, A, and 2) #* Ch. 1, 1-40 (we'll do 41-44 in class) #* Ch. A, 1-14 #** Hint on 12: use i = exp(...) #* Ch. 2, 1-16, 19 #** Hint on 1,2, and 4: use y(x) = A exp(ax) + B exp(b x) and check #** Hint on 5: use exp(i omega t) = ... # Part 2: First Schrodinger Solutions (Ch. 3, C, E, F) #* Ch. 3, 1-19,24,25,28,29,30,32,35 #* Ch. C, all problems except 10; Ch. E, prob. 7; and Ch. F, prob. 1-2,7,11 #** We will only multiply and take determinants of 2x2 matrices in this class, but adding larger matrices should be simple. #* [[Media:HW6.pdf | Supplemental Homework for Quiz 6]] # Part 3: Measurement, Observables, Speakable and Unspeakable (Ch. 4-5) #* Ch. 4, 1-3, 5, 7, 11, 14-16, 21-22 === Special Assignment for Quiz 4 === {| class="wikitable" |- | <math> f_1(x) = e^{ikx} </math> | <math> f_2(x) = 2 i e^{-2x} </math> | <math> f_3(x) = 7 x </math> | <math> f_4(x) = x^2 - 1 </math> | <math> f_5(x) = sin(2 \pi x/a) </math> |} # For each of the following operators, list all of the functions above which are eigenfunctions. There may be more than one. For each, also identify the corresponding eigenvalue. #* <math>\hat P = -i\hbar \frac{d}{dx}</math> #* <math>\hat S = 3</math> #* <math>\hat R = 2 x \frac{d}{dx} - 1</math> #* <math>\hat H = -c \frac{d^2}{dx^2} </math> # Find the normalization constant needed for each of the functions, <math>f_1 -- f_5</math> so that <math>\int_0^a (A_n f_n(x))^2 = 1</math> #* <math>A_1 = </math> #* <math>A_2 = </math> #* <math>A_3 = </math> #* <math>A_4 = </math> #* <math>A_5 = </math> # Complete the following problems from the text: #* 3-1 #* 3-3 #* 3-4 #* 3-5 #* 3-10 beb64c78eb209b072f960100cd539837446bdfc1 729 728 2019-03-19T19:30:54Z David M. Rogers 2 /* Group Work */ wikitext text/x-wiki '''<BIG>Physical Chemistry II</BIG>''' Course Info * Course Numbers CHM 4411-001 * Credit Hours: 4 * Meeting Dates: Jan. 8 - Apr. 23, 2019 ** No Class Mar. 11-17 * Meeting Times: Tues. and Thurs., 9:30-10:45 am in ISA 3048 ** Problem Sessions: Fri., 11am-12 pm in ISA 3050 ** Regular quizzes on Fridays ** Office Hours: Fri., 10-11 am in IDR 200 * Grading: ** Quiz (30%) *** To succeed in the quiz, complete the homework and study the topics covered in the previous week! ** Exam 1 (20%) Fri., Feb. 8 11am-12pm (ISA 3050) ** Exam 2 (20%) Fri., Mar. 8, 11am-12pm (ISA 3050) ** Final (30%) Thurs., May 2 7:30-9:30am (ISA 3048) == Overview and Objectives == This course will introduce you to quantum theory, important for quantitatively describing atomic and molecular structure, chemical bonding and spectra. Students in this course will demonstrate the ability to apply the following ideas: * Relationship between mathematical models and intermolecular forces. * Explaining quantum states and their mathematical and physical properties. * Connecting observed molecular properties with quantum measurements. * Calculation of quantum energy levels and spectra. == Textbooks == * McQuarrie and Simon, Physical Chemistry: A Molecular Approach, University Science Books, 1997. ISBN: 0935702997. * Optional Extras: ** [http://www.feynmanlectures.caltech.edu/I_22.html Complex Algebra] ** [http://www.feynmanlectures.caltech.edu/I_23.html Damped, Driven Harmonic Oscillator] ** [http://www.feynmanlectures.caltech.edu/III_09.html The Ammonia Maser] ** [https://physicstoday.scitation.org/doi/10.1063/PT.3.2550 The Quantum Credo] ** [https://quantummechanics.ucsd.edu/ph130a/130_notes/130_notes.html Quantum Physics Online] (full year course) * Quantum Advances Nobel Prize Lectures ** [https://www.nobelprize.org/prizes/chemistry/2013/karplus/facts/ Karplus, Levitt and Warshel, 2013] ** [https://www.nobelprize.org/prizes/physics/2012/haroche/facts/ Haroche and Wineland, 2012] ** [https://www.nobelprize.org/prizes/physics/2005/hall/facts/ Glauber, Hall, and Hänsch, 2005] ** [https://www.nobelprize.org/prizes/chemistry/1998/kohn/facts/ Kohn and Pople, 1998] ** [https://www.nobelprize.org/prizes/chemistry/1992/marcus/facts/ Rudolph Marcus, 1992] ** [https://www.nobelprize.org/prizes/chemistry/1991/ernst/facts/ Richard Ernst, 1991] ** [https://www.nobelprize.org/prizes/physics/1954/born/facts/ Born and Bothe, 1954] ** [https://www.nobelprize.org/prizes/physics/1952/bloch/biographical/ Bloch and Purcell, 1952] ** [https://www.nobelprize.org/prizes/physics/1945/pauli/facts/ Wolfgang Pauli, 1945] ** [https://www.nobelprize.org/prizes/physics/1933/schrodinger/facts/ Schrödinger and Dirac, 1933] ** [https://www.nobelprize.org/prizes/physics/1932/heisenberg/facts/ Werner Heisenberg, 1932] ** [https://www.nobelprize.org/prizes/physics/1921/einstein/facts/ Albert Einstein, 1921] ** [https://www.nobelprize.org/prizes/physics/1918/planck/facts/ Max Planck, 1918] * Advanced reading: ** [https://dx.doi.org/10.1093/acprof:oso/9780198509141.001.0001 Exploring the Quantum: Atoms, Cavities, and Photons] (Haroche and Raimond's book) * Super-advanced reading: ** [https://doi.org/10.1017/9781316995457 Collapse of The Wave Function] == Resources == * Visualization of Modes: ** [https://www.youtube.com/watch?v=BE827gwnnk4 Wine Glass] ** [https://www.youtube.com/watch?v=v4ELxKKT5Rw&t=4s Drum Head] [https://youtu.be/QksHbCwYngw?t=5 see also] *** Note: Modes are indexed by 2 numbers for a 2D surface. ** [https://www.youtube.com/watch?v=Qf0t4qIVWF4 Another 2D example] *** This one is part-way between a particle in a 2D box and a circular drum, since the center is a special point. ** [https://www.youtube.com/watch?v=6JeyiM0YNo4 Violin String] *** Note: This looks like a sawtooth wave, so is less connected to quantum and more related to classical solitons. ** [https://youtu.be/0Ddr_ipAMqE?t=224 Cymbals] *** Note: This shows many modes excited at once, so it is not a simple shape. Quantum-mechanically, this situation is called a superposition. ** [https://www.youtube.com/watch?v=fMsjyQHtmiU Tacoma Narrows Bridge] *** Acoustic and vibrational modes are very important in mechanical structures. We will calculate them for atoms and optical cavities. ** [https://www.youtube.com/watch?v=RXPlHa5mRBE Audio in general] * Fundamental Dogma of Spectroscopy, <math>|E_2 - E_1| = h\nu</math> ** Here is Henri Poincaré's [https://www.gutenberg.org/files/37157/37157-pdf.pdf Science and Hypothesis], 1905. <blockquote> [On finding atomic causes of laboratory observations,] I shall only give one example which has always struck me rather forcibly. If I decompose white light, I shall be able to isolate a portion of the spectrum, but however small it may be, it will always be a certain width. In the same way the natural lights which are called monochromatic give us a very fine ray, but one which is not, however, infinitely fine. It might be supposed that in the experimental study of the properties of these natural lights, by operating with finer and finer rays, and passing on at last to the limit, so to speak, we should eventually obtain the properties of a rigorously monochromatic light. That would not be accurate. I assume that two rays emanate from the same source, that they are first polarised in planes at right angles, that they are then brought back again to the same plane of polarisation, and that we try to obtain interference. If the light were rigorously monochromatic, there would be interference; but with our nearly monochromatic lights, there will be no interference, and that, however narrow the ray may be. For it to be otherwise, the ray would have to be several million times finer than the finest known rays. </blockquote> ** He is saying that sunlight and light from incandescent bulbs has a continuous spectrum of all frequencies. Light from atomic transitions (like a high-pressure sodium lamp) has discrete spectral lines, but those ''still'' have a tiny line-width and two independent polarizations. This was not understood before the fundamental dogma of spectroscopy. The line-width is due to the energy-time uncertainty principle. * Quantum Computing ** [https://quantumexperience.ng.bluemix.net/qx/experience Experiment with IBM's Quantum Computer] * [https://predictivestatmech.org/papers/LifeAfterGraduation.pdf Life After Graduation] ** Sign up to [https://www.usf.edu/system/board-of-trustees/presidential-search-committee/meeting-schedule.aspx Attend an Executive Interview] == Group Work == [[File:MeasProb1.jpg]] [[File:MeasProb2.jpg]] [[File:MeasProb3.jpg]] [[File:MeasProb4.jpg]] [[File:MeasProb5.jpg]] == Assigned Homework Problems == # Part 1: Origins (Ch. 1, A, and 2) #* Ch. 1, 1-40 (we'll do 41-44 in class) #* Ch. A, 1-14 #** Hint on 12: use i = exp(...) #* Ch. 2, 1-16, 19 #** Hint on 1,2, and 4: use y(x) = A exp(ax) + B exp(b x) and check #** Hint on 5: use exp(i omega t) = ... # Part 2: First Schrodinger Solutions (Ch. 3, C, E, F) #* Ch. 3, 1-19,24,25,28,29,30,32,35 #* Ch. C, all problems except 10; Ch. E, prob. 7; and Ch. F, prob. 1-2,7,11 #** We will only multiply and take determinants of 2x2 matrices in this class, but adding larger matrices should be simple. #* [[Media:HW6.pdf | Supplemental Homework for Quiz 6]] # Part 3: Measurement, Observables, Speakable and Unspeakable (Ch. 4-5) #* Ch. 4, 1-3, 5, 7, 11, 14-16, 21-22 === Special Assignment for Quiz 4 === {| class="wikitable" |- | <math> f_1(x) = e^{ikx} </math> | <math> f_2(x) = 2 i e^{-2x} </math> | <math> f_3(x) = 7 x </math> | <math> f_4(x) = x^2 - 1 </math> | <math> f_5(x) = sin(2 \pi x/a) </math> |} # For each of the following operators, list all of the functions above which are eigenfunctions. There may be more than one. For each, also identify the corresponding eigenvalue. #* <math>\hat P = -i\hbar \frac{d}{dx}</math> #* <math>\hat S = 3</math> #* <math>\hat R = 2 x \frac{d}{dx} - 1</math> #* <math>\hat H = -c \frac{d^2}{dx^2} </math> # Find the normalization constant needed for each of the functions, <math>f_1 -- f_5</math> so that <math>\int_0^a (A_n f_n(x))^2 = 1</math> #* <math>A_1 = </math> #* <math>A_2 = </math> #* <math>A_3 = </math> #* <math>A_4 = </math> #* <math>A_5 = </math> # Complete the following problems from the text: #* 3-1 #* 3-3 #* 3-4 #* 3-5 #* 3-10 606a6a38acf6001e754a5a001e9ac543d208fd19 735 729 2019-03-19T19:37:15Z David M. Rogers 2 /* Group Work */ wikitext text/x-wiki '''<BIG>Physical Chemistry II</BIG>''' Course Info * Course Numbers CHM 4411-001 * Credit Hours: 4 * Meeting Dates: Jan. 8 - Apr. 23, 2019 ** No Class Mar. 11-17 * Meeting Times: Tues. and Thurs., 9:30-10:45 am in ISA 3048 ** Problem Sessions: Fri., 11am-12 pm in ISA 3050 ** Regular quizzes on Fridays ** Office Hours: Fri., 10-11 am in IDR 200 * Grading: ** Quiz (30%) *** To succeed in the quiz, complete the homework and study the topics covered in the previous week! ** Exam 1 (20%) Fri., Feb. 8 11am-12pm (ISA 3050) ** Exam 2 (20%) Fri., Mar. 8, 11am-12pm (ISA 3050) ** Final (30%) Thurs., May 2 7:30-9:30am (ISA 3048) == Overview and Objectives == This course will introduce you to quantum theory, important for quantitatively describing atomic and molecular structure, chemical bonding and spectra. Students in this course will demonstrate the ability to apply the following ideas: * Relationship between mathematical models and intermolecular forces. * Explaining quantum states and their mathematical and physical properties. * Connecting observed molecular properties with quantum measurements. * Calculation of quantum energy levels and spectra. == Textbooks == * McQuarrie and Simon, Physical Chemistry: A Molecular Approach, University Science Books, 1997. ISBN: 0935702997. * Optional Extras: ** [http://www.feynmanlectures.caltech.edu/I_22.html Complex Algebra] ** [http://www.feynmanlectures.caltech.edu/I_23.html Damped, Driven Harmonic Oscillator] ** [http://www.feynmanlectures.caltech.edu/III_09.html The Ammonia Maser] ** [https://physicstoday.scitation.org/doi/10.1063/PT.3.2550 The Quantum Credo] ** [https://quantummechanics.ucsd.edu/ph130a/130_notes/130_notes.html Quantum Physics Online] (full year course) * Quantum Advances Nobel Prize Lectures ** [https://www.nobelprize.org/prizes/chemistry/2013/karplus/facts/ Karplus, Levitt and Warshel, 2013] ** [https://www.nobelprize.org/prizes/physics/2012/haroche/facts/ Haroche and Wineland, 2012] ** [https://www.nobelprize.org/prizes/physics/2005/hall/facts/ Glauber, Hall, and Hänsch, 2005] ** [https://www.nobelprize.org/prizes/chemistry/1998/kohn/facts/ Kohn and Pople, 1998] ** [https://www.nobelprize.org/prizes/chemistry/1992/marcus/facts/ Rudolph Marcus, 1992] ** [https://www.nobelprize.org/prizes/chemistry/1991/ernst/facts/ Richard Ernst, 1991] ** [https://www.nobelprize.org/prizes/physics/1954/born/facts/ Born and Bothe, 1954] ** [https://www.nobelprize.org/prizes/physics/1952/bloch/biographical/ Bloch and Purcell, 1952] ** [https://www.nobelprize.org/prizes/physics/1945/pauli/facts/ Wolfgang Pauli, 1945] ** [https://www.nobelprize.org/prizes/physics/1933/schrodinger/facts/ Schrödinger and Dirac, 1933] ** [https://www.nobelprize.org/prizes/physics/1932/heisenberg/facts/ Werner Heisenberg, 1932] ** [https://www.nobelprize.org/prizes/physics/1921/einstein/facts/ Albert Einstein, 1921] ** [https://www.nobelprize.org/prizes/physics/1918/planck/facts/ Max Planck, 1918] * Advanced reading: ** [https://dx.doi.org/10.1093/acprof:oso/9780198509141.001.0001 Exploring the Quantum: Atoms, Cavities, and Photons] (Haroche and Raimond's book) * Super-advanced reading: ** [https://doi.org/10.1017/9781316995457 Collapse of The Wave Function] == Resources == * Visualization of Modes: ** [https://www.youtube.com/watch?v=BE827gwnnk4 Wine Glass] ** [https://www.youtube.com/watch?v=v4ELxKKT5Rw&t=4s Drum Head] [https://youtu.be/QksHbCwYngw?t=5 see also] *** Note: Modes are indexed by 2 numbers for a 2D surface. ** [https://www.youtube.com/watch?v=Qf0t4qIVWF4 Another 2D example] *** This one is part-way between a particle in a 2D box and a circular drum, since the center is a special point. ** [https://www.youtube.com/watch?v=6JeyiM0YNo4 Violin String] *** Note: This looks like a sawtooth wave, so is less connected to quantum and more related to classical solitons. ** [https://youtu.be/0Ddr_ipAMqE?t=224 Cymbals] *** Note: This shows many modes excited at once, so it is not a simple shape. Quantum-mechanically, this situation is called a superposition. ** [https://www.youtube.com/watch?v=fMsjyQHtmiU Tacoma Narrows Bridge] *** Acoustic and vibrational modes are very important in mechanical structures. We will calculate them for atoms and optical cavities. ** [https://www.youtube.com/watch?v=RXPlHa5mRBE Audio in general] * Fundamental Dogma of Spectroscopy, <math>|E_2 - E_1| = h\nu</math> ** Here is Henri Poincaré's [https://www.gutenberg.org/files/37157/37157-pdf.pdf Science and Hypothesis], 1905. <blockquote> [On finding atomic causes of laboratory observations,] I shall only give one example which has always struck me rather forcibly. If I decompose white light, I shall be able to isolate a portion of the spectrum, but however small it may be, it will always be a certain width. In the same way the natural lights which are called monochromatic give us a very fine ray, but one which is not, however, infinitely fine. It might be supposed that in the experimental study of the properties of these natural lights, by operating with finer and finer rays, and passing on at last to the limit, so to speak, we should eventually obtain the properties of a rigorously monochromatic light. That would not be accurate. I assume that two rays emanate from the same source, that they are first polarised in planes at right angles, that they are then brought back again to the same plane of polarisation, and that we try to obtain interference. If the light were rigorously monochromatic, there would be interference; but with our nearly monochromatic lights, there will be no interference, and that, however narrow the ray may be. For it to be otherwise, the ray would have to be several million times finer than the finest known rays. </blockquote> ** He is saying that sunlight and light from incandescent bulbs has a continuous spectrum of all frequencies. Light from atomic transitions (like a high-pressure sodium lamp) has discrete spectral lines, but those ''still'' have a tiny line-width and two independent polarizations. This was not understood before the fundamental dogma of spectroscopy. The line-width is due to the energy-time uncertainty principle. * Quantum Computing ** [https://quantumexperience.ng.bluemix.net/qx/experience Experiment with IBM's Quantum Computer] * [https://predictivestatmech.org/papers/LifeAfterGraduation.pdf Life After Graduation] ** Sign up to [https://www.usf.edu/system/board-of-trustees/presidential-search-committee/meeting-schedule.aspx Attend an Executive Interview] == Group Work == [[File:MeasProb1.jpg|x100px]] [[File:MeasProb2.jpg|x100px]] [[File:MeasProb3.jpg|x100px]] [[File:MeasProb5.jpg|x100px]] [[File:MeasProb4.jpg|x100px]] == Assigned Homework Problems == # Part 1: Origins (Ch. 1, A, and 2) #* Ch. 1, 1-40 (we'll do 41-44 in class) #* Ch. A, 1-14 #** Hint on 12: use i = exp(...) #* Ch. 2, 1-16, 19 #** Hint on 1,2, and 4: use y(x) = A exp(ax) + B exp(b x) and check #** Hint on 5: use exp(i omega t) = ... # Part 2: First Schrodinger Solutions (Ch. 3, C, E, F) #* Ch. 3, 1-19,24,25,28,29,30,32,35 #* Ch. C, all problems except 10; Ch. E, prob. 7; and Ch. F, prob. 1-2,7,11 #** We will only multiply and take determinants of 2x2 matrices in this class, but adding larger matrices should be simple. #* [[Media:HW6.pdf | Supplemental Homework for Quiz 6]] # Part 3: Measurement, Observables, Speakable and Unspeakable (Ch. 4-5) #* Ch. 4, 1-3, 5, 7, 11, 14-16, 21-22 === Special Assignment for Quiz 4 === {| class="wikitable" |- | <math> f_1(x) = e^{ikx} </math> | <math> f_2(x) = 2 i e^{-2x} </math> | <math> f_3(x) = 7 x </math> | <math> f_4(x) = x^2 - 1 </math> | <math> f_5(x) = sin(2 \pi x/a) </math> |} # For each of the following operators, list all of the functions above which are eigenfunctions. There may be more than one. For each, also identify the corresponding eigenvalue. #* <math>\hat P = -i\hbar \frac{d}{dx}</math> #* <math>\hat S = 3</math> #* <math>\hat R = 2 x \frac{d}{dx} - 1</math> #* <math>\hat H = -c \frac{d^2}{dx^2} </math> # Find the normalization constant needed for each of the functions, <math>f_1 -- f_5</math> so that <math>\int_0^a (A_n f_n(x))^2 = 1</math> #* <math>A_1 = </math> #* <math>A_2 = </math> #* <math>A_3 = </math> #* <math>A_4 = </math> #* <math>A_5 = </math> # Complete the following problems from the text: #* 3-1 #* 3-3 #* 3-4 #* 3-5 #* 3-10 f3d9b5632d449a34bbb72c7563d8c81d77278b95 736 735 2019-03-21T20:46:27Z David M. Rogers 2 wikitext text/x-wiki '''<BIG>Physical Chemistry II</BIG>''' Course Info * Course Numbers CHM 4411-001 * Credit Hours: 4 * Meeting Dates: Jan. 8 - Apr. 23, 2019 ** No Class Mar. 11-17 * Meeting Times: Tues. and Thurs., 9:30-10:45 am in ISA 3048 ** Problem Sessions: Fri., 11am-12 pm in ISA 3050 ** Regular quizzes on Fridays ** Office Hours: Fri., 10-11 am in IDR 200 * Grading: ** Quiz (30%) *** To succeed in the quiz, complete the homework and study the topics covered in the previous week! ** Exam 1 (20%) Fri., Feb. 8 11am-12pm (ISA 3050) ** Exam 2 (20%) Fri., Mar. 8, 11am-12pm (ISA 3050) ** Final (30%) Thurs., May 2 7:30-9:30am (ISA 3048) == Overview and Objectives == This course will introduce you to quantum theory, important for quantitatively describing atomic and molecular structure, chemical bonding and spectra. Students in this course will demonstrate the ability to apply the following ideas: * Relationship between mathematical models and intermolecular forces. * Explaining quantum states and their mathematical and physical properties. * Connecting observed molecular properties with quantum measurements. * Calculation of quantum energy levels and spectra. == Textbooks == * McQuarrie and Simon, Physical Chemistry: A Molecular Approach, University Science Books, 1997. ISBN: 0935702997. * Optional Extras: ** [http://www.feynmanlectures.caltech.edu/I_22.html Complex Algebra] ** [http://www.feynmanlectures.caltech.edu/I_23.html Damped, Driven Harmonic Oscillator] ** [http://www.feynmanlectures.caltech.edu/III_09.html The Ammonia Maser] ** [https://physicstoday.scitation.org/doi/10.1063/PT.3.2550 The Quantum Credo] ** [https://quantummechanics.ucsd.edu/ph130a/130_notes/130_notes.html Quantum Physics Online] (full year course) * Quantum Advances Nobel Prize Lectures ** [https://www.nobelprize.org/prizes/chemistry/2013/karplus/facts/ Karplus, Levitt and Warshel, 2013] ** [https://www.nobelprize.org/prizes/physics/2012/haroche/facts/ Haroche and Wineland, 2012] ** [https://www.nobelprize.org/prizes/physics/2005/hall/facts/ Glauber, Hall, and Hänsch, 2005] ** [https://www.nobelprize.org/prizes/chemistry/1998/kohn/facts/ Kohn and Pople, 1998] ** [https://www.nobelprize.org/prizes/chemistry/1992/marcus/facts/ Rudolph Marcus, 1992] ** [https://www.nobelprize.org/prizes/chemistry/1991/ernst/facts/ Richard Ernst, 1991] ** [https://www.nobelprize.org/prizes/physics/1954/born/facts/ Born and Bothe, 1954] ** [https://www.nobelprize.org/prizes/physics/1952/bloch/biographical/ Bloch and Purcell, 1952] ** [https://www.nobelprize.org/prizes/physics/1945/pauli/facts/ Wolfgang Pauli, 1945] ** [https://www.nobelprize.org/prizes/physics/1933/schrodinger/facts/ Schrödinger and Dirac, 1933] ** [https://www.nobelprize.org/prizes/physics/1932/heisenberg/facts/ Werner Heisenberg, 1932] ** [https://www.nobelprize.org/prizes/physics/1921/einstein/facts/ Albert Einstein, 1921] ** [https://www.nobelprize.org/prizes/physics/1918/planck/facts/ Max Planck, 1918] * Advanced reading: ** [https://dx.doi.org/10.1093/acprof:oso/9780198509141.001.0001 Exploring the Quantum: Atoms, Cavities, and Photons] (Haroche and Raimond's book) * Super-advanced reading: ** [https://doi.org/10.1017/9781316995457 Collapse of The Wave Function] == Resources == * Visualization of Modes: ** [https://www.youtube.com/watch?v=BE827gwnnk4 Wine Glass] ** [https://www.youtube.com/watch?v=v4ELxKKT5Rw&t=4s Drum Head] [https://youtu.be/QksHbCwYngw?t=5 see also] *** Note: Modes are indexed by 2 numbers for a 2D surface. ** [https://www.youtube.com/watch?v=Qf0t4qIVWF4 Another 2D example] *** This one is part-way between a particle in a 2D box and a circular drum, since the center is a special point. ** [https://www.youtube.com/watch?v=6JeyiM0YNo4 Violin String] *** Note: This looks like a sawtooth wave, so is less connected to quantum and more related to classical solitons. ** [https://youtu.be/0Ddr_ipAMqE?t=224 Cymbals] *** Note: This shows many modes excited at once, so it is not a simple shape. Quantum-mechanically, this situation is called a superposition. ** [https://www.youtube.com/watch?v=fMsjyQHtmiU Tacoma Narrows Bridge] *** Acoustic and vibrational modes are very important in mechanical structures. We will calculate them for atoms and optical cavities. ** [https://www.youtube.com/watch?v=RXPlHa5mRBE Audio in general] * Fundamental Dogma of Spectroscopy, <math>|E_2 - E_1| = h\nu</math> ** Here is Henri Poincaré's [https://www.gutenberg.org/files/37157/37157-pdf.pdf Science and Hypothesis], 1905. <blockquote> [On finding atomic causes of laboratory observations,] I shall only give one example which has always struck me rather forcibly. If I decompose white light, I shall be able to isolate a portion of the spectrum, but however small it may be, it will always be a certain width. In the same way the natural lights which are called monochromatic give us a very fine ray, but one which is not, however, infinitely fine. It might be supposed that in the experimental study of the properties of these natural lights, by operating with finer and finer rays, and passing on at last to the limit, so to speak, we should eventually obtain the properties of a rigorously monochromatic light. That would not be accurate. I assume that two rays emanate from the same source, that they are first polarised in planes at right angles, that they are then brought back again to the same plane of polarisation, and that we try to obtain interference. If the light were rigorously monochromatic, there would be interference; but with our nearly monochromatic lights, there will be no interference, and that, however narrow the ray may be. For it to be otherwise, the ray would have to be several million times finer than the finest known rays. </blockquote> ** He is saying that sunlight and light from incandescent bulbs has a continuous spectrum of all frequencies. Light from atomic transitions (like a high-pressure sodium lamp) has discrete spectral lines, but those ''still'' have a tiny line-width and two independent polarizations. This was not understood before the fundamental dogma of spectroscopy. The line-width is due to the energy-time uncertainty principle. * Quantum Computing ** [https://quantumexperience.ng.bluemix.net/qx/experience Experiment with IBM's Quantum Computer] * [https://predictivestatmech.org/papers/LifeAfterGraduation.pdf Life After Graduation] ** Sign up to [https://www.usf.edu/system/board-of-trustees/presidential-search-committee/meeting-schedule.aspx Attend an Executive Interview] == Group Work == [[File:MeasProb1.jpg|x100px]] [[File:MeasProb2.jpg|x100px]] [[File:MeasProb3.jpg|x100px]] [[File:MeasProb5.jpg|x100px]] [[File:MeasProb4.jpg|x100px]] == Assigned Homework Problems == # Part 1: Origins (Ch. 1, A, and 2) #* Ch. 1, 1-40 (we'll do 41-44 in class) #* Ch. A, 1-14 #** Hint on 12: use i = exp(...) #* Ch. 2, 1-16, 19 #** Hint on 1,2, and 4: use y(x) = A exp(ax) + B exp(b x) and check #** Hint on 5: use exp(i omega t) = ... # Part 2: First Schrodinger Solutions (Ch. 3, C, E, F) #* Ch. 3, 1-19,24,25,28,29,30,32,35 #* Ch. C, all problems except 10; Ch. E, prob. 7; and Ch. F, prob. 1-2,7,11 #** We will only multiply and take determinants of 2x2 matrices in this class, but adding larger matrices should be simple. #* [[Media:HW6.pdf | Supplemental Homework for Quiz 6]] # Part 3: Measurement, Observables, Speakable and Unspeakable (Ch. 4-5) #* Ch. 4, 1-3, 5, 7, 11, 14-16, 21-22 === Special Assignment for Quiz 4 === {| class="wikitable" |- | <math> f_1(x) = e^{ikx} </math> | <math> f_2(x) = 2 i e^{-2x} </math> | <math> f_3(x) = 7 x </math> | <math> f_4(x) = x^2 - 1 </math> | <math> f_5(x) = sin(2 \pi x/a) </math> |} # For each of the following operators, list all of the functions above which are eigenfunctions. There may be more than one. For each, also identify the corresponding eigenvalue. #* <math>\hat P = -i\hbar \frac{d}{dx}</math> #* <math>\hat S = 3</math> #* <math>\hat R = 2 x \frac{d}{dx} - 1</math> #* <math>\hat H = -c \frac{d^2}{dx^2} </math> # Find the normalization constant needed for each of the functions, <math>f_1 -- f_5</math> so that <math>\int_0^a (A_n f_n(x))^2 = 1</math> #* <math>A_1 = </math> #* <math>A_2 = </math> #* <math>A_3 = </math> #* <math>A_4 = </math> #* <math>A_5 = </math> # Complete the following problems from the text: #* 3-1 #* 3-3 #* 3-4 #* 3-5 #* 3-10 === Special Assignment for Quiz 7 === # Provide, in your own words, definitions for each of the following: complete basis, expectation value, commutator, Hermitian operator, dimension, tunneling, nonlinear process, symmetry, continuous / continuity, integrable, divergent (of an expression), "existence" (of a math expression) # In the classical Bell experiment, a pair of 2 entangled particles are created in state <math>|\psi\rangle = (|0,1\rangle + |1,0\rangle)/\sqrt{2}</math>. A quantum circuit for creating such Bell states is given by the image below. Compute the final state of track (b) after each of the following measurements has occurred. Note that the two tracks are symmetric, so we can arbitrarily call the first quantum number ''track (a)'' and the second ''track (b)''. For hints, see the note on partial projection. #* Track (a) is measured and found to be in state <math>|0\rangle</math>. #* Track (a) is measured and found to be in state <math>|1\rangle</math>. #* Track (a) is measured and found to be in state <math>(|0\rangle+|1\rangle)/\sqrt{2}</math>. # Under the first scenario (track (a) is in state <math>|0\rangle</math>), what is the probability that track (b) can be measured in state <math>\cos(\theta)|0\rangle + \sin(\theta)|1\rangle</math>? Compare this to the Bell-state correlation function [https://en.wikipedia.org/wiki/Bell%27s_theorem]. Partial projection is what happens to a quantum state when only one part of it is measured. The measured part must be projected into its known answer, while the rest of the state merely goes along for the ride. For our purposes, to do the partial projection of <math>|\psi\rangle</math> which results from finding that track (a) has state <math>|v\rangle</math>, compute <math>\langle v, ?| \psi \rangle</math> using <math>\langle v, ?| = (\langle v|)(\langle ?|)</math> and use distributivity and orthogonality to get rid of all the track (a) state information. Factor off the <math>(\langle ?|)</math> and normalize the result to get the final state of track (b). [[File:BellIBM.jpg]] 04b824aa29d290dbfe4772e33c46fbbd40caf368 738 736 2019-03-21T21:11:36Z David M. Rogers 2 wikitext text/x-wiki '''<BIG>Physical Chemistry II</BIG>''' Course Info * Course Numbers CHM 4411-001 * Credit Hours: 4 * Meeting Dates: Jan. 8 - Apr. 23, 2019 ** No Class Mar. 11-17 * Meeting Times: Tues. and Thurs., 9:30-10:45 am in ISA 3048 ** Problem Sessions: Fri., 11am-12 pm in ISA 3050 ** Regular quizzes on Fridays ** Office Hours: Fri., 10-11 am in IDR 200 * Grading: ** Quiz (30%) *** To succeed in the quiz, complete the homework and study the topics covered in the previous week! ** Exam 1 (20%) Fri., Feb. 8 11am-12pm (ISA 3050) ** Exam 2 (20%) Fri., Mar. 8, 11am-12pm (ISA 3050) ** Final (30%) Thurs., May 2 7:30-9:30am (ISA 3048) == Overview and Objectives == This course will introduce you to quantum theory, important for quantitatively describing atomic and molecular structure, chemical bonding and spectra. Students in this course will demonstrate the ability to apply the following ideas: * Relationship between mathematical models and intermolecular forces. * Explaining quantum states and their mathematical and physical properties. * Connecting observed molecular properties with quantum measurements. * Calculation of quantum energy levels and spectra. == Textbooks == * McQuarrie and Simon, Physical Chemistry: A Molecular Approach, University Science Books, 1997. ISBN: 0935702997. * Optional Extras: ** [http://www.feynmanlectures.caltech.edu/I_22.html Complex Algebra] ** [http://www.feynmanlectures.caltech.edu/I_23.html Damped, Driven Harmonic Oscillator] ** [http://www.feynmanlectures.caltech.edu/III_09.html The Ammonia Maser] ** [https://physicstoday.scitation.org/doi/10.1063/PT.3.2550 The Quantum Credo] ** [https://quantummechanics.ucsd.edu/ph130a/130_notes/130_notes.html Quantum Physics Online] (full year course) * Quantum Advances Nobel Prize Lectures ** [https://www.nobelprize.org/prizes/chemistry/2013/karplus/facts/ Karplus, Levitt and Warshel, 2013] ** [https://www.nobelprize.org/prizes/physics/2012/haroche/facts/ Haroche and Wineland, 2012] ** [https://www.nobelprize.org/prizes/physics/2005/hall/facts/ Glauber, Hall, and Hänsch, 2005] ** [https://www.nobelprize.org/prizes/chemistry/1998/kohn/facts/ Kohn and Pople, 1998] ** [https://www.nobelprize.org/prizes/chemistry/1992/marcus/facts/ Rudolph Marcus, 1992] ** [https://www.nobelprize.org/prizes/chemistry/1991/ernst/facts/ Richard Ernst, 1991] ** [https://www.nobelprize.org/prizes/physics/1954/born/facts/ Born and Bothe, 1954] ** [https://www.nobelprize.org/prizes/physics/1952/bloch/biographical/ Bloch and Purcell, 1952] ** [https://www.nobelprize.org/prizes/physics/1945/pauli/facts/ Wolfgang Pauli, 1945] ** [https://www.nobelprize.org/prizes/physics/1933/schrodinger/facts/ Schrödinger and Dirac, 1933] ** [https://www.nobelprize.org/prizes/physics/1932/heisenberg/facts/ Werner Heisenberg, 1932] ** [https://www.nobelprize.org/prizes/physics/1921/einstein/facts/ Albert Einstein, 1921] ** [https://www.nobelprize.org/prizes/physics/1918/planck/facts/ Max Planck, 1918] * Advanced reading: ** [https://dx.doi.org/10.1093/acprof:oso/9780198509141.001.0001 Exploring the Quantum: Atoms, Cavities, and Photons] (Haroche and Raimond's book) * Super-advanced reading: ** [https://doi.org/10.1017/9781316995457 Collapse of The Wave Function] == Resources == * Visualization of Modes: ** [https://www.youtube.com/watch?v=BE827gwnnk4 Wine Glass] ** [https://www.youtube.com/watch?v=v4ELxKKT5Rw&t=4s Drum Head] [https://youtu.be/QksHbCwYngw?t=5 see also] *** Note: Modes are indexed by 2 numbers for a 2D surface. ** [https://www.youtube.com/watch?v=Qf0t4qIVWF4 Another 2D example] *** This one is part-way between a particle in a 2D box and a circular drum, since the center is a special point. ** [https://www.youtube.com/watch?v=6JeyiM0YNo4 Violin String] *** Note: This looks like a sawtooth wave, so is less connected to quantum and more related to classical solitons. ** [https://youtu.be/0Ddr_ipAMqE?t=224 Cymbals] *** Note: This shows many modes excited at once, so it is not a simple shape. Quantum-mechanically, this situation is called a superposition. ** [https://www.youtube.com/watch?v=fMsjyQHtmiU Tacoma Narrows Bridge] *** Acoustic and vibrational modes are very important in mechanical structures. We will calculate them for atoms and optical cavities. ** [https://www.youtube.com/watch?v=RXPlHa5mRBE Audio in general] * Fundamental Dogma of Spectroscopy, <math>|E_2 - E_1| = h\nu</math> ** Here is Henri Poincaré's [https://www.gutenberg.org/files/37157/37157-pdf.pdf Science and Hypothesis], 1905. <blockquote> [On finding atomic causes of laboratory observations,] I shall only give one example which has always struck me rather forcibly. If I decompose white light, I shall be able to isolate a portion of the spectrum, but however small it may be, it will always be a certain width. In the same way the natural lights which are called monochromatic give us a very fine ray, but one which is not, however, infinitely fine. It might be supposed that in the experimental study of the properties of these natural lights, by operating with finer and finer rays, and passing on at last to the limit, so to speak, we should eventually obtain the properties of a rigorously monochromatic light. That would not be accurate. I assume that two rays emanate from the same source, that they are first polarised in planes at right angles, that they are then brought back again to the same plane of polarisation, and that we try to obtain interference. If the light were rigorously monochromatic, there would be interference; but with our nearly monochromatic lights, there will be no interference, and that, however narrow the ray may be. For it to be otherwise, the ray would have to be several million times finer than the finest known rays. </blockquote> ** He is saying that sunlight and light from incandescent bulbs has a continuous spectrum of all frequencies. Light from atomic transitions (like a high-pressure sodium lamp) has discrete spectral lines, but those ''still'' have a tiny line-width and two independent polarizations. This was not understood before the fundamental dogma of spectroscopy. The line-width is due to the energy-time uncertainty principle. * Quantum Computing ** [https://quantumexperience.ng.bluemix.net/qx/experience Experiment with IBM's Quantum Computer] * [https://predictivestatmech.org/papers/LifeAfterGraduation.pdf Life After Graduation] ** Sign up to [https://www.usf.edu/system/board-of-trustees/presidential-search-committee/meeting-schedule.aspx Attend an Executive Interview] == Group Work == [[File:MeasProb1.jpg|x100px]] [[File:MeasProb2.jpg|x100px]] [[File:MeasProb3.jpg|x100px]] [[File:MeasProb5.jpg|x100px]] [[File:MeasProb4.jpg|x100px]] == Assigned Homework Problems == # Part 1: Origins (Ch. 1, A, and 2) #* Ch. 1, 1-40 (we'll do 41-44 in class) #* Ch. A, 1-14 #** Hint on 12: use i = exp(...) #* Ch. 2, 1-16, 19 #** Hint on 1,2, and 4: use y(x) = A exp(ax) + B exp(b x) and check #** Hint on 5: use exp(i omega t) = ... # Part 2: First Schrodinger Solutions (Ch. 3, C, E, F) #* Ch. 3, 1-19,24,25,28,29,30,32,35 #* Ch. C, all problems except 10; Ch. E, prob. 7; and Ch. F, prob. 1-2,7,11 #** We will only multiply and take determinants of 2x2 matrices in this class, but adding larger matrices should be simple. #* [[Media:HW6.pdf | Supplemental Homework for Quiz 6]] # Part 3: Measurement, Observables, Speakable and Unspeakable (Ch. 4-5) #* Ch. 4, 1-3, 5, 7, 11, 14-16, 21-22 === Special Assignment for Quiz 4 === {| class="wikitable" |- | <math> f_1(x) = e^{ikx} </math> | <math> f_2(x) = 2 i e^{-2x} </math> | <math> f_3(x) = 7 x </math> | <math> f_4(x) = x^2 - 1 </math> | <math> f_5(x) = sin(2 \pi x/a) </math> |} # For each of the following operators, list all of the functions above which are eigenfunctions. There may be more than one. For each, also identify the corresponding eigenvalue. #* <math>\hat P = -i\hbar \frac{d}{dx}</math> #* <math>\hat S = 3</math> #* <math>\hat R = 2 x \frac{d}{dx} - 1</math> #* <math>\hat H = -c \frac{d^2}{dx^2} </math> # Find the normalization constant needed for each of the functions, <math>f_1 -- f_5</math> so that <math>\int_0^a (A_n f_n(x))^2 = 1</math> #* <math>A_1 = </math> #* <math>A_2 = </math> #* <math>A_3 = </math> #* <math>A_4 = </math> #* <math>A_5 = </math> # Complete the following problems from the text: #* 3-1 #* 3-3 #* 3-4 #* 3-5 #* 3-10 === Special Assignment for Quiz 7 === # Provide, in your own words, definitions for each of the following: complete basis, expectation value, commutator, Hermitian operator, dimension, tunneling, nonlinear process, symmetry, continuous / continuity, integrable, divergent (of an expression), "existence" (of a math expression) # In the classical Bell experiment, a pair of 2 entangled particles are created in state <math>|\psi\rangle = (|0,1\rangle + |1,0\rangle)/\sqrt{2}</math>. A quantum circuit for creating such Bell states is given by the image below. Compute the final state of track (b) after each of the following measurements has occurred. Note that the two tracks are symmetric, so we can arbitrarily call the first quantum number ''track (a)'' and the second ''track (b)''. For hints, see the note on partial projection. #* Track (a) is measured and found to be in state <math>|0\rangle</math>. #* Track (a) is measured and found to be in state <math>|1\rangle</math>. #* Track (a) is measured and found to be in state <math>(|0\rangle+|1\rangle)/\sqrt{2}</math>. # Under the first scenario (track (a) is in state <math>|0\rangle</math>), what is the probability that track (b) can be measured in state <math>\cos(\theta)|0\rangle + \sin(\theta)|1\rangle</math>? Compare this to the Bell-state correlation function [https://en.wikipedia.org/wiki/Bell%27s_theorem]. Partial projection is what happens to a quantum state when only one part of it is measured. The measured part must be projected into its known answer, while the rest of the state merely goes along for the ride. For our purposes, to do the partial projection of <math>|\psi\rangle</math> which results from finding that track (a) has state <math>|v\rangle</math>, compute <math>\langle v, ?| \psi \rangle</math> using <math>\langle v, ?| = (\langle v|)(\langle ?|)</math> and use distributivity and orthogonality to get rid of all the track (a) state information. Factor off the <math>(\langle ?|)</math> and normalize the result to get the final state of track (b). [[File:BellIBM.png|x100px]] 55421f6669887c0b44c32131f364ed47a5b04317 739 738 2019-03-23T22:52:05Z David M. Rogers 2 wikitext text/x-wiki '''<BIG>Physical Chemistry II</BIG>''' Course Info * Course Numbers CHM 4411-001 * Credit Hours: 4 * Meeting Dates: Jan. 8 - Apr. 23, 2019 ** No Class Mar. 11-17 * Meeting Times: Tues. and Thurs., 9:30-10:45 am in ISA 3048 ** Problem Sessions: Fri., 11am-12 pm in ISA 3050 ** Regular quizzes on Fridays ** Office Hours: Fri., 10-11 am in IDR 200 * Grading: ** Quiz (30%) *** To succeed in the quiz, complete the homework and study the topics covered in the previous week! ** Exam 1 (20%) Fri., Feb. 8 11am-12pm (ISA 3050) ** Exam 2 (20%) Fri., Mar. 8, 11am-12pm (ISA 3050) ** Final (30%) Thurs., May 2 7:30-9:30am (ISA 3048) == Overview and Objectives == This course will introduce you to quantum theory, important for quantitatively describing atomic and molecular structure, chemical bonding and spectra. Students in this course will demonstrate the ability to apply the following ideas: * Relationship between mathematical models and intermolecular forces. * Explaining quantum states and their mathematical and physical properties. * Connecting observed molecular properties with quantum measurements. * Calculation of quantum energy levels and spectra. == Textbooks == * McQuarrie and Simon, Physical Chemistry: A Molecular Approach, University Science Books, 1997. ISBN: 0935702997. * Optional Extras: ** [http://www.feynmanlectures.caltech.edu/I_22.html Complex Algebra] ** [http://www.feynmanlectures.caltech.edu/I_23.html Damped, Driven Harmonic Oscillator] ** [http://www.feynmanlectures.caltech.edu/III_09.html The Ammonia Maser] ** [https://physicstoday.scitation.org/doi/10.1063/PT.3.2550 The Quantum Credo] ** [https://quantummechanics.ucsd.edu/ph130a/130_notes/130_notes.html Quantum Physics Online] (full year course) * Quantum Advances Nobel Prize Lectures ** [https://www.nobelprize.org/prizes/chemistry/2013/karplus/facts/ Karplus, Levitt and Warshel, 2013] ** [https://www.nobelprize.org/prizes/physics/2012/haroche/facts/ Haroche and Wineland, 2012] ** [https://www.nobelprize.org/prizes/physics/2005/hall/facts/ Glauber, Hall, and Hänsch, 2005] ** [https://www.nobelprize.org/prizes/chemistry/1998/kohn/facts/ Kohn and Pople, 1998] ** [https://www.nobelprize.org/prizes/chemistry/1992/marcus/facts/ Rudolph Marcus, 1992] ** [https://www.nobelprize.org/prizes/chemistry/1991/ernst/facts/ Richard Ernst, 1991] ** [https://www.nobelprize.org/prizes/physics/1954/born/facts/ Born and Bothe, 1954] ** [https://www.nobelprize.org/prizes/physics/1952/bloch/biographical/ Bloch and Purcell, 1952] ** [https://www.nobelprize.org/prizes/physics/1945/pauli/facts/ Wolfgang Pauli, 1945] ** [https://www.nobelprize.org/prizes/physics/1933/schrodinger/facts/ Schrödinger and Dirac, 1933] ** [https://www.nobelprize.org/prizes/physics/1932/heisenberg/facts/ Werner Heisenberg, 1932] ** [https://www.nobelprize.org/prizes/physics/1921/einstein/facts/ Albert Einstein, 1921] ** [https://www.nobelprize.org/prizes/physics/1918/planck/facts/ Max Planck, 1918] * Advanced reading: ** [https://dx.doi.org/10.1093/acprof:oso/9780198509141.001.0001 Exploring the Quantum: Atoms, Cavities, and Photons] (Haroche and Raimond's book) * Super-advanced reading: ** [https://doi.org/10.1017/9781316995457 Collapse of The Wave Function] == Resources == * Visualization of Modes: ** [https://www.youtube.com/watch?v=BE827gwnnk4 Wine Glass] ** [https://www.youtube.com/watch?v=v4ELxKKT5Rw&t=4s Drum Head] [https://youtu.be/QksHbCwYngw?t=5 see also] *** Note: Modes are indexed by 2 numbers for a 2D surface. ** [https://www.youtube.com/watch?v=Qf0t4qIVWF4 Another 2D example] *** This one is part-way between a particle in a 2D box and a circular drum, since the center is a special point. ** [https://www.youtube.com/watch?v=6JeyiM0YNo4 Violin String] *** Note: This looks like a sawtooth wave, so is less connected to quantum and more related to classical solitons. ** [https://youtu.be/0Ddr_ipAMqE?t=224 Cymbals] *** Note: This shows many modes excited at once, so it is not a simple shape. Quantum-mechanically, this situation is called a superposition. ** [https://www.youtube.com/watch?v=fMsjyQHtmiU Tacoma Narrows Bridge] *** Acoustic and vibrational modes are very important in mechanical structures. We will calculate them for atoms and optical cavities. ** [https://www.youtube.com/watch?v=RXPlHa5mRBE Audio in general] * Fundamental Dogma of Spectroscopy, <math>|E_2 - E_1| = h\nu</math> ** Here is Henri Poincaré's [https://www.gutenberg.org/files/37157/37157-pdf.pdf Science and Hypothesis], 1905. <blockquote> [On finding atomic causes of laboratory observations,] I shall only give one example which has always struck me rather forcibly. If I decompose white light, I shall be able to isolate a portion of the spectrum, but however small it may be, it will always be a certain width. In the same way the natural lights which are called monochromatic give us a very fine ray, but one which is not, however, infinitely fine. It might be supposed that in the experimental study of the properties of these natural lights, by operating with finer and finer rays, and passing on at last to the limit, so to speak, we should eventually obtain the properties of a rigorously monochromatic light. That would not be accurate. I assume that two rays emanate from the same source, that they are first polarised in planes at right angles, that they are then brought back again to the same plane of polarisation, and that we try to obtain interference. If the light were rigorously monochromatic, there would be interference; but with our nearly monochromatic lights, there will be no interference, and that, however narrow the ray may be. For it to be otherwise, the ray would have to be several million times finer than the finest known rays. </blockquote> ** He is saying that sunlight and light from incandescent bulbs has a continuous spectrum of all frequencies. Light from atomic transitions (like a high-pressure sodium lamp) has discrete spectral lines, but those ''still'' have a tiny line-width and two independent polarizations. This was not understood before the fundamental dogma of spectroscopy. The line-width is due to the energy-time uncertainty principle. * Quantum Computing ** [https://quantumexperience.ng.bluemix.net/qx/experience Experiment with IBM's Quantum Computer] * [https://predictivestatmech.org/papers/LifeAfterGraduation.pdf Life After Graduation] ** Sign up to [https://www.usf.edu/system/board-of-trustees/presidential-search-committee/meeting-schedule.aspx Attend an Executive Interview] == Group Work == [[File:MeasProb1.jpg|x100px]] [[File:MeasProb2.jpg|x100px]] [[File:MeasProb3.jpg|x100px]] [[File:MeasProb5.jpg|x100px]] [[File:MeasProb4.jpg|x100px]] == Assigned Homework Problems == # Part 1: Origins (Ch. 1, A, and 2) #* Ch. 1, 1-40 (we'll do 41-44 in class) #* Ch. A, 1-14 #** Hint on 12: use i = exp(...) #* Ch. 2, 1-16, 19 #** Hint on 1,2, and 4: use y(x) = A exp(ax) + B exp(b x) and check #** Hint on 5: use exp(i omega t) = ... # Part 2: First Schrodinger Solutions (Ch. 3, C, E, F) #* Ch. 3, 1-19,24,25,28,29,30,32,35 #* Ch. C, all problems except 10; Ch. E, prob. 7; and Ch. F, prob. 1-2,7,11 #** We will only multiply and take determinants of 2x2 matrices in this class, but adding larger matrices should be simple. #* [[Media:HW6.pdf | Supplemental Homework for Quiz 6]] # Part 3: Measurement, Observables, Speakable and Unspeakable (Ch. 4-5) #* Ch. 4, 1-3, 5, 7, 11, 14-16, 21-22 === Special Assignment for Quiz 4 === {| class="wikitable" |- | <math> f_1(x) = e^{ikx} </math> | <math> f_2(x) = 2 i e^{-2x} </math> | <math> f_3(x) = 7 x </math> | <math> f_4(x) = x^2 - 1 </math> | <math> f_5(x) = sin(2 \pi x/a) </math> |} # For each of the following operators, list all of the functions above which are eigenfunctions. There may be more than one. For each, also identify the corresponding eigenvalue. #* <math>\hat P = -i\hbar \frac{d}{dx}</math> #* <math>\hat S = 3</math> #* <math>\hat R = 2 x \frac{d}{dx} - 1</math> #* <math>\hat H = -c \frac{d^2}{dx^2} </math> # Find the normalization constant needed for each of the functions, <math>f_1 -- f_5</math> so that <math>\int_0^a (A_n f_n(x))^2 = 1</math> #* <math>A_1 = </math> #* <math>A_2 = </math> #* <math>A_3 = </math> #* <math>A_4 = </math> #* <math>A_5 = </math> # Complete the following problems from the text: #* 3-1 #* 3-3 #* 3-4 #* 3-5 #* 3-10 === Special Assignment for Quiz 7 === # Provide, in your own words, definitions for each of the following: complete basis, expectation value, commutator, Hermitian operator, dimension, tunneling, nonlinear process, symmetry, continuous / continuity, integrable, divergent (of an expression), "existence" (of a math expression) # <u>For problem 2, choose one of the following two questions:</u> # In the classical Bell experiment, a pair of 2 entangled particles are created in state <math>|\psi\rangle = (|0,1\rangle + |1,0\rangle)/\sqrt{2}</math>. A quantum circuit for creating such Bell states is given by the image below. Compute the final state of track (b) after each of the following measurements has occurred. Note that the two tracks are symmetric, so we can arbitrarily call the first quantum number ''track (a)'' and the second ''track (b)''. For hints, see the note on partial projection. #* Track (a) is measured and found to be in state <math>|0\rangle</math>. #* Track (a) is measured and found to be in state <math>|1\rangle</math>. #* Track (a) is measured and found to be in state <math>(|0\rangle+|1\rangle)/\sqrt{2}</math>. #* Under the first scenario (track (a) is in state <math>|0\rangle</math>), what is the probability that track (b) can be measured in state <math>\cos(\theta)|0\rangle + \sin(\theta)|1\rangle</math>? Compare this to the Bell-state correlation function [https://en.wikipedia.org/wiki/Bell%27s_theorem]. # (<u> Problem 5 from class </u>) A Hadamard gate has matrix representation <math>H = \left[ \begin{array}{cc} 1 & 1 \\ 1 & -1 \end{array}\right]/\sqrt{2}</math>. A qbit initially in state <math>|0\rangle</math> is passed through the Hadamard gate to create an output state. Use <math>|0\rangle = \left[ \begin{array}{c}1 \\ 0\end{array}\right] </math> and <math>|1\rangle = \left[ \begin{array}{c}0 \\ 1\end{array}\right] </math> to compute each of the following: #* The probability of detecting the output state is equal to <math>|0\rangle</math> #* The probability of detecting the output state is equal to <math>|1\rangle</math> #* The expectation value of <math>X = 5 |0\rangle\langle 0| + 2 |1\rangle\langle 1|</math> #* The expectation value <math>\langle 0|X H|0\rangle</math> #* The expectation value <math>\langle 0|H X|0\rangle</math> #* The expectation value <math>\langle 0|H X H|0\rangle</math> #* Which of the above corresponds to the expectation of the operator <math>X</math> when operating on the output state? {{note|Partial projection is what happens to a quantum state when only one part of it is measured. The measured part must be projected into its known answer, while the rest of the state merely goes along for the ride. For our purposes, to do the partial projection of <math>|\psi\rangle</math> which results from finding that track (a) has state <math>|v\rangle</math>, compute <math>\langle v, ?| \psi \rangle</math> using <math>\langle v, ?| = (\langle v|)(\langle ?|)</math> and use distributivity and orthogonality to get rid of all the track (a) state information. Factor off the <math>(\langle ?|)</math> and normalize the result to get the final state of track (b). }} [[File:BellIBM.png|x100px]] 74ab1abfb71be435d4e8a185aee71036c1c7b59d 741 739 2019-03-25T19:02:07Z David M. Rogers 2 /* Special Assignment for Quiz 7 */ wikitext text/x-wiki '''<BIG>Physical Chemistry II</BIG>''' Course Info * Course Numbers CHM 4411-001 * Credit Hours: 4 * Meeting Dates: Jan. 8 - Apr. 23, 2019 ** No Class Mar. 11-17 * Meeting Times: Tues. and Thurs., 9:30-10:45 am in ISA 3048 ** Problem Sessions: Fri., 11am-12 pm in ISA 3050 ** Regular quizzes on Fridays ** Office Hours: Fri., 10-11 am in IDR 200 * Grading: ** Quiz (30%) *** To succeed in the quiz, complete the homework and study the topics covered in the previous week! ** Exam 1 (20%) Fri., Feb. 8 11am-12pm (ISA 3050) ** Exam 2 (20%) Fri., Mar. 8, 11am-12pm (ISA 3050) ** Final (30%) Thurs., May 2 7:30-9:30am (ISA 3048) == Overview and Objectives == This course will introduce you to quantum theory, important for quantitatively describing atomic and molecular structure, chemical bonding and spectra. Students in this course will demonstrate the ability to apply the following ideas: * Relationship between mathematical models and intermolecular forces. * Explaining quantum states and their mathematical and physical properties. * Connecting observed molecular properties with quantum measurements. * Calculation of quantum energy levels and spectra. == Textbooks == * McQuarrie and Simon, Physical Chemistry: A Molecular Approach, University Science Books, 1997. ISBN: 0935702997. * Optional Extras: ** [http://www.feynmanlectures.caltech.edu/I_22.html Complex Algebra] ** [http://www.feynmanlectures.caltech.edu/I_23.html Damped, Driven Harmonic Oscillator] ** [http://www.feynmanlectures.caltech.edu/III_09.html The Ammonia Maser] ** [https://physicstoday.scitation.org/doi/10.1063/PT.3.2550 The Quantum Credo] ** [https://quantummechanics.ucsd.edu/ph130a/130_notes/130_notes.html Quantum Physics Online] (full year course) * Quantum Advances Nobel Prize Lectures ** [https://www.nobelprize.org/prizes/chemistry/2013/karplus/facts/ Karplus, Levitt and Warshel, 2013] ** [https://www.nobelprize.org/prizes/physics/2012/haroche/facts/ Haroche and Wineland, 2012] ** [https://www.nobelprize.org/prizes/physics/2005/hall/facts/ Glauber, Hall, and Hänsch, 2005] ** [https://www.nobelprize.org/prizes/chemistry/1998/kohn/facts/ Kohn and Pople, 1998] ** [https://www.nobelprize.org/prizes/chemistry/1992/marcus/facts/ Rudolph Marcus, 1992] ** [https://www.nobelprize.org/prizes/chemistry/1991/ernst/facts/ Richard Ernst, 1991] ** [https://www.nobelprize.org/prizes/physics/1954/born/facts/ Born and Bothe, 1954] ** [https://www.nobelprize.org/prizes/physics/1952/bloch/biographical/ Bloch and Purcell, 1952] ** [https://www.nobelprize.org/prizes/physics/1945/pauli/facts/ Wolfgang Pauli, 1945] ** [https://www.nobelprize.org/prizes/physics/1933/schrodinger/facts/ Schrödinger and Dirac, 1933] ** [https://www.nobelprize.org/prizes/physics/1932/heisenberg/facts/ Werner Heisenberg, 1932] ** [https://www.nobelprize.org/prizes/physics/1921/einstein/facts/ Albert Einstein, 1921] ** [https://www.nobelprize.org/prizes/physics/1918/planck/facts/ Max Planck, 1918] * Advanced reading: ** [https://dx.doi.org/10.1093/acprof:oso/9780198509141.001.0001 Exploring the Quantum: Atoms, Cavities, and Photons] (Haroche and Raimond's book) * Super-advanced reading: ** [https://doi.org/10.1017/9781316995457 Collapse of The Wave Function] == Resources == * Visualization of Modes: ** [https://www.youtube.com/watch?v=BE827gwnnk4 Wine Glass] ** [https://www.youtube.com/watch?v=v4ELxKKT5Rw&t=4s Drum Head] [https://youtu.be/QksHbCwYngw?t=5 see also] *** Note: Modes are indexed by 2 numbers for a 2D surface. ** [https://www.youtube.com/watch?v=Qf0t4qIVWF4 Another 2D example] *** This one is part-way between a particle in a 2D box and a circular drum, since the center is a special point. ** [https://www.youtube.com/watch?v=6JeyiM0YNo4 Violin String] *** Note: This looks like a sawtooth wave, so is less connected to quantum and more related to classical solitons. ** [https://youtu.be/0Ddr_ipAMqE?t=224 Cymbals] *** Note: This shows many modes excited at once, so it is not a simple shape. Quantum-mechanically, this situation is called a superposition. ** [https://www.youtube.com/watch?v=fMsjyQHtmiU Tacoma Narrows Bridge] *** Acoustic and vibrational modes are very important in mechanical structures. We will calculate them for atoms and optical cavities. ** [https://www.youtube.com/watch?v=RXPlHa5mRBE Audio in general] * Fundamental Dogma of Spectroscopy, <math>|E_2 - E_1| = h\nu</math> ** Here is Henri Poincaré's [https://www.gutenberg.org/files/37157/37157-pdf.pdf Science and Hypothesis], 1905. <blockquote> [On finding atomic causes of laboratory observations,] I shall only give one example which has always struck me rather forcibly. If I decompose white light, I shall be able to isolate a portion of the spectrum, but however small it may be, it will always be a certain width. In the same way the natural lights which are called monochromatic give us a very fine ray, but one which is not, however, infinitely fine. It might be supposed that in the experimental study of the properties of these natural lights, by operating with finer and finer rays, and passing on at last to the limit, so to speak, we should eventually obtain the properties of a rigorously monochromatic light. That would not be accurate. I assume that two rays emanate from the same source, that they are first polarised in planes at right angles, that they are then brought back again to the same plane of polarisation, and that we try to obtain interference. If the light were rigorously monochromatic, there would be interference; but with our nearly monochromatic lights, there will be no interference, and that, however narrow the ray may be. For it to be otherwise, the ray would have to be several million times finer than the finest known rays. </blockquote> ** He is saying that sunlight and light from incandescent bulbs has a continuous spectrum of all frequencies. Light from atomic transitions (like a high-pressure sodium lamp) has discrete spectral lines, but those ''still'' have a tiny line-width and two independent polarizations. This was not understood before the fundamental dogma of spectroscopy. The line-width is due to the energy-time uncertainty principle. * Quantum Computing ** [https://quantumexperience.ng.bluemix.net/qx/experience Experiment with IBM's Quantum Computer] * [https://predictivestatmech.org/papers/LifeAfterGraduation.pdf Life After Graduation] ** Sign up to [https://www.usf.edu/system/board-of-trustees/presidential-search-committee/meeting-schedule.aspx Attend an Executive Interview] == Group Work == [[File:MeasProb1.jpg|x100px]] [[File:MeasProb2.jpg|x100px]] [[File:MeasProb3.jpg|x100px]] [[File:MeasProb5.jpg|x100px]] [[File:MeasProb4.jpg|x100px]] == Assigned Homework Problems == # Part 1: Origins (Ch. 1, A, and 2) #* Ch. 1, 1-40 (we'll do 41-44 in class) #* Ch. A, 1-14 #** Hint on 12: use i = exp(...) #* Ch. 2, 1-16, 19 #** Hint on 1,2, and 4: use y(x) = A exp(ax) + B exp(b x) and check #** Hint on 5: use exp(i omega t) = ... # Part 2: First Schrodinger Solutions (Ch. 3, C, E, F) #* Ch. 3, 1-19,24,25,28,29,30,32,35 #* Ch. C, all problems except 10; Ch. E, prob. 7; and Ch. F, prob. 1-2,7,11 #** We will only multiply and take determinants of 2x2 matrices in this class, but adding larger matrices should be simple. #* [[Media:HW6.pdf | Supplemental Homework for Quiz 6]] # Part 3: Measurement, Observables, Speakable and Unspeakable (Ch. 4-5) #* Ch. 4, 1-3, 5, 7, 11, 14-16, 21-22 === Special Assignment for Quiz 4 === {| class="wikitable" |- | <math> f_1(x) = e^{ikx} </math> | <math> f_2(x) = 2 i e^{-2x} </math> | <math> f_3(x) = 7 x </math> | <math> f_4(x) = x^2 - 1 </math> | <math> f_5(x) = sin(2 \pi x/a) </math> |} # For each of the following operators, list all of the functions above which are eigenfunctions. There may be more than one. For each, also identify the corresponding eigenvalue. #* <math>\hat P = -i\hbar \frac{d}{dx}</math> #* <math>\hat S = 3</math> #* <math>\hat R = 2 x \frac{d}{dx} - 1</math> #* <math>\hat H = -c \frac{d^2}{dx^2} </math> # Find the normalization constant needed for each of the functions, <math>f_1 -- f_5</math> so that <math>\int_0^a (A_n f_n(x))^2 = 1</math> #* <math>A_1 = </math> #* <math>A_2 = </math> #* <math>A_3 = </math> #* <math>A_4 = </math> #* <math>A_5 = </math> # Complete the following problems from the text: #* 3-1 #* 3-3 #* 3-4 #* 3-5 #* 3-10 === Special Assignment for Quiz 7 === # Provide, in your own words, definitions for each of the following: complete basis, expectation value, commutator, Hermitian operator, dimension, tunneling, nonlinear process, symmetry, continuous / continuity, integrable, divergent (of an expression), "existence" (of a math expression) # <u>For problem 2, choose one of the following two questions: (3 or 4, you do not have to do both)</u> # In the classical Bell experiment, a pair of 2 entangled particles are created in state <math>|\psi\rangle = (|0,1\rangle + |1,0\rangle)/\sqrt{2}</math>. A quantum circuit for creating such Bell states is given by the image below. Compute the final state of track (b) after each of the following measurements has occurred. Note that the two tracks are symmetric, so we can arbitrarily call the first quantum number ''track (a)'' and the second ''track (b)''. For hints, see the note on partial projection. #* Track (a) is measured and found to be in state <math>|0\rangle</math>. #* Track (a) is measured and found to be in state <math>|1\rangle</math>. #* Track (a) is measured and found to be in state <math>(|0\rangle+|1\rangle)/\sqrt{2}</math>. #* Under the first scenario (track (a) is in state <math>|0\rangle</math>), what is the probability that track (b) can be measured in state <math>\cos(\theta)|0\rangle + \sin(\theta)|1\rangle</math>? Compare this to the Bell-state correlation function [https://en.wikipedia.org/wiki/Bell%27s_theorem]. # (<u> Problem 5 from class </u>) A Hadamard gate has matrix representation <math>H = \left[ \begin{array}{cc} 1 & 1 \\ 1 & -1 \end{array}\right]/\sqrt{2}</math>. A qbit initially in state <math>|0\rangle</math> is passed through the Hadamard gate to create an output state. Use <math>|0\rangle = \left[ \begin{array}{c}1 \\ 0\end{array}\right] </math> and <math>|1\rangle = \left[ \begin{array}{c}0 \\ 1\end{array}\right] </math> to compute each of the following: #* The probability of detecting the output state is equal to <math>|0\rangle</math> #* The probability of detecting the output state is equal to <math>|1\rangle</math> #* The expectation value of <math>X = 5 |0\rangle\langle 0| + 2 |1\rangle\langle 1|</math> #* The expectation value <math>\langle 0|X H|0\rangle</math> #* The expectation value <math>\langle 0|H X|0\rangle</math> #* The expectation value <math>\langle 0|H X H|0\rangle</math> #* Which of the above corresponds to the expectation of the operator <math>X</math> when operating on the output state? {{note|Partial projection is what happens to a quantum state when only one part of it is measured. The measured part must be projected into its known answer, while the rest of the state merely goes along for the ride. For our purposes, to do the partial projection of <math>|\psi\rangle</math> which results from finding that track (a) has state <math>|v\rangle</math>, compute <math>\langle v, ?| \psi \rangle</math> using <math>\langle v, ?| = (\langle v|)(\langle ?|)</math> and use distributivity and orthogonality to get rid of all the track (a) state information. Factor off the <math>(\langle ?|)</math> and normalize the result to get the final state of track (b). }} [[File:BellIBM.png|x100px]] fd7796ee9e3b1378e474a6ae2e52ac82962e9c4e 742 741 2019-03-28T17:00:32Z David M. Rogers 2 /* Group Work */ wikitext text/x-wiki '''<BIG>Physical Chemistry II</BIG>''' Course Info * Course Numbers CHM 4411-001 * Credit Hours: 4 * Meeting Dates: Jan. 8 - Apr. 23, 2019 ** No Class Mar. 11-17 * Meeting Times: Tues. and Thurs., 9:30-10:45 am in ISA 3048 ** Problem Sessions: Fri., 11am-12 pm in ISA 3050 ** Regular quizzes on Fridays ** Office Hours: Fri., 10-11 am in IDR 200 * Grading: ** Quiz (30%) *** To succeed in the quiz, complete the homework and study the topics covered in the previous week! ** Exam 1 (20%) Fri., Feb. 8 11am-12pm (ISA 3050) ** Exam 2 (20%) Fri., Mar. 8, 11am-12pm (ISA 3050) ** Final (30%) Thurs., May 2 7:30-9:30am (ISA 3048) == Overview and Objectives == This course will introduce you to quantum theory, important for quantitatively describing atomic and molecular structure, chemical bonding and spectra. Students in this course will demonstrate the ability to apply the following ideas: * Relationship between mathematical models and intermolecular forces. * Explaining quantum states and their mathematical and physical properties. * Connecting observed molecular properties with quantum measurements. * Calculation of quantum energy levels and spectra. == Textbooks == * McQuarrie and Simon, Physical Chemistry: A Molecular Approach, University Science Books, 1997. ISBN: 0935702997. * Optional Extras: ** [http://www.feynmanlectures.caltech.edu/I_22.html Complex Algebra] ** [http://www.feynmanlectures.caltech.edu/I_23.html Damped, Driven Harmonic Oscillator] ** [http://www.feynmanlectures.caltech.edu/III_09.html The Ammonia Maser] ** [https://physicstoday.scitation.org/doi/10.1063/PT.3.2550 The Quantum Credo] ** [https://quantummechanics.ucsd.edu/ph130a/130_notes/130_notes.html Quantum Physics Online] (full year course) * Quantum Advances Nobel Prize Lectures ** [https://www.nobelprize.org/prizes/chemistry/2013/karplus/facts/ Karplus, Levitt and Warshel, 2013] ** [https://www.nobelprize.org/prizes/physics/2012/haroche/facts/ Haroche and Wineland, 2012] ** [https://www.nobelprize.org/prizes/physics/2005/hall/facts/ Glauber, Hall, and Hänsch, 2005] ** [https://www.nobelprize.org/prizes/chemistry/1998/kohn/facts/ Kohn and Pople, 1998] ** [https://www.nobelprize.org/prizes/chemistry/1992/marcus/facts/ Rudolph Marcus, 1992] ** [https://www.nobelprize.org/prizes/chemistry/1991/ernst/facts/ Richard Ernst, 1991] ** [https://www.nobelprize.org/prizes/physics/1954/born/facts/ Born and Bothe, 1954] ** [https://www.nobelprize.org/prizes/physics/1952/bloch/biographical/ Bloch and Purcell, 1952] ** [https://www.nobelprize.org/prizes/physics/1945/pauli/facts/ Wolfgang Pauli, 1945] ** [https://www.nobelprize.org/prizes/physics/1933/schrodinger/facts/ Schrödinger and Dirac, 1933] ** [https://www.nobelprize.org/prizes/physics/1932/heisenberg/facts/ Werner Heisenberg, 1932] ** [https://www.nobelprize.org/prizes/physics/1921/einstein/facts/ Albert Einstein, 1921] ** [https://www.nobelprize.org/prizes/physics/1918/planck/facts/ Max Planck, 1918] * Advanced reading: ** [https://dx.doi.org/10.1093/acprof:oso/9780198509141.001.0001 Exploring the Quantum: Atoms, Cavities, and Photons] (Haroche and Raimond's book) * Super-advanced reading: ** [https://doi.org/10.1017/9781316995457 Collapse of The Wave Function] == Resources == * Visualization of Modes: ** [https://www.youtube.com/watch?v=BE827gwnnk4 Wine Glass] ** [https://www.youtube.com/watch?v=v4ELxKKT5Rw&t=4s Drum Head] [https://youtu.be/QksHbCwYngw?t=5 see also] *** Note: Modes are indexed by 2 numbers for a 2D surface. ** [https://www.youtube.com/watch?v=Qf0t4qIVWF4 Another 2D example] *** This one is part-way between a particle in a 2D box and a circular drum, since the center is a special point. ** [https://www.youtube.com/watch?v=6JeyiM0YNo4 Violin String] *** Note: This looks like a sawtooth wave, so is less connected to quantum and more related to classical solitons. ** [https://youtu.be/0Ddr_ipAMqE?t=224 Cymbals] *** Note: This shows many modes excited at once, so it is not a simple shape. Quantum-mechanically, this situation is called a superposition. ** [https://www.youtube.com/watch?v=fMsjyQHtmiU Tacoma Narrows Bridge] *** Acoustic and vibrational modes are very important in mechanical structures. We will calculate them for atoms and optical cavities. ** [https://www.youtube.com/watch?v=RXPlHa5mRBE Audio in general] * Fundamental Dogma of Spectroscopy, <math>|E_2 - E_1| = h\nu</math> ** Here is Henri Poincaré's [https://www.gutenberg.org/files/37157/37157-pdf.pdf Science and Hypothesis], 1905. <blockquote> [On finding atomic causes of laboratory observations,] I shall only give one example which has always struck me rather forcibly. If I decompose white light, I shall be able to isolate a portion of the spectrum, but however small it may be, it will always be a certain width. In the same way the natural lights which are called monochromatic give us a very fine ray, but one which is not, however, infinitely fine. It might be supposed that in the experimental study of the properties of these natural lights, by operating with finer and finer rays, and passing on at last to the limit, so to speak, we should eventually obtain the properties of a rigorously monochromatic light. That would not be accurate. I assume that two rays emanate from the same source, that they are first polarised in planes at right angles, that they are then brought back again to the same plane of polarisation, and that we try to obtain interference. If the light were rigorously monochromatic, there would be interference; but with our nearly monochromatic lights, there will be no interference, and that, however narrow the ray may be. For it to be otherwise, the ray would have to be several million times finer than the finest known rays. </blockquote> ** He is saying that sunlight and light from incandescent bulbs has a continuous spectrum of all frequencies. Light from atomic transitions (like a high-pressure sodium lamp) has discrete spectral lines, but those ''still'' have a tiny line-width and two independent polarizations. This was not understood before the fundamental dogma of spectroscopy. The line-width is due to the energy-time uncertainty principle. * Quantum Computing ** [https://quantumexperience.ng.bluemix.net/qx/experience Experiment with IBM's Quantum Computer] * [https://predictivestatmech.org/papers/LifeAfterGraduation.pdf Life After Graduation] ** Sign up to [https://www.usf.edu/system/board-of-trustees/presidential-search-committee/meeting-schedule.aspx Attend an Executive Interview] == Group Work == === Mar. 19 === [[File:MeasProb1.jpg|x100px]] [[File:MeasProb2.jpg|x100px]] [[File:MeasProb3.jpg|x100px]] [[File:MeasProb5.jpg|x100px]] [[File:MeasProb4.jpg|x100px]] === Mar. 28 === [predictivestatmech.org/papers/group_wk.pdf Group Work Slides] Note: Assignment for Tuesday, Apr. 2 is on the last slide, above. It is due Thursday, Apr. 4! == Assigned Homework Problems == # Part 1: Origins (Ch. 1, A, and 2) #* Ch. 1, 1-40 (we'll do 41-44 in class) #* Ch. A, 1-14 #** Hint on 12: use i = exp(...) #* Ch. 2, 1-16, 19 #** Hint on 1,2, and 4: use y(x) = A exp(ax) + B exp(b x) and check #** Hint on 5: use exp(i omega t) = ... # Part 2: First Schrodinger Solutions (Ch. 3, C, E, F) #* Ch. 3, 1-19,24,25,28,29,30,32,35 #* Ch. C, all problems except 10; Ch. E, prob. 7; and Ch. F, prob. 1-2,7,11 #** We will only multiply and take determinants of 2x2 matrices in this class, but adding larger matrices should be simple. #* [[Media:HW6.pdf | Supplemental Homework for Quiz 6]] # Part 3: Measurement, Observables, Speakable and Unspeakable (Ch. 4-5) #* Ch. 4, 1-3, 5, 7, 11, 14-16, 21-22 === Special Assignment for Quiz 4 === {| class="wikitable" |- | <math> f_1(x) = e^{ikx} </math> | <math> f_2(x) = 2 i e^{-2x} </math> | <math> f_3(x) = 7 x </math> | <math> f_4(x) = x^2 - 1 </math> | <math> f_5(x) = sin(2 \pi x/a) </math> |} # For each of the following operators, list all of the functions above which are eigenfunctions. There may be more than one. For each, also identify the corresponding eigenvalue. #* <math>\hat P = -i\hbar \frac{d}{dx}</math> #* <math>\hat S = 3</math> #* <math>\hat R = 2 x \frac{d}{dx} - 1</math> #* <math>\hat H = -c \frac{d^2}{dx^2} </math> # Find the normalization constant needed for each of the functions, <math>f_1 -- f_5</math> so that <math>\int_0^a (A_n f_n(x))^2 = 1</math> #* <math>A_1 = </math> #* <math>A_2 = </math> #* <math>A_3 = </math> #* <math>A_4 = </math> #* <math>A_5 = </math> # Complete the following problems from the text: #* 3-1 #* 3-3 #* 3-4 #* 3-5 #* 3-10 === Special Assignment for Quiz 7 === # Provide, in your own words, definitions for each of the following: complete basis, expectation value, commutator, Hermitian operator, dimension, tunneling, nonlinear process, symmetry, continuous / continuity, integrable, divergent (of an expression), "existence" (of a math expression) # <u>For problem 2, choose one of the following two questions: (3 or 4, you do not have to do both)</u> # In the classical Bell experiment, a pair of 2 entangled particles are created in state <math>|\psi\rangle = (|0,1\rangle + |1,0\rangle)/\sqrt{2}</math>. A quantum circuit for creating such Bell states is given by the image below. Compute the final state of track (b) after each of the following measurements has occurred. Note that the two tracks are symmetric, so we can arbitrarily call the first quantum number ''track (a)'' and the second ''track (b)''. For hints, see the note on partial projection. #* Track (a) is measured and found to be in state <math>|0\rangle</math>. #* Track (a) is measured and found to be in state <math>|1\rangle</math>. #* Track (a) is measured and found to be in state <math>(|0\rangle+|1\rangle)/\sqrt{2}</math>. #* Under the first scenario (track (a) is in state <math>|0\rangle</math>), what is the probability that track (b) can be measured in state <math>\cos(\theta)|0\rangle + \sin(\theta)|1\rangle</math>? Compare this to the Bell-state correlation function [https://en.wikipedia.org/wiki/Bell%27s_theorem]. # (<u> Problem 5 from class </u>) A Hadamard gate has matrix representation <math>H = \left[ \begin{array}{cc} 1 & 1 \\ 1 & -1 \end{array}\right]/\sqrt{2}</math>. A qbit initially in state <math>|0\rangle</math> is passed through the Hadamard gate to create an output state. Use <math>|0\rangle = \left[ \begin{array}{c}1 \\ 0\end{array}\right] </math> and <math>|1\rangle = \left[ \begin{array}{c}0 \\ 1\end{array}\right] </math> to compute each of the following: #* The probability of detecting the output state is equal to <math>|0\rangle</math> #* The probability of detecting the output state is equal to <math>|1\rangle</math> #* The expectation value of <math>X = 5 |0\rangle\langle 0| + 2 |1\rangle\langle 1|</math> #* The expectation value <math>\langle 0|X H|0\rangle</math> #* The expectation value <math>\langle 0|H X|0\rangle</math> #* The expectation value <math>\langle 0|H X H|0\rangle</math> #* Which of the above corresponds to the expectation of the operator <math>X</math> when operating on the output state? {{note|Partial projection is what happens to a quantum state when only one part of it is measured. The measured part must be projected into its known answer, while the rest of the state merely goes along for the ride. For our purposes, to do the partial projection of <math>|\psi\rangle</math> which results from finding that track (a) has state <math>|v\rangle</math>, compute <math>\langle v, ?| \psi \rangle</math> using <math>\langle v, ?| = (\langle v|)(\langle ?|)</math> and use distributivity and orthogonality to get rid of all the track (a) state information. Factor off the <math>(\langle ?|)</math> and normalize the result to get the final state of track (b). }} [[File:BellIBM.png|x100px]] 4d009ce9d4cb96a28b97680a55f2b893a757d7e7 743 742 2019-03-28T17:00:49Z David M. Rogers 2 /* Mar. 28 */ wikitext text/x-wiki '''<BIG>Physical Chemistry II</BIG>''' Course Info * Course Numbers CHM 4411-001 * Credit Hours: 4 * Meeting Dates: Jan. 8 - Apr. 23, 2019 ** No Class Mar. 11-17 * Meeting Times: Tues. and Thurs., 9:30-10:45 am in ISA 3048 ** Problem Sessions: Fri., 11am-12 pm in ISA 3050 ** Regular quizzes on Fridays ** Office Hours: Fri., 10-11 am in IDR 200 * Grading: ** Quiz (30%) *** To succeed in the quiz, complete the homework and study the topics covered in the previous week! ** Exam 1 (20%) Fri., Feb. 8 11am-12pm (ISA 3050) ** Exam 2 (20%) Fri., Mar. 8, 11am-12pm (ISA 3050) ** Final (30%) Thurs., May 2 7:30-9:30am (ISA 3048) == Overview and Objectives == This course will introduce you to quantum theory, important for quantitatively describing atomic and molecular structure, chemical bonding and spectra. Students in this course will demonstrate the ability to apply the following ideas: * Relationship between mathematical models and intermolecular forces. * Explaining quantum states and their mathematical and physical properties. * Connecting observed molecular properties with quantum measurements. * Calculation of quantum energy levels and spectra. == Textbooks == * McQuarrie and Simon, Physical Chemistry: A Molecular Approach, University Science Books, 1997. ISBN: 0935702997. * Optional Extras: ** [http://www.feynmanlectures.caltech.edu/I_22.html Complex Algebra] ** [http://www.feynmanlectures.caltech.edu/I_23.html Damped, Driven Harmonic Oscillator] ** [http://www.feynmanlectures.caltech.edu/III_09.html The Ammonia Maser] ** [https://physicstoday.scitation.org/doi/10.1063/PT.3.2550 The Quantum Credo] ** [https://quantummechanics.ucsd.edu/ph130a/130_notes/130_notes.html Quantum Physics Online] (full year course) * Quantum Advances Nobel Prize Lectures ** [https://www.nobelprize.org/prizes/chemistry/2013/karplus/facts/ Karplus, Levitt and Warshel, 2013] ** [https://www.nobelprize.org/prizes/physics/2012/haroche/facts/ Haroche and Wineland, 2012] ** [https://www.nobelprize.org/prizes/physics/2005/hall/facts/ Glauber, Hall, and Hänsch, 2005] ** [https://www.nobelprize.org/prizes/chemistry/1998/kohn/facts/ Kohn and Pople, 1998] ** [https://www.nobelprize.org/prizes/chemistry/1992/marcus/facts/ Rudolph Marcus, 1992] ** [https://www.nobelprize.org/prizes/chemistry/1991/ernst/facts/ Richard Ernst, 1991] ** [https://www.nobelprize.org/prizes/physics/1954/born/facts/ Born and Bothe, 1954] ** [https://www.nobelprize.org/prizes/physics/1952/bloch/biographical/ Bloch and Purcell, 1952] ** [https://www.nobelprize.org/prizes/physics/1945/pauli/facts/ Wolfgang Pauli, 1945] ** [https://www.nobelprize.org/prizes/physics/1933/schrodinger/facts/ Schrödinger and Dirac, 1933] ** [https://www.nobelprize.org/prizes/physics/1932/heisenberg/facts/ Werner Heisenberg, 1932] ** [https://www.nobelprize.org/prizes/physics/1921/einstein/facts/ Albert Einstein, 1921] ** [https://www.nobelprize.org/prizes/physics/1918/planck/facts/ Max Planck, 1918] * Advanced reading: ** [https://dx.doi.org/10.1093/acprof:oso/9780198509141.001.0001 Exploring the Quantum: Atoms, Cavities, and Photons] (Haroche and Raimond's book) * Super-advanced reading: ** [https://doi.org/10.1017/9781316995457 Collapse of The Wave Function] == Resources == * Visualization of Modes: ** [https://www.youtube.com/watch?v=BE827gwnnk4 Wine Glass] ** [https://www.youtube.com/watch?v=v4ELxKKT5Rw&t=4s Drum Head] [https://youtu.be/QksHbCwYngw?t=5 see also] *** Note: Modes are indexed by 2 numbers for a 2D surface. ** [https://www.youtube.com/watch?v=Qf0t4qIVWF4 Another 2D example] *** This one is part-way between a particle in a 2D box and a circular drum, since the center is a special point. ** [https://www.youtube.com/watch?v=6JeyiM0YNo4 Violin String] *** Note: This looks like a sawtooth wave, so is less connected to quantum and more related to classical solitons. ** [https://youtu.be/0Ddr_ipAMqE?t=224 Cymbals] *** Note: This shows many modes excited at once, so it is not a simple shape. Quantum-mechanically, this situation is called a superposition. ** [https://www.youtube.com/watch?v=fMsjyQHtmiU Tacoma Narrows Bridge] *** Acoustic and vibrational modes are very important in mechanical structures. We will calculate them for atoms and optical cavities. ** [https://www.youtube.com/watch?v=RXPlHa5mRBE Audio in general] * Fundamental Dogma of Spectroscopy, <math>|E_2 - E_1| = h\nu</math> ** Here is Henri Poincaré's [https://www.gutenberg.org/files/37157/37157-pdf.pdf Science and Hypothesis], 1905. <blockquote> [On finding atomic causes of laboratory observations,] I shall only give one example which has always struck me rather forcibly. If I decompose white light, I shall be able to isolate a portion of the spectrum, but however small it may be, it will always be a certain width. In the same way the natural lights which are called monochromatic give us a very fine ray, but one which is not, however, infinitely fine. It might be supposed that in the experimental study of the properties of these natural lights, by operating with finer and finer rays, and passing on at last to the limit, so to speak, we should eventually obtain the properties of a rigorously monochromatic light. That would not be accurate. I assume that two rays emanate from the same source, that they are first polarised in planes at right angles, that they are then brought back again to the same plane of polarisation, and that we try to obtain interference. If the light were rigorously monochromatic, there would be interference; but with our nearly monochromatic lights, there will be no interference, and that, however narrow the ray may be. For it to be otherwise, the ray would have to be several million times finer than the finest known rays. </blockquote> ** He is saying that sunlight and light from incandescent bulbs has a continuous spectrum of all frequencies. Light from atomic transitions (like a high-pressure sodium lamp) has discrete spectral lines, but those ''still'' have a tiny line-width and two independent polarizations. This was not understood before the fundamental dogma of spectroscopy. The line-width is due to the energy-time uncertainty principle. * Quantum Computing ** [https://quantumexperience.ng.bluemix.net/qx/experience Experiment with IBM's Quantum Computer] * [https://predictivestatmech.org/papers/LifeAfterGraduation.pdf Life After Graduation] ** Sign up to [https://www.usf.edu/system/board-of-trustees/presidential-search-committee/meeting-schedule.aspx Attend an Executive Interview] == Group Work == === Mar. 19 === [[File:MeasProb1.jpg|x100px]] [[File:MeasProb2.jpg|x100px]] [[File:MeasProb3.jpg|x100px]] [[File:MeasProb5.jpg|x100px]] [[File:MeasProb4.jpg|x100px]] === Mar. 28 === [https://predictivestatmech.org/papers/group_wk.pdf Group Work Slides] Note: Assignment for Tuesday, Apr. 2 is on the last slide, above. It is due Thursday, Apr. 4! == Assigned Homework Problems == # Part 1: Origins (Ch. 1, A, and 2) #* Ch. 1, 1-40 (we'll do 41-44 in class) #* Ch. A, 1-14 #** Hint on 12: use i = exp(...) #* Ch. 2, 1-16, 19 #** Hint on 1,2, and 4: use y(x) = A exp(ax) + B exp(b x) and check #** Hint on 5: use exp(i omega t) = ... # Part 2: First Schrodinger Solutions (Ch. 3, C, E, F) #* Ch. 3, 1-19,24,25,28,29,30,32,35 #* Ch. C, all problems except 10; Ch. E, prob. 7; and Ch. F, prob. 1-2,7,11 #** We will only multiply and take determinants of 2x2 matrices in this class, but adding larger matrices should be simple. #* [[Media:HW6.pdf | Supplemental Homework for Quiz 6]] # Part 3: Measurement, Observables, Speakable and Unspeakable (Ch. 4-5) #* Ch. 4, 1-3, 5, 7, 11, 14-16, 21-22 === Special Assignment for Quiz 4 === {| class="wikitable" |- | <math> f_1(x) = e^{ikx} </math> | <math> f_2(x) = 2 i e^{-2x} </math> | <math> f_3(x) = 7 x </math> | <math> f_4(x) = x^2 - 1 </math> | <math> f_5(x) = sin(2 \pi x/a) </math> |} # For each of the following operators, list all of the functions above which are eigenfunctions. There may be more than one. For each, also identify the corresponding eigenvalue. #* <math>\hat P = -i\hbar \frac{d}{dx}</math> #* <math>\hat S = 3</math> #* <math>\hat R = 2 x \frac{d}{dx} - 1</math> #* <math>\hat H = -c \frac{d^2}{dx^2} </math> # Find the normalization constant needed for each of the functions, <math>f_1 -- f_5</math> so that <math>\int_0^a (A_n f_n(x))^2 = 1</math> #* <math>A_1 = </math> #* <math>A_2 = </math> #* <math>A_3 = </math> #* <math>A_4 = </math> #* <math>A_5 = </math> # Complete the following problems from the text: #* 3-1 #* 3-3 #* 3-4 #* 3-5 #* 3-10 === Special Assignment for Quiz 7 === # Provide, in your own words, definitions for each of the following: complete basis, expectation value, commutator, Hermitian operator, dimension, tunneling, nonlinear process, symmetry, continuous / continuity, integrable, divergent (of an expression), "existence" (of a math expression) # <u>For problem 2, choose one of the following two questions: (3 or 4, you do not have to do both)</u> # In the classical Bell experiment, a pair of 2 entangled particles are created in state <math>|\psi\rangle = (|0,1\rangle + |1,0\rangle)/\sqrt{2}</math>. A quantum circuit for creating such Bell states is given by the image below. Compute the final state of track (b) after each of the following measurements has occurred. Note that the two tracks are symmetric, so we can arbitrarily call the first quantum number ''track (a)'' and the second ''track (b)''. For hints, see the note on partial projection. #* Track (a) is measured and found to be in state <math>|0\rangle</math>. #* Track (a) is measured and found to be in state <math>|1\rangle</math>. #* Track (a) is measured and found to be in state <math>(|0\rangle+|1\rangle)/\sqrt{2}</math>. #* Under the first scenario (track (a) is in state <math>|0\rangle</math>), what is the probability that track (b) can be measured in state <math>\cos(\theta)|0\rangle + \sin(\theta)|1\rangle</math>? Compare this to the Bell-state correlation function [https://en.wikipedia.org/wiki/Bell%27s_theorem]. # (<u> Problem 5 from class </u>) A Hadamard gate has matrix representation <math>H = \left[ \begin{array}{cc} 1 & 1 \\ 1 & -1 \end{array}\right]/\sqrt{2}</math>. A qbit initially in state <math>|0\rangle</math> is passed through the Hadamard gate to create an output state. Use <math>|0\rangle = \left[ \begin{array}{c}1 \\ 0\end{array}\right] </math> and <math>|1\rangle = \left[ \begin{array}{c}0 \\ 1\end{array}\right] </math> to compute each of the following: #* The probability of detecting the output state is equal to <math>|0\rangle</math> #* The probability of detecting the output state is equal to <math>|1\rangle</math> #* The expectation value of <math>X = 5 |0\rangle\langle 0| + 2 |1\rangle\langle 1|</math> #* The expectation value <math>\langle 0|X H|0\rangle</math> #* The expectation value <math>\langle 0|H X|0\rangle</math> #* The expectation value <math>\langle 0|H X H|0\rangle</math> #* Which of the above corresponds to the expectation of the operator <math>X</math> when operating on the output state? {{note|Partial projection is what happens to a quantum state when only one part of it is measured. The measured part must be projected into its known answer, while the rest of the state merely goes along for the ride. For our purposes, to do the partial projection of <math>|\psi\rangle</math> which results from finding that track (a) has state <math>|v\rangle</math>, compute <math>\langle v, ?| \psi \rangle</math> using <math>\langle v, ?| = (\langle v|)(\langle ?|)</math> and use distributivity and orthogonality to get rid of all the track (a) state information. Factor off the <math>(\langle ?|)</math> and normalize the result to get the final state of track (b). }} [[File:BellIBM.png|x100px]] 0ae090038118a6385d4555bdc1bd06319a3f7903 744 743 2019-03-28T17:05:12Z David M. Rogers 2 wikitext text/x-wiki '''<BIG>Physical Chemistry II</BIG>''' Course Info * Course Numbers CHM 4411-001 * Credit Hours: 4 * Meeting Dates: Jan. 8 - Apr. 23, 2019 ** No Class Mar. 11-17 ** No Class Tuesday, Apr. 2 * Meeting Times: Tues. and Thurs., 9:30-10:45 am in ISA 3048 ** Problem Sessions: Fri., 11am-12 pm in ISA 3050 ** Regular quizzes on Fridays ** Office Hours: Fri., 10-11 am in IDR 200 * Grading: ** Quiz (30%) *** To succeed in the quiz, complete the homework and study the topics covered in the previous week! ** Exam 1 (20%) Fri., Feb. 8 11am-12pm (ISA 3050) ** Exam 2 (20%) Fri., Mar. 8, 11am-12pm (ISA 3050) ** Final (30%) Thurs., May 2 7:30-9:30am (ISA 3048) == Overview and Objectives == This course will introduce you to quantum theory, important for quantitatively describing atomic and molecular structure, chemical bonding and spectra. Students in this course will demonstrate the ability to apply the following ideas: * Relationship between mathematical models and intermolecular forces. * Explaining quantum states and their mathematical and physical properties. * Connecting observed molecular properties with quantum measurements. * Calculation of quantum energy levels and spectra. == Textbooks == * McQuarrie and Simon, Physical Chemistry: A Molecular Approach, University Science Books, 1997. ISBN: 0935702997. * Optional Extras: ** [http://www.feynmanlectures.caltech.edu/I_22.html Complex Algebra] ** [http://www.feynmanlectures.caltech.edu/I_23.html Damped, Driven Harmonic Oscillator] ** [http://www.feynmanlectures.caltech.edu/III_09.html The Ammonia Maser] ** [https://physicstoday.scitation.org/doi/10.1063/PT.3.2550 The Quantum Credo] ** [https://quantummechanics.ucsd.edu/ph130a/130_notes/130_notes.html Quantum Physics Online] (full year course) * Quantum Advances Nobel Prize Lectures ** [https://www.nobelprize.org/prizes/chemistry/2013/karplus/facts/ Karplus, Levitt and Warshel, 2013] ** [https://www.nobelprize.org/prizes/physics/2012/haroche/facts/ Haroche and Wineland, 2012] ** [https://www.nobelprize.org/prizes/physics/2005/hall/facts/ Glauber, Hall, and Hänsch, 2005] ** [https://www.nobelprize.org/prizes/chemistry/1998/kohn/facts/ Kohn and Pople, 1998] ** [https://www.nobelprize.org/prizes/chemistry/1992/marcus/facts/ Rudolph Marcus, 1992] ** [https://www.nobelprize.org/prizes/chemistry/1991/ernst/facts/ Richard Ernst, 1991] ** [https://www.nobelprize.org/prizes/physics/1954/born/facts/ Born and Bothe, 1954] ** [https://www.nobelprize.org/prizes/physics/1952/bloch/biographical/ Bloch and Purcell, 1952] ** [https://www.nobelprize.org/prizes/physics/1945/pauli/facts/ Wolfgang Pauli, 1945] ** [https://www.nobelprize.org/prizes/physics/1933/schrodinger/facts/ Schrödinger and Dirac, 1933] ** [https://www.nobelprize.org/prizes/physics/1932/heisenberg/facts/ Werner Heisenberg, 1932] ** [https://www.nobelprize.org/prizes/physics/1921/einstein/facts/ Albert Einstein, 1921] ** [https://www.nobelprize.org/prizes/physics/1918/planck/facts/ Max Planck, 1918] * Advanced reading: ** [https://dx.doi.org/10.1093/acprof:oso/9780198509141.001.0001 Exploring the Quantum: Atoms, Cavities, and Photons] (Haroche and Raimond's book) * Super-advanced reading: ** [https://doi.org/10.1017/9781316995457 Collapse of The Wave Function] == Resources == * Visualization of Modes: ** [https://www.youtube.com/watch?v=BE827gwnnk4 Wine Glass] ** [https://www.youtube.com/watch?v=v4ELxKKT5Rw&t=4s Drum Head] [https://youtu.be/QksHbCwYngw?t=5 see also] *** Note: Modes are indexed by 2 numbers for a 2D surface. ** [https://www.youtube.com/watch?v=Qf0t4qIVWF4 Another 2D example] *** This one is part-way between a particle in a 2D box and a circular drum, since the center is a special point. ** [https://www.youtube.com/watch?v=6JeyiM0YNo4 Violin String] *** Note: This looks like a sawtooth wave, so is less connected to quantum and more related to classical solitons. ** [https://youtu.be/0Ddr_ipAMqE?t=224 Cymbals] *** Note: This shows many modes excited at once, so it is not a simple shape. Quantum-mechanically, this situation is called a superposition. ** [https://www.youtube.com/watch?v=fMsjyQHtmiU Tacoma Narrows Bridge] *** Acoustic and vibrational modes are very important in mechanical structures. We will calculate them for atoms and optical cavities. ** [https://www.youtube.com/watch?v=RXPlHa5mRBE Audio in general] * Fundamental Dogma of Spectroscopy, <math>|E_2 - E_1| = h\nu</math> ** Here is Henri Poincaré's [https://www.gutenberg.org/files/37157/37157-pdf.pdf Science and Hypothesis], 1905. <blockquote> [On finding atomic causes of laboratory observations,] I shall only give one example which has always struck me rather forcibly. If I decompose white light, I shall be able to isolate a portion of the spectrum, but however small it may be, it will always be a certain width. In the same way the natural lights which are called monochromatic give us a very fine ray, but one which is not, however, infinitely fine. It might be supposed that in the experimental study of the properties of these natural lights, by operating with finer and finer rays, and passing on at last to the limit, so to speak, we should eventually obtain the properties of a rigorously monochromatic light. That would not be accurate. I assume that two rays emanate from the same source, that they are first polarised in planes at right angles, that they are then brought back again to the same plane of polarisation, and that we try to obtain interference. If the light were rigorously monochromatic, there would be interference; but with our nearly monochromatic lights, there will be no interference, and that, however narrow the ray may be. For it to be otherwise, the ray would have to be several million times finer than the finest known rays. </blockquote> ** He is saying that sunlight and light from incandescent bulbs has a continuous spectrum of all frequencies. Light from atomic transitions (like a high-pressure sodium lamp) has discrete spectral lines, but those ''still'' have a tiny line-width and two independent polarizations. This was not understood before the fundamental dogma of spectroscopy. The line-width is due to the energy-time uncertainty principle. * Quantum Computing ** [https://quantumexperience.ng.bluemix.net/qx/experience Experiment with IBM's Quantum Computer] * [https://predictivestatmech.org/papers/LifeAfterGraduation.pdf Life After Graduation] ** Sign up to [https://www.usf.edu/system/board-of-trustees/presidential-search-committee/meeting-schedule.aspx Attend an Executive Interview] == Group Work == === Mar. 19 === [[File:MeasProb1.jpg|x100px]] [[File:MeasProb2.jpg|x100px]] [[File:MeasProb3.jpg|x100px]] [[File:MeasProb5.jpg|x100px]] [[File:MeasProb4.jpg|x100px]] === Mar. 28 === [https://predictivestatmech.org/papers/group_wk.pdf Group Work Slides] Note: Assignment for Tuesday, Apr. 2 is on the last slide, above. It is due Thursday, Apr. 4! == Assigned Homework Problems == # Part 1: Origins (Ch. 1, A, and 2) #* Ch. 1, 1-40 (we'll do 41-44 in class) #* Ch. A, 1-14 #** Hint on 12: use i = exp(...) #* Ch. 2, 1-16, 19 #** Hint on 1,2, and 4: use y(x) = A exp(ax) + B exp(b x) and check #** Hint on 5: use exp(i omega t) = ... # Part 2: First Schrodinger Solutions (Ch. 3, C, E, F) #* Ch. 3, 1-19,24,25,28,29,30,32,35 #* Ch. C, all problems except 10; Ch. E, prob. 7; and Ch. F, prob. 1-2,7,11 #** We will only multiply and take determinants of 2x2 matrices in this class, but adding larger matrices should be simple. #* [[Media:HW6.pdf | Supplemental Homework for Quiz 6]] # Part 3: Measurement, Observables, Speakable and Unspeakable (Ch. 4-5) #* Ch. 4, 1-3, 5, 7, 11, 14-16, 21-22 === Special Assignment for Quiz 4 === {| class="wikitable" |- | <math> f_1(x) = e^{ikx} </math> | <math> f_2(x) = 2 i e^{-2x} </math> | <math> f_3(x) = 7 x </math> | <math> f_4(x) = x^2 - 1 </math> | <math> f_5(x) = sin(2 \pi x/a) </math> |} # For each of the following operators, list all of the functions above which are eigenfunctions. There may be more than one. For each, also identify the corresponding eigenvalue. #* <math>\hat P = -i\hbar \frac{d}{dx}</math> #* <math>\hat S = 3</math> #* <math>\hat R = 2 x \frac{d}{dx} - 1</math> #* <math>\hat H = -c \frac{d^2}{dx^2} </math> # Find the normalization constant needed for each of the functions, <math>f_1 -- f_5</math> so that <math>\int_0^a (A_n f_n(x))^2 = 1</math> #* <math>A_1 = </math> #* <math>A_2 = </math> #* <math>A_3 = </math> #* <math>A_4 = </math> #* <math>A_5 = </math> # Complete the following problems from the text: #* 3-1 #* 3-3 #* 3-4 #* 3-5 #* 3-10 === Special Assignment for Quiz 7 === # Provide, in your own words, definitions for each of the following: complete basis, expectation value, commutator, Hermitian operator, dimension, tunneling, nonlinear process, symmetry, continuous / continuity, integrable, divergent (of an expression), "existence" (of a math expression) # <u>For problem 2, choose one of the following two questions: (3 or 4, you do not have to do both)</u> # In the classical Bell experiment, a pair of 2 entangled particles are created in state <math>|\psi\rangle = (|0,1\rangle + |1,0\rangle)/\sqrt{2}</math>. A quantum circuit for creating such Bell states is given by the image below. Compute the final state of track (b) after each of the following measurements has occurred. Note that the two tracks are symmetric, so we can arbitrarily call the first quantum number ''track (a)'' and the second ''track (b)''. For hints, see the note on partial projection. #* Track (a) is measured and found to be in state <math>|0\rangle</math>. #* Track (a) is measured and found to be in state <math>|1\rangle</math>. #* Track (a) is measured and found to be in state <math>(|0\rangle+|1\rangle)/\sqrt{2}</math>. #* Under the first scenario (track (a) is in state <math>|0\rangle</math>), what is the probability that track (b) can be measured in state <math>\cos(\theta)|0\rangle + \sin(\theta)|1\rangle</math>? Compare this to the Bell-state correlation function [https://en.wikipedia.org/wiki/Bell%27s_theorem]. # (<u> Problem 5 from class </u>) A Hadamard gate has matrix representation <math>H = \left[ \begin{array}{cc} 1 & 1 \\ 1 & -1 \end{array}\right]/\sqrt{2}</math>. A qbit initially in state <math>|0\rangle</math> is passed through the Hadamard gate to create an output state. Use <math>|0\rangle = \left[ \begin{array}{c}1 \\ 0\end{array}\right] </math> and <math>|1\rangle = \left[ \begin{array}{c}0 \\ 1\end{array}\right] </math> to compute each of the following: #* The probability of detecting the output state is equal to <math>|0\rangle</math> #* The probability of detecting the output state is equal to <math>|1\rangle</math> #* The expectation value of <math>X = 5 |0\rangle\langle 0| + 2 |1\rangle\langle 1|</math> #* The expectation value <math>\langle 0|X H|0\rangle</math> #* The expectation value <math>\langle 0|H X|0\rangle</math> #* The expectation value <math>\langle 0|H X H|0\rangle</math> #* Which of the above corresponds to the expectation of the operator <math>X</math> when operating on the output state? {{note|Partial projection is what happens to a quantum state when only one part of it is measured. The measured part must be projected into its known answer, while the rest of the state merely goes along for the ride. For our purposes, to do the partial projection of <math>|\psi\rangle</math> which results from finding that track (a) has state <math>|v\rangle</math>, compute <math>\langle v, ?| \psi \rangle</math> using <math>\langle v, ?| = (\langle v|)(\langle ?|)</math> and use distributivity and orthogonality to get rid of all the track (a) state information. Factor off the <math>(\langle ?|)</math> and normalize the result to get the final state of track (b). }} [[File:BellIBM.png|x100px]] 6e7c4f25f079fc83c88d87d12d8de4b72a32ef9c 746 744 2019-04-08T19:38:40Z David M. Rogers 2 /* Special Assignment for Quiz 7 */ wikitext text/x-wiki '''<BIG>Physical Chemistry II</BIG>''' Course Info * Course Numbers CHM 4411-001 * Credit Hours: 4 * Meeting Dates: Jan. 8 - Apr. 23, 2019 ** No Class Mar. 11-17 ** No Class Tuesday, Apr. 2 * Meeting Times: Tues. and Thurs., 9:30-10:45 am in ISA 3048 ** Problem Sessions: Fri., 11am-12 pm in ISA 3050 ** Regular quizzes on Fridays ** Office Hours: Fri., 10-11 am in IDR 200 * Grading: ** Quiz (30%) *** To succeed in the quiz, complete the homework and study the topics covered in the previous week! ** Exam 1 (20%) Fri., Feb. 8 11am-12pm (ISA 3050) ** Exam 2 (20%) Fri., Mar. 8, 11am-12pm (ISA 3050) ** Final (30%) Thurs., May 2 7:30-9:30am (ISA 3048) == Overview and Objectives == This course will introduce you to quantum theory, important for quantitatively describing atomic and molecular structure, chemical bonding and spectra. Students in this course will demonstrate the ability to apply the following ideas: * Relationship between mathematical models and intermolecular forces. * Explaining quantum states and their mathematical and physical properties. * Connecting observed molecular properties with quantum measurements. * Calculation of quantum energy levels and spectra. == Textbooks == * McQuarrie and Simon, Physical Chemistry: A Molecular Approach, University Science Books, 1997. ISBN: 0935702997. * Optional Extras: ** [http://www.feynmanlectures.caltech.edu/I_22.html Complex Algebra] ** [http://www.feynmanlectures.caltech.edu/I_23.html Damped, Driven Harmonic Oscillator] ** [http://www.feynmanlectures.caltech.edu/III_09.html The Ammonia Maser] ** [https://physicstoday.scitation.org/doi/10.1063/PT.3.2550 The Quantum Credo] ** [https://quantummechanics.ucsd.edu/ph130a/130_notes/130_notes.html Quantum Physics Online] (full year course) * Quantum Advances Nobel Prize Lectures ** [https://www.nobelprize.org/prizes/chemistry/2013/karplus/facts/ Karplus, Levitt and Warshel, 2013] ** [https://www.nobelprize.org/prizes/physics/2012/haroche/facts/ Haroche and Wineland, 2012] ** [https://www.nobelprize.org/prizes/physics/2005/hall/facts/ Glauber, Hall, and Hänsch, 2005] ** [https://www.nobelprize.org/prizes/chemistry/1998/kohn/facts/ Kohn and Pople, 1998] ** [https://www.nobelprize.org/prizes/chemistry/1992/marcus/facts/ Rudolph Marcus, 1992] ** [https://www.nobelprize.org/prizes/chemistry/1991/ernst/facts/ Richard Ernst, 1991] ** [https://www.nobelprize.org/prizes/physics/1954/born/facts/ Born and Bothe, 1954] ** [https://www.nobelprize.org/prizes/physics/1952/bloch/biographical/ Bloch and Purcell, 1952] ** [https://www.nobelprize.org/prizes/physics/1945/pauli/facts/ Wolfgang Pauli, 1945] ** [https://www.nobelprize.org/prizes/physics/1933/schrodinger/facts/ Schrödinger and Dirac, 1933] ** [https://www.nobelprize.org/prizes/physics/1932/heisenberg/facts/ Werner Heisenberg, 1932] ** [https://www.nobelprize.org/prizes/physics/1921/einstein/facts/ Albert Einstein, 1921] ** [https://www.nobelprize.org/prizes/physics/1918/planck/facts/ Max Planck, 1918] * Advanced reading: ** [https://dx.doi.org/10.1093/acprof:oso/9780198509141.001.0001 Exploring the Quantum: Atoms, Cavities, and Photons] (Haroche and Raimond's book) * Super-advanced reading: ** [https://doi.org/10.1017/9781316995457 Collapse of The Wave Function] == Resources == * Visualization of Modes: ** [https://www.youtube.com/watch?v=BE827gwnnk4 Wine Glass] ** [https://www.youtube.com/watch?v=v4ELxKKT5Rw&t=4s Drum Head] [https://youtu.be/QksHbCwYngw?t=5 see also] *** Note: Modes are indexed by 2 numbers for a 2D surface. ** [https://www.youtube.com/watch?v=Qf0t4qIVWF4 Another 2D example] *** This one is part-way between a particle in a 2D box and a circular drum, since the center is a special point. ** [https://www.youtube.com/watch?v=6JeyiM0YNo4 Violin String] *** Note: This looks like a sawtooth wave, so is less connected to quantum and more related to classical solitons. ** [https://youtu.be/0Ddr_ipAMqE?t=224 Cymbals] *** Note: This shows many modes excited at once, so it is not a simple shape. Quantum-mechanically, this situation is called a superposition. ** [https://www.youtube.com/watch?v=fMsjyQHtmiU Tacoma Narrows Bridge] *** Acoustic and vibrational modes are very important in mechanical structures. We will calculate them for atoms and optical cavities. ** [https://www.youtube.com/watch?v=RXPlHa5mRBE Audio in general] * Fundamental Dogma of Spectroscopy, <math>|E_2 - E_1| = h\nu</math> ** Here is Henri Poincaré's [https://www.gutenberg.org/files/37157/37157-pdf.pdf Science and Hypothesis], 1905. <blockquote> [On finding atomic causes of laboratory observations,] I shall only give one example which has always struck me rather forcibly. If I decompose white light, I shall be able to isolate a portion of the spectrum, but however small it may be, it will always be a certain width. In the same way the natural lights which are called monochromatic give us a very fine ray, but one which is not, however, infinitely fine. It might be supposed that in the experimental study of the properties of these natural lights, by operating with finer and finer rays, and passing on at last to the limit, so to speak, we should eventually obtain the properties of a rigorously monochromatic light. That would not be accurate. I assume that two rays emanate from the same source, that they are first polarised in planes at right angles, that they are then brought back again to the same plane of polarisation, and that we try to obtain interference. If the light were rigorously monochromatic, there would be interference; but with our nearly monochromatic lights, there will be no interference, and that, however narrow the ray may be. For it to be otherwise, the ray would have to be several million times finer than the finest known rays. </blockquote> ** He is saying that sunlight and light from incandescent bulbs has a continuous spectrum of all frequencies. Light from atomic transitions (like a high-pressure sodium lamp) has discrete spectral lines, but those ''still'' have a tiny line-width and two independent polarizations. This was not understood before the fundamental dogma of spectroscopy. The line-width is due to the energy-time uncertainty principle. * Quantum Computing ** [https://quantumexperience.ng.bluemix.net/qx/experience Experiment with IBM's Quantum Computer] * [https://predictivestatmech.org/papers/LifeAfterGraduation.pdf Life After Graduation] ** Sign up to [https://www.usf.edu/system/board-of-trustees/presidential-search-committee/meeting-schedule.aspx Attend an Executive Interview] == Group Work == === Mar. 19 === [[File:MeasProb1.jpg|x100px]] [[File:MeasProb2.jpg|x100px]] [[File:MeasProb3.jpg|x100px]] [[File:MeasProb5.jpg|x100px]] [[File:MeasProb4.jpg|x100px]] === Mar. 28 === [https://predictivestatmech.org/papers/group_wk.pdf Group Work Slides] Note: Assignment for Tuesday, Apr. 2 is on the last slide, above. It is due Thursday, Apr. 4! == Assigned Homework Problems == # Part 1: Origins (Ch. 1, A, and 2) #* Ch. 1, 1-40 (we'll do 41-44 in class) #* Ch. A, 1-14 #** Hint on 12: use i = exp(...) #* Ch. 2, 1-16, 19 #** Hint on 1,2, and 4: use y(x) = A exp(ax) + B exp(b x) and check #** Hint on 5: use exp(i omega t) = ... # Part 2: First Schrodinger Solutions (Ch. 3, C, E, F) #* Ch. 3, 1-19,24,25,28,29,30,32,35 #* Ch. C, all problems except 10; Ch. E, prob. 7; and Ch. F, prob. 1-2,7,11 #** We will only multiply and take determinants of 2x2 matrices in this class, but adding larger matrices should be simple. #* [[Media:HW6.pdf | Supplemental Homework for Quiz 6]] # Part 3: Measurement, Observables, Speakable and Unspeakable (Ch. 4-5) #* Ch. 4, 1-3, 5, 7, 11, 14-16, 21-22 === Special Assignment for Quiz 4 === {| class="wikitable" |- | <math> f_1(x) = e^{ikx} </math> | <math> f_2(x) = 2 i e^{-2x} </math> | <math> f_3(x) = 7 x </math> | <math> f_4(x) = x^2 - 1 </math> | <math> f_5(x) = sin(2 \pi x/a) </math> |} # For each of the following operators, list all of the functions above which are eigenfunctions. There may be more than one. For each, also identify the corresponding eigenvalue. #* <math>\hat P = -i\hbar \frac{d}{dx}</math> #* <math>\hat S = 3</math> #* <math>\hat R = 2 x \frac{d}{dx} - 1</math> #* <math>\hat H = -c \frac{d^2}{dx^2} </math> # Find the normalization constant needed for each of the functions, <math>f_1 -- f_5</math> so that <math>\int_0^a (A_n f_n(x))^2 = 1</math> #* <math>A_1 = </math> #* <math>A_2 = </math> #* <math>A_3 = </math> #* <math>A_4 = </math> #* <math>A_5 = </math> # Complete the following problems from the text: #* 3-1 #* 3-3 #* 3-4 #* 3-5 #* 3-10 === Special Assignment for Quiz 7 === # Provide, in your own words, definitions for each of the following: complete basis, expectation value, commutator, Hermitian operator, dimension, tunneling, nonlinear process, symmetry, continuous / continuity, integrable, divergent (of an expression), "existence" (of a math expression) # <u>For problem 2, choose one of the following two questions: (3 or 4, you do not have to do both)</u> # In the classical Bell experiment, a pair of 2 entangled particles are created in state <math>|\psi\rangle = (|0,1\rangle + |1,0\rangle)/\sqrt{2}</math>. A quantum circuit for creating such Bell states is given by the image below. Compute the final state of track (b) after each of the following measurements has occurred. Note that the two tracks are symmetric, so we can arbitrarily call the first quantum number ''track (a)'' and the second ''track (b)''. For hints, see the note on partial projection. #* Track (a) is measured and found to be in state <math>|0\rangle</math>. #* Track (a) is measured and found to be in state <math>|1\rangle</math>. #* Track (a) is measured and found to be in state <math>(|0\rangle+|1\rangle)/\sqrt{2}</math>. #* Under the first scenario (track (a) is in state <math>|0\rangle</math>), what is the probability that track (b) can be measured in state <math>\cos(\theta)|0\rangle + \sin(\theta)|1\rangle</math>? Compare this to the Bell-state correlation function [https://en.wikipedia.org/wiki/Bell%27s_theorem]. # (<u> Problem 5 from class </u>) A Hadamard gate has matrix representation <math>H = \left[ \begin{array}{cc} 1 & 1 \\ 1 & -1 \end{array}\right]/\sqrt{2}</math>. A qbit initially in state <math>|0\rangle</math> is passed through the Hadamard gate to create an output state. Use <math>|0\rangle = \left[ \begin{array}{c}1 \\ 0\end{array}\right] </math> and <math>|1\rangle = \left[ \begin{array}{c}0 \\ 1\end{array}\right] </math> to compute each of the following: #* The probability of detecting the output state is equal to <math>|0\rangle</math> #* The probability of detecting the output state is equal to <math>|1\rangle</math> #* The expectation value of <math>X = 5 |0\rangle\langle 0| + 2 |1\rangle\langle 1|</math> #* The expectation value <math>\langle 0|X H|0\rangle</math> #* The expectation value <math>\langle 0|H X|0\rangle</math> #* The expectation value <math>\langle 0|H X H|0\rangle</math> #* Which of the above corresponds to the expectation of the operator <math>X</math> when operating on the output state? {{note|Partial projection is what happens to a quantum state when only one part of it is measured. The measured part must be projected into its known answer, while the rest of the state merely goes along for the ride. For our purposes, to do the partial projection of <math>|\psi\rangle</math> which results from finding that track (a) has state <math>|v\rangle</math>, compute <math>\langle v, ?| \psi \rangle</math> using <math>\langle v, ?| = (\langle v|)(\langle ?|)</math> and use distributivity and orthogonality to get rid of all the track (a) state information. Factor off the <math>(\langle ?|)</math> and normalize the result to get the final state of track (b). }} * Reference definitions and Bell state quantum circuit: [[File:definitions7.jpg|x100px]] [[File:BellIBM.png|x100px]] a97f2c98fb373a119ee95a3e4124568dfc260fb6 747 746 2019-04-11T13:06:31Z David M. Rogers 2 wikitext text/x-wiki '''<BIG>Physical Chemistry II</BIG>''' Course Info * Course Numbers CHM 4411-001 * Credit Hours: 4 * Meeting Dates: Jan. 8 - Apr. 23, 2019 ** No Class Mar. 11-17 ** No Class Tuesday, Apr. 2 * Meeting Times: Tues. and Thurs., 9:30-10:45 am in ISA 3048 ** Problem Sessions: Fri., 11am-12 pm in ISA 3050 ** Regular quizzes on Fridays ** Office Hours: Fri., 10-11 am in IDR 200 * Grading: ** Quiz (30%) *** To succeed in the quiz, complete the homework and study the topics covered in the previous week! ** Exam 1 (20%) Fri., Feb. 8 11am-12pm (ISA 3050) ** Exam 2 (20%) Fri., Mar. 8, 11am-12pm (ISA 3050) ** Final (30%) Thurs., May 2 7:30-9:30am (ISA 3048) == Overview and Objectives == This course will introduce you to quantum theory, important for quantitatively describing atomic and molecular structure, chemical bonding and spectra. Students in this course will demonstrate the ability to apply the following ideas: * Relationship between mathematical models and intermolecular forces. * Explaining quantum states and their mathematical and physical properties. * Connecting observed molecular properties with quantum measurements. * Calculation of quantum energy levels and spectra. == Textbooks == * McQuarrie and Simon, Physical Chemistry: A Molecular Approach, University Science Books, 1997. ISBN: 0935702997. * Optional Extras: ** [http://www.feynmanlectures.caltech.edu/I_22.html Complex Algebra] ** [http://www.feynmanlectures.caltech.edu/I_23.html Damped, Driven Harmonic Oscillator] ** [http://www.feynmanlectures.caltech.edu/III_09.html The Ammonia Maser] ** [https://physicstoday.scitation.org/doi/10.1063/PT.3.2550 The Quantum Credo] ** [https://quantummechanics.ucsd.edu/ph130a/130_notes/130_notes.html Quantum Physics Online] (full year course) * Quantum Advances Nobel Prize Lectures ** [https://www.nobelprize.org/prizes/chemistry/2013/karplus/facts/ Karplus, Levitt and Warshel, 2013] ** [https://www.nobelprize.org/prizes/physics/2012/haroche/facts/ Haroche and Wineland, 2012] ** [https://www.nobelprize.org/prizes/physics/2005/hall/facts/ Glauber, Hall, and Hänsch, 2005] ** [https://www.nobelprize.org/prizes/chemistry/1998/kohn/facts/ Kohn and Pople, 1998] ** [https://www.nobelprize.org/prizes/chemistry/1992/marcus/facts/ Rudolph Marcus, 1992] ** [https://www.nobelprize.org/prizes/chemistry/1991/ernst/facts/ Richard Ernst, 1991] ** [https://www.nobelprize.org/prizes/physics/1954/born/facts/ Born and Bothe, 1954] ** [https://www.nobelprize.org/prizes/physics/1952/bloch/biographical/ Bloch and Purcell, 1952] ** [https://www.nobelprize.org/prizes/physics/1945/pauli/facts/ Wolfgang Pauli, 1945] ** [https://www.nobelprize.org/prizes/physics/1933/schrodinger/facts/ Schrödinger and Dirac, 1933] ** [https://www.nobelprize.org/prizes/physics/1932/heisenberg/facts/ Werner Heisenberg, 1932] ** [https://www.nobelprize.org/prizes/physics/1921/einstein/facts/ Albert Einstein, 1921] ** [https://www.nobelprize.org/prizes/physics/1918/planck/facts/ Max Planck, 1918] * Advanced reading: ** [https://dx.doi.org/10.1093/acprof:oso/9780198509141.001.0001 Exploring the Quantum: Atoms, Cavities, and Photons] (Haroche and Raimond's book) * Super-advanced reading: ** [https://doi.org/10.1017/9781316995457 Collapse of The Wave Function] == Resources == * Visualization of Modes: ** [https://www.youtube.com/watch?v=BE827gwnnk4 Wine Glass] ** [https://www.youtube.com/watch?v=v4ELxKKT5Rw&t=4s Drum Head] [https://youtu.be/QksHbCwYngw?t=5 see also] *** Note: Modes are indexed by 2 numbers for a 2D surface. ** [https://www.youtube.com/watch?v=Qf0t4qIVWF4 Another 2D example] *** This one is part-way between a particle in a 2D box and a circular drum, since the center is a special point. ** [https://www.youtube.com/watch?v=6JeyiM0YNo4 Violin String] *** Note: This looks like a sawtooth wave, so is less connected to quantum and more related to classical solitons. ** [https://youtu.be/0Ddr_ipAMqE?t=224 Cymbals] *** Note: This shows many modes excited at once, so it is not a simple shape. Quantum-mechanically, this situation is called a superposition. ** [https://www.youtube.com/watch?v=fMsjyQHtmiU Tacoma Narrows Bridge] *** Acoustic and vibrational modes are very important in mechanical structures. We will calculate them for atoms and optical cavities. ** [https://www.youtube.com/watch?v=RXPlHa5mRBE Audio in general] * Fundamental Dogma of Spectroscopy, <math>|E_2 - E_1| = h\nu</math> ** Here is Henri Poincaré's [https://www.gutenberg.org/files/37157/37157-pdf.pdf Science and Hypothesis], 1905. <blockquote> [On finding atomic causes of laboratory observations,] I shall only give one example which has always struck me rather forcibly. If I decompose white light, I shall be able to isolate a portion of the spectrum, but however small it may be, it will always be a certain width. In the same way the natural lights which are called monochromatic give us a very fine ray, but one which is not, however, infinitely fine. It might be supposed that in the experimental study of the properties of these natural lights, by operating with finer and finer rays, and passing on at last to the limit, so to speak, we should eventually obtain the properties of a rigorously monochromatic light. That would not be accurate. I assume that two rays emanate from the same source, that they are first polarised in planes at right angles, that they are then brought back again to the same plane of polarisation, and that we try to obtain interference. If the light were rigorously monochromatic, there would be interference; but with our nearly monochromatic lights, there will be no interference, and that, however narrow the ray may be. For it to be otherwise, the ray would have to be several million times finer than the finest known rays. </blockquote> ** He is saying that sunlight and light from incandescent bulbs has a continuous spectrum of all frequencies. Light from atomic transitions (like a high-pressure sodium lamp) has discrete spectral lines, but those ''still'' have a tiny line-width and two independent polarizations. This was not understood before the fundamental dogma of spectroscopy. The line-width is due to the energy-time uncertainty principle. * Quantum Computing ** [https://quantumexperience.ng.bluemix.net/qx/experience Experiment with IBM's Quantum Computer] * [https://predictivestatmech.org/papers/LifeAfterGraduation.pdf Life After Graduation] ** Sign up to [https://www.usf.edu/system/board-of-trustees/presidential-search-committee/meeting-schedule.aspx Attend an Executive Interview] == Group Work == === Mar. 19 === [[File:MeasProb1.jpg|x100px]] [[File:MeasProb2.jpg|x100px]] [[File:MeasProb3.jpg|x100px]] [[File:MeasProb5.jpg|x100px]] [[File:MeasProb4.jpg|x100px]] === Mar. 28 === [https://predictivestatmech.org/papers/group_wk.pdf Group Work Slides] Note: Assignment for Tuesday, Apr. 2 is on the last slide, above. It is due Thursday, Apr. 4! == Assigned Homework Problems == # Part 1: Origins (Ch. 1, A, and 2) #* Ch. 1, 1-40 (we'll do 41-44 in class) #* Ch. A, 1-14 #** Hint on 12: use i = exp(...) #* Ch. 2, 1-16, 19 #** Hint on 1,2, and 4: use y(x) = A exp(ax) + B exp(b x) and check #** Hint on 5: use exp(i omega t) = ... # Part 2: First Schrodinger Solutions (Ch. 3, C, E, F) #* Ch. 3, 1-19,24,25,28,29,30,32,35 #* Ch. C, all problems except 10; Ch. E, prob. 7; and Ch. F, prob. 1-2,7,11 #** We will only multiply and take determinants of 2x2 matrices in this class, but adding larger matrices should be simple. #* [[Media:HW6.pdf | Supplemental Homework for Quiz 6]] # Part 3: Measurement, Observables, Speakable and Unspeakable (Ch. 4) #* Ch. 4, 1-3, 5, 7, 11, 14-16, 21-22 # Part 4: (Ch. 5,9-10,13-14) #* Harmonic Oscillator: 5: 1-3, 7-10, 12-16, 18, 20-22, 27, 39-40 #* Rigid Rotor: 33-35, 37, 44-47 === Special Assignment for Quiz 4 === {| class="wikitable" |- | <math> f_1(x) = e^{ikx} </math> | <math> f_2(x) = 2 i e^{-2x} </math> | <math> f_3(x) = 7 x </math> | <math> f_4(x) = x^2 - 1 </math> | <math> f_5(x) = sin(2 \pi x/a) </math> |} # For each of the following operators, list all of the functions above which are eigenfunctions. There may be more than one. For each, also identify the corresponding eigenvalue. #* <math>\hat P = -i\hbar \frac{d}{dx}</math> #* <math>\hat S = 3</math> #* <math>\hat R = 2 x \frac{d}{dx} - 1</math> #* <math>\hat H = -c \frac{d^2}{dx^2} </math> # Find the normalization constant needed for each of the functions, <math>f_1 -- f_5</math> so that <math>\int_0^a (A_n f_n(x))^2 = 1</math> #* <math>A_1 = </math> #* <math>A_2 = </math> #* <math>A_3 = </math> #* <math>A_4 = </math> #* <math>A_5 = </math> # Complete the following problems from the text: #* 3-1 #* 3-3 #* 3-4 #* 3-5 #* 3-10 === Special Assignment for Quiz 7 === # Provide, in your own words, definitions for each of the following: complete basis, expectation value, commutator, Hermitian operator, dimension, tunneling, nonlinear process, symmetry, continuous / continuity, integrable, divergent (of an expression), "existence" (of a math expression) # <u>For problem 2, choose one of the following two questions: (3 or 4, you do not have to do both)</u> # In the classical Bell experiment, a pair of 2 entangled particles are created in state <math>|\psi\rangle = (|0,1\rangle + |1,0\rangle)/\sqrt{2}</math>. A quantum circuit for creating such Bell states is given by the image below. Compute the final state of track (b) after each of the following measurements has occurred. Note that the two tracks are symmetric, so we can arbitrarily call the first quantum number ''track (a)'' and the second ''track (b)''. For hints, see the note on partial projection. #* Track (a) is measured and found to be in state <math>|0\rangle</math>. #* Track (a) is measured and found to be in state <math>|1\rangle</math>. #* Track (a) is measured and found to be in state <math>(|0\rangle+|1\rangle)/\sqrt{2}</math>. #* Under the first scenario (track (a) is in state <math>|0\rangle</math>), what is the probability that track (b) can be measured in state <math>\cos(\theta)|0\rangle + \sin(\theta)|1\rangle</math>? Compare this to the Bell-state correlation function [https://en.wikipedia.org/wiki/Bell%27s_theorem]. # (<u> Problem 5 from class </u>) A Hadamard gate has matrix representation <math>H = \left[ \begin{array}{cc} 1 & 1 \\ 1 & -1 \end{array}\right]/\sqrt{2}</math>. A qbit initially in state <math>|0\rangle</math> is passed through the Hadamard gate to create an output state. Use <math>|0\rangle = \left[ \begin{array}{c}1 \\ 0\end{array}\right] </math> and <math>|1\rangle = \left[ \begin{array}{c}0 \\ 1\end{array}\right] </math> to compute each of the following: #* The probability of detecting the output state is equal to <math>|0\rangle</math> #* The probability of detecting the output state is equal to <math>|1\rangle</math> #* The expectation value of <math>X = 5 |0\rangle\langle 0| + 2 |1\rangle\langle 1|</math> #* The expectation value <math>\langle 0|X H|0\rangle</math> #* The expectation value <math>\langle 0|H X|0\rangle</math> #* The expectation value <math>\langle 0|H X H|0\rangle</math> #* Which of the above corresponds to the expectation of the operator <math>X</math> when operating on the output state? {{note|Partial projection is what happens to a quantum state when only one part of it is measured. The measured part must be projected into its known answer, while the rest of the state merely goes along for the ride. For our purposes, to do the partial projection of <math>|\psi\rangle</math> which results from finding that track (a) has state <math>|v\rangle</math>, compute <math>\langle v, ?| \psi \rangle</math> using <math>\langle v, ?| = (\langle v|)(\langle ?|)</math> and use distributivity and orthogonality to get rid of all the track (a) state information. Factor off the <math>(\langle ?|)</math> and normalize the result to get the final state of track (b). }} * Reference definitions and Bell state quantum circuit: [[File:definitions7.jpg|x100px]] [[File:BellIBM.png|x100px]] 3bfcc1171fef52eda7f318efad0f9da7ae022cb8 748 747 2019-04-16T22:31:51Z David M. Rogers 2 wikitext text/x-wiki '''<BIG>Physical Chemistry II</BIG>''' Course Info * Course Numbers CHM 4411-001 * Credit Hours: 4 * Meeting Dates: Jan. 8 - Apr. 23, 2019 ** No Class Mar. 11-17 ** No Class Tuesday, Apr. 2 * Meeting Times: Tues. and Thurs., 9:30-10:45 am in ISA 3048 ** Problem Sessions: Fri., 11am-12 pm in ISA 3050 ** Regular quizzes on Fridays ** Office Hours: Fri., 10-11 am in IDR 200 * Grading: ** Quiz (30%) *** To succeed in the quiz, complete the homework and study the topics covered in the previous week! ** Exam 1 (20%) Fri., Feb. 8 11am-12pm (ISA 3050) ** Exam 2 (20%) Fri., Mar. 8, 11am-12pm (ISA 3050) ** Final (30%) Thurs., May 2 7:30-9:30am (ISA 3048) == Overview and Objectives == This course will introduce you to quantum theory, important for quantitatively describing atomic and molecular structure, chemical bonding and spectra. Students in this course will demonstrate the ability to apply the following ideas: * Relationship between mathematical models and intermolecular forces. * Explaining quantum states and their mathematical and physical properties. * Connecting observed molecular properties with quantum measurements. * Calculation of quantum energy levels and spectra. == Textbooks == * McQuarrie and Simon, Physical Chemistry: A Molecular Approach, University Science Books, 1997. ISBN: 0935702997. * Optional Extras: ** [http://www.feynmanlectures.caltech.edu/I_22.html Complex Algebra] ** [http://www.feynmanlectures.caltech.edu/I_23.html Damped, Driven Harmonic Oscillator] ** [http://www.feynmanlectures.caltech.edu/III_09.html The Ammonia Maser] ** [https://physicstoday.scitation.org/doi/10.1063/PT.3.2550 The Quantum Credo] ** [https://quantummechanics.ucsd.edu/ph130a/130_notes/130_notes.html Quantum Physics Online] (full year course) * Quantum Advances Nobel Prize Lectures ** [https://www.nobelprize.org/prizes/chemistry/2013/karplus/facts/ Karplus, Levitt and Warshel, 2013] ** [https://www.nobelprize.org/prizes/physics/2012/haroche/facts/ Haroche and Wineland, 2012] ** [https://www.nobelprize.org/prizes/physics/2005/hall/facts/ Glauber, Hall, and Hänsch, 2005] ** [https://www.nobelprize.org/prizes/chemistry/1998/kohn/facts/ Kohn and Pople, 1998] ** [https://www.nobelprize.org/prizes/chemistry/1992/marcus/facts/ Rudolph Marcus, 1992] ** [https://www.nobelprize.org/prizes/chemistry/1991/ernst/facts/ Richard Ernst, 1991] ** [https://www.nobelprize.org/prizes/physics/1954/born/facts/ Born and Bothe, 1954] ** [https://www.nobelprize.org/prizes/physics/1952/bloch/biographical/ Bloch and Purcell, 1952] ** [https://www.nobelprize.org/prizes/physics/1945/pauli/facts/ Wolfgang Pauli, 1945] ** [https://www.nobelprize.org/prizes/physics/1933/schrodinger/facts/ Schrödinger and Dirac, 1933] ** [https://www.nobelprize.org/prizes/physics/1932/heisenberg/facts/ Werner Heisenberg, 1932] ** [https://www.nobelprize.org/prizes/physics/1921/einstein/facts/ Albert Einstein, 1921] ** [https://www.nobelprize.org/prizes/physics/1918/planck/facts/ Max Planck, 1918] * Advanced reading: ** [https://dx.doi.org/10.1093/acprof:oso/9780198509141.001.0001 Exploring the Quantum: Atoms, Cavities, and Photons] (Haroche and Raimond's book) * Super-advanced reading: ** [https://doi.org/10.1017/9781316995457 Collapse of The Wave Function] == Resources == * Visualization of Modes: ** [https://www.youtube.com/watch?v=BE827gwnnk4 Wine Glass] ** [https://www.youtube.com/watch?v=v4ELxKKT5Rw&t=4s Drum Head] [https://youtu.be/QksHbCwYngw?t=5 see also] *** Note: Modes are indexed by 2 numbers for a 2D surface. ** [https://www.youtube.com/watch?v=Qf0t4qIVWF4 Another 2D example] *** This one is part-way between a particle in a 2D box and a circular drum, since the center is a special point. ** [https://www.youtube.com/watch?v=6JeyiM0YNo4 Violin String] *** Note: This looks like a sawtooth wave, so is less connected to quantum and more related to classical solitons. ** [https://youtu.be/0Ddr_ipAMqE?t=224 Cymbals] *** Note: This shows many modes excited at once, so it is not a simple shape. Quantum-mechanically, this situation is called a superposition. ** [https://www.youtube.com/watch?v=fMsjyQHtmiU Tacoma Narrows Bridge] *** Acoustic and vibrational modes are very important in mechanical structures. We will calculate them for atoms and optical cavities. ** [https://www.youtube.com/watch?v=RXPlHa5mRBE Audio in general] * Fundamental Dogma of Spectroscopy, <math>|E_2 - E_1| = h\nu</math> ** Here is Henri Poincaré's [https://www.gutenberg.org/files/37157/37157-pdf.pdf Science and Hypothesis], 1905. <blockquote> [On finding atomic causes of laboratory observations,] I shall only give one example which has always struck me rather forcibly. If I decompose white light, I shall be able to isolate a portion of the spectrum, but however small it may be, it will always be a certain width. In the same way the natural lights which are called monochromatic give us a very fine ray, but one which is not, however, infinitely fine. It might be supposed that in the experimental study of the properties of these natural lights, by operating with finer and finer rays, and passing on at last to the limit, so to speak, we should eventually obtain the properties of a rigorously monochromatic light. That would not be accurate. I assume that two rays emanate from the same source, that they are first polarised in planes at right angles, that they are then brought back again to the same plane of polarisation, and that we try to obtain interference. If the light were rigorously monochromatic, there would be interference; but with our nearly monochromatic lights, there will be no interference, and that, however narrow the ray may be. For it to be otherwise, the ray would have to be several million times finer than the finest known rays. </blockquote> ** He is saying that sunlight and light from incandescent bulbs has a continuous spectrum of all frequencies. Light from atomic transitions (like a high-pressure sodium lamp) has discrete spectral lines, but those ''still'' have a tiny line-width and two independent polarizations. This was not understood before the fundamental dogma of spectroscopy. The line-width is due to the energy-time uncertainty principle. * Quantum Computing ** [https://quantumexperience.ng.bluemix.net/qx/experience Experiment with IBM's Quantum Computer] * [https://predictivestatmech.org/papers/LifeAfterGraduation.pdf Life After Graduation] ** Sign up to [https://www.usf.edu/system/board-of-trustees/presidential-search-committee/meeting-schedule.aspx Attend an Executive Interview] == Group Work == === Mar. 19 === [[File:MeasProb1.jpg|x100px]] [[File:MeasProb2.jpg|x100px]] [[File:MeasProb3.jpg|x100px]] [[File:MeasProb5.jpg|x100px]] [[File:MeasProb4.jpg|x100px]] === Mar. 28 === [https://predictivestatmech.org/papers/group_wk.pdf Group Work Slides] Note: Assignment for Tuesday, Apr. 2 is on the last slide, above. It is due Thursday, Apr. 4! == Assigned Homework Problems == # Part 1: Origins (Ch. 1, A, and 2) #* Ch. 1, 1-40 (we'll do 41-44 in class) #* Ch. A, 1-14 #** Hint on 12: use i = exp(...) #* Ch. 2, 1-16, 19 #** Hint on 1,2, and 4: use y(x) = A exp(ax) + B exp(b x) and check #** Hint on 5: use exp(i omega t) = ... # Part 2: First Schrodinger Solutions (Ch. 3, C, E, F) #* Ch. 3, 1-19,24,25,28,29,30,32,35 #* Ch. C, all problems except 10; Ch. E, prob. 7; and Ch. F, prob. 1-2,7,11 #** We will only multiply and take determinants of 2x2 matrices in this class, but adding larger matrices should be simple. #* [[Media:HW6.pdf | Supplemental Homework for Quiz 6]] # Part 3: Measurement, Observables, Speakable and Unspeakable (Ch. 4) #* Ch. 4, 1-3, 5, 7, 11, 14-16, 21-22 # Part 4: (Ch. 5,6,9-10,13-14) #* Harmonic Oscillator: Ch. 5: 1-3, 7-10, 12-16, 18, 20-22, 27, 39-40 #* Rigid Rotor: Ch. 5: 33-35, 37, 44-47 #* Hydrogen Atom: Ch. 6: 4,5,8,13,20,27,29,32-36 #* Other applications: Ch. 9:23, 24, 34, 36, 38; Ch. 10: 44-47 #* Ch. 13: 1-5,7-9, Ch. 14: 2-5, 18-20 === Special Assignment for Quiz 4 === {| class="wikitable" |- | <math> f_1(x) = e^{ikx} </math> | <math> f_2(x) = 2 i e^{-2x} </math> | <math> f_3(x) = 7 x </math> | <math> f_4(x) = x^2 - 1 </math> | <math> f_5(x) = sin(2 \pi x/a) </math> |} # For each of the following operators, list all of the functions above which are eigenfunctions. There may be more than one. For each, also identify the corresponding eigenvalue. #* <math>\hat P = -i\hbar \frac{d}{dx}</math> #* <math>\hat S = 3</math> #* <math>\hat R = 2 x \frac{d}{dx} - 1</math> #* <math>\hat H = -c \frac{d^2}{dx^2} </math> # Find the normalization constant needed for each of the functions, <math>f_1 -- f_5</math> so that <math>\int_0^a (A_n f_n(x))^2 = 1</math> #* <math>A_1 = </math> #* <math>A_2 = </math> #* <math>A_3 = </math> #* <math>A_4 = </math> #* <math>A_5 = </math> # Complete the following problems from the text: #* 3-1 #* 3-3 #* 3-4 #* 3-5 #* 3-10 === Special Assignment for Quiz 7 === # Provide, in your own words, definitions for each of the following: complete basis, expectation value, commutator, Hermitian operator, dimension, tunneling, nonlinear process, symmetry, continuous / continuity, integrable, divergent (of an expression), "existence" (of a math expression) # <u>For problem 2, choose one of the following two questions: (3 or 4, you do not have to do both)</u> # In the classical Bell experiment, a pair of 2 entangled particles are created in state <math>|\psi\rangle = (|0,1\rangle + |1,0\rangle)/\sqrt{2}</math>. A quantum circuit for creating such Bell states is given by the image below. Compute the final state of track (b) after each of the following measurements has occurred. Note that the two tracks are symmetric, so we can arbitrarily call the first quantum number ''track (a)'' and the second ''track (b)''. For hints, see the note on partial projection. #* Track (a) is measured and found to be in state <math>|0\rangle</math>. #* Track (a) is measured and found to be in state <math>|1\rangle</math>. #* Track (a) is measured and found to be in state <math>(|0\rangle+|1\rangle)/\sqrt{2}</math>. #* Under the first scenario (track (a) is in state <math>|0\rangle</math>), what is the probability that track (b) can be measured in state <math>\cos(\theta)|0\rangle + \sin(\theta)|1\rangle</math>? Compare this to the Bell-state correlation function [https://en.wikipedia.org/wiki/Bell%27s_theorem]. # (<u> Problem 5 from class </u>) A Hadamard gate has matrix representation <math>H = \left[ \begin{array}{cc} 1 & 1 \\ 1 & -1 \end{array}\right]/\sqrt{2}</math>. A qbit initially in state <math>|0\rangle</math> is passed through the Hadamard gate to create an output state. Use <math>|0\rangle = \left[ \begin{array}{c}1 \\ 0\end{array}\right] </math> and <math>|1\rangle = \left[ \begin{array}{c}0 \\ 1\end{array}\right] </math> to compute each of the following: #* The probability of detecting the output state is equal to <math>|0\rangle</math> #* The probability of detecting the output state is equal to <math>|1\rangle</math> #* The expectation value of <math>X = 5 |0\rangle\langle 0| + 2 |1\rangle\langle 1|</math> #* The expectation value <math>\langle 0|X H|0\rangle</math> #* The expectation value <math>\langle 0|H X|0\rangle</math> #* The expectation value <math>\langle 0|H X H|0\rangle</math> #* Which of the above corresponds to the expectation of the operator <math>X</math> when operating on the output state? {{note|Partial projection is what happens to a quantum state when only one part of it is measured. The measured part must be projected into its known answer, while the rest of the state merely goes along for the ride. For our purposes, to do the partial projection of <math>|\psi\rangle</math> which results from finding that track (a) has state <math>|v\rangle</math>, compute <math>\langle v, ?| \psi \rangle</math> using <math>\langle v, ?| = (\langle v|)(\langle ?|)</math> and use distributivity and orthogonality to get rid of all the track (a) state information. Factor off the <math>(\langle ?|)</math> and normalize the result to get the final state of track (b). }} * Reference definitions and Bell state quantum circuit: [[File:definitions7.jpg|x100px]] [[File:BellIBM.png|x100px]] ba579c78d5d3a6cfca9eb37955331888d97f810a Publications 0 8 715 702 2019-02-16T14:28:12Z David M. Rogers 2 wikitext text/x-wiki {| cellpadding="4" style="border: 1px solid darkgray;" |- style="border: 1px solid darkgray;" || David M. Rogers, "Dual Characterization of the Ornstein-Zernike Equation in Moment Space." [https://arxiv.org/abs/1807.05963 submitted, 2019]. I re-write Ornstein-Zernike theory in a convenient matrix basis so that future computational implementations can be made robust and that numerical and fitting error can be tightly controlled. It is hoped that the framework can be used in the near future to compute molecular solvation free energies and to realize its enormous potential economic and environmental benefits for formulating industrial fluids and consumer products. |- style="border: 1px solid darkgray;" || Phillip S. Hudson, Stefan Boresch, David M. Rogers, and H. Lee Woodcock., "Accelerating QM/MM Free Energy Computations via Intramolecular Force Matching" [https://dx.doi.org/10.1021/acs.jctc.8b00517 J. Chem. Theory Comput., 14 (12):6327–35, 2018]. My co-authors apply [https://github.com/frobnitzem/chemparam my algorithm and software implementation of Bayesian generalized linear model regression with linear inequality constraints] to estimate molecular modeling parameters from quantum their mechanical calculations. They find the method gives robust results that greatly increase efficiency of additional simulations. |- style="border: 1px solid darkgray;" || David M. Rogers, "Extension of Kirkwood-Buff theory to the canonical ensemble." [https://aip.scitation.org/doi/full/10.1063/1.5011696 J. Chem. Phys., 148:054102, 2018]. We present a way to utilize Essmann et. al.'s smooth particle mesh Ewald algorithm ([https://github.com/frobnitzem/EwaldCorrel implemented here]) to get the low-angle direct correlation function from canonical ensemble simulation data. The result avoids well-documented issues with long wavelength (small-angle scattering) modes that appear when using real-space methods. This result is combined with new estimates of finite-size effects and grand-canonical ensemble corrections to provide definitive results on the problem of extrapolating Kirkwood-Buff integrals. |- style="border: 1px solid darkgray;" || Juan M. Vanegas, Frank Heinrich, David M.Rogers, Bryan D. Carson, Sadie La Bauve, Briana C. Vernon, Bulent Akgun, Sushil Satija, Aihua Zheng, Margaret Kielian, Susan B. Rempe, and Michael S. Kent, "Insertion of Dengue E into lipid bilayers studied by neutron reflectivity and molecular dynamics simulations." [https://authors.elsevier.com/c/1WcOv1ClS9Jvp BBA 1860(5):1216-1230, 2018]. We compare neutron reflectivity experiments to molecular dynamics calculations on the orientation and binding position of the Dengue envelope protein responsible for viral escape from the host cell's endosome. In addition to the hydrophobic fusion tip, we find important roles for three positively-charged residues in the viral protein that contribute to host membrane binding. These could potentially be targeted by new anti-viral medicines. |- style="border: 1px solid darkgray;" || David M. Rogers, "An information theory model for dissipation in open quantum systems." [http://iopscience.iop.org/article/10.1088/1742-6596/880/1/012039 J. Phys., Conference Series 880(1):012039, 2017]. This paper presents a new, simple ansatz for adding dissipation to arbitrary stochastic forcing of a quantum dynamical system. For Gaussian random forces, it predicts a Lindblad equation identical to the Caldeira-Leggett model up to order <math>\beta^2</math>, where the same term is present with a different prefactor. The system-centric, phase space picture here shows that the <math>\beta^2</math> term represents a quantum confinement effect. |- style="border: 1px solid darkgray;" || David M. Rogers, "Einstein-Podolsky-Rosen paradox implies a minimum achievable temperature." [http://journals.aps.org/pre/abstract/10.1103/PhysRevE.95.012149 Phys. Rev. E 95, 012149, 2017.] This paper provides measurement-based definitions of heat and work that can be realized in current laboratory setups. The first and second laws are proved despite the fact that temperature is treated completely as as a property of the interacting reservoir. Measurements of the work are subject to the famous EPR paradox because the work exchanged between two quantum systems is not defined until a measurement is performed. Based on this, we show that even an environment at absolute zero cannot lower a system's temperature below a minimum characteristic of the way the environment is coupled to the system. |- style="border: 1px solid darkgray;" || Guy W. Dayhoff II and David M. Rogers, "Driving forces in MD simulations of transition and ‘Free’ flows." [http://dx.doi.org/10.1080/08927022.2016.1273524 Mol. Sim. 43(5-6), pp. 467-477, 2017.] (special issue on Surface Chemistry) We set out to test the Joule-Thomson analysis of thermodynamics of porous flow for gasses through a nanopore and found that while local equilibrium is established in the steady-state, finite-size effects cause heat flow opposite the flow direction that violates the assumption of an adiabatic porous plug. |- style="border: 1px solid darkgray;" || David M. Rogers, "Efficient Primitives for Standard Tensor Linear Algebra." [https://doi.org/10.1145/2949550.2949580 Proc. XSEDE16 Conference on Diversity, Big Data, and Science at Scale, no. 14, 2016.] This paper introduces 3 basic functions that generalize BLAS to tensors and presents a code generation strategy for their [https://github.com/frobnitzem/slack efficient execution on GPUs] that achieves peak performance on the same order of magnitude as for traditional, vendor-optimized matrix-multiplications. |- style="border: 1px solid darkgray;" || David M. Rogers, "Overcoming the Minimum Image Constraint Using the Closest Point Search." [http://dx.doi.org/10.1016/j.jmgm.2016.07.004 J. Mol. Graph. Model 68, pp. 197–205, 2016.] An elegant solution to the problem of finding periodic images in non-rectangular lattices is provided based on the closest vector problem. Related code is here: [https://github.com/frobnitzem/pbctools] |- style="border: 1px solid darkgray;" || Elisa La Bauve, Briana C. Vernon, Dongmei Ye, David M. Rogers, Cathryn M. Siegrist, Bryan Carson. Susan L. Rempe, Aihua Zheng, Margaret C. Kielian, Andrew P. Shreve, and Michael S. Kent. "Method for measuring the unbinding energy of strongly-bound membrane-associated proteins." [http://dx.doi.org/10.1016/j.bbamem.2016.07.004 BBA Biomembranes 1858(11): 2753–62, 2016.] This paper gives multiple experimental measurements of binding energy between the Dengue virus envelope protein and host membranes that largely confirm our computational predictions from 2015. I contributed all the theory for terminal velocity during sedimentation, along with a novel kinetic analysis providing the free energy and enthalpy of the dissociation barrier (all the details are at the end of the appendix). |- style="border: 1px solid darkgray;" || David M. Rogers. "Thermodynamics of Maximum Transition Entropy for Quantum Assemblies." [http://arxiv.org/abs/1503.01232 arXiv:1503.01232 submitted, 2016]. The work presents a new, general, theoretical foundation for the dynamics of open quantum systems modeled on the maximum entropy derivation of equilibrium statistical mechanics. Computational results are presented for three detailed systems to validate and reinforce the theory. It represents a significant advancement for the field, as it lucidly connects the dynamics of a single wavefunction plus environmental noise to the Caldeira-Leggett model for density matrices. |- style="border: 1px solid darkgray;" || Andriy Anishkin, Juan M. Vanegas, David M. Rogers, Philip L. Lorenzi, Wai Kin Chan, Preeti Purwaha, John N. Weinstein, Sergei Sukharev, and Susan B. Rempe. "Catalytic Role of the Substrate Defines Specificity of Therapeutic L-Asparaginase." [http://dx.doi.org/10.1016/j.jmb.2015.06.017 J. Mol. Biol. 427:2867-2885, 2015]. We present an explanation for the (until now controversial) catalytic mechanism of type 2 bacterial L-asparaginase enzymes. By using the carboxylic acid of the substrate (asparagine) as the proton acceptor, this enzyme is able to preferentially carry out deamidation on asparagine more quickly than for the competing substrate, glutamine. The hypothesis, re-discovered from our MD simulations, was first put forward years ago in contested experimental studies, and now finds additional support from our MD and QM calculations. |- style="border: 1px solid darkgray;" || David M. Rogers. "Towards a Direct, By-Need Evaluator for Dependently Typed Languages." [http://arxiv.org/abs/1509.07036 arXiv:1509.07036 submitted, 2015]. This paper describes the implementation of a new interpreted language for distributed parallel computing. It achieves its goal by maintaining pure functional semantics, allowing all terms in the language to be partially evaluated and serialized to network storage at any point during computation. |- style="border: 1px solid darkgray;" || Marielle Soniat, David M. Rogers, and Susan Rempe. "Dispersion- and Exchange-Corrected Density Functional Theory for Sodium Ion Hydration." [http://pubs.acs.org/doi/abs/10.1021/acs.jctc.5b00357 J. Chem. Theory. Comput. 142:074101, 2015]. We studied the influence of dispersion energy corrections on the free energy of formation for sodium-water clusters computed with DFT and wound up discovering that dispersion and split-range exchange functionals can somewhat counter-balance each other. The charged sodium ion pulls on the water's electrons, clearly showing which density functionals over-polarize compared to CCSD. Split-range exchange can reduce this over-polarization, but results in reduced electrostatic interaction. Dispersion can lower the binding energy again to counter-balance. So, functionals fit to experimental formation energies need both effects to avoid lowering energies by over-polarizing. |- style="border: 1px solid darkgray;" || David M. Rogers. "Real-space quadrature: a convenient, efficient representation for multipole expansions." [http://dx.doi.org/10.1063/1.4907404 J. Chem. Phys. 142:074101, 2015]. ([http://predictivestatmech.org/papers/real-poles.pdf Presentation]) I introduce sets of point charges that are able to simultaneously reproduce all multipole (spherical harmonic) expansions up to arbitrary order. The number of points is space-optimal. Translations are described from the usual harmonics and from Cartesian moments (dipole, quadrupole, etc.) on supersymmetric tensors to directional moments using the point weight distribution. Many applications are possible, including trivial implementation of multipoles in molecular mechanics and representing probability distributions over rotation space. |- style="border: 1px solid darkgray;" || David M. Rogers, Michael S. Kent, and Susan B. Rempe, "Molecular basis of endosomal-membrane association for the dengue virus envelope protein." [http://dx.doi.org/10.1016/j.bbamem.2014.12.018 BBA Biomembranes 1848(4):1041-52, 2015.] A fully atomistic potential of mean force for association of the viral envelope protein from Dengue virus was compared to a Poisson-Boltzmann electrostatic plus dispersion model. The results are consistent, showing hope for this type of combined scale simulation. |- style="border: 1px solid darkgray;" || Yaqin Fu, Binsong Li, Ying-Bing Jiang, Darren R. Dunphy, Andy Tsai, Siu-Yue Tam, Hongyou Fan, Hongxia Zhan, David Rogers, Susan Rempe, Plamen Atanassov, Joseph L. Cecchi, and C. Jeffrey Brinker "Atomic Layer Deposition of L-Alanine Polypeptide." [http://pubs.acs.org/doi/abs/10.1021/ja5043403 JACS 136(45):15821–4, 2014.] This paper with our experimental collaborators carried out blocked peptide synthesis by vapor-depositing Boc-L-alanine to create a uniform thin film of polypeptides grown on a silica substrate activated by aminopropyltrimethoxysilane. |- style="border: 1px solid darkgray;" || David M. Rogers. "Silmaril, A Functional Language for Distributed Parallel Evaluation." [http://predictivestatmech.org/sil/papers/sil.pdf Submitted version] |- style="border: 1px solid darkgray;" || Mathias B. Andersen, David M. Rogers, Junyu Mai, Benjamin Schudel, Anson V. Hatch, Susan B. Rempe and Ali Mani. "Spatiotemporal pH dynamics in concentration polarization near ion-selective membranes." [http://dx.doi.org/10.1021/la5014297 Langmuir, 30(26):7902–7912, 2014] |- style="border: 1px solid darkgray;" || W. K. Chan, P. L. Lorenzi, A. Anishkin, P. Purwaha, D. M. Rogers, S. Sukharev, S.B. Rempe, and J. N. Weinstein. "The glutaminase activity of l-asparaginase is not required for anticancer activity against ASNS-negative cells." [http://dx.doi.org/10.1182/blood-2013-10-535112 Blood. 123(23):3596-606, 2014]. |- style="border: 1px solid darkgray;" || David M. Rogers, Dian Jiao, Lawrence Pratt, and Susan B. Rempe. "Structural Models and Molecular Thermodynamics of Hydration of Ions and Small Molecules" [http://dx.doi.org/10.1016/B978-0-444-59440-2.00004-1 Annu. Rep. Comp. Chem. 8:71–127, 2012.] |- style="border: 1px solid darkgray;" || David M. Rogers and Susan B. Rempe. "Irreversible Thermodynamics." [http://dx.doi.org/10.1088/1742-6596/402/1/012014 J. Phys.: Conf. Ser. 402:012014, 2012]. |- style="border: 1px solid darkgray;" || David M. Rogers, Thomas L. Beck, and Susan B. Rempe. [[Media:Dmroge_InfoNonequ2011.pdf|"An Information Theory Approach to Nonlinear, Nonequilibrium Thermodynamics."]] [http://dx.doi.org/10.1007/s10955-011-0358-9 J. Stat. Phys. 145(2):385-409, 2011] We show how the interpretation of thermodynamic states as representing system information leads naturally to thermodynamic cycles and the first and second laws of thermodynamics as well as similar formulations for nontrivial nonequilibrium problems. The logical development of the theory also leads naturally to correct indistinguishability factors in the partition function. |- style="border: 1px solid darkgray;" || Sameer Varma, David M. Rogers, Lawrence R. Pratt, and Susan B. Rempe. "Perspectives on Ion Selectivity: Design Principles for K+ Selectivity in Membrane Transport." [http://jgp.rupress.org/content/137/6/479.full J. Gen. Physiol., 137(6):479-488, 2011.] We review the development of models for understanding the physical basis of selectivity for K+ ions over Na+, its sibling only one row behind, in membrane channels and transporters. Although the problem is subtle because of the morass of competing effects, we emphasize work analyzing the systematic influence of the environment on tipping local binding site structure toward selective configurations. |- style="border: 1px solid darkgray;" || David M. Rogers and Susan B. Rempe. [http://www.ncbi.nlm.nih.gov/pmc/articles/PMC3443978/ “Probing the Thermodynamics of Competitive Ion Binding Using Minimum Energy Structures.”] [http://dx.doi.org/10.1021/jp2012864 J. Phys. Chem. B, 115(29):9116-29, 2011]. We presented an extension of the Quasi-Chemical theory for quantifying the impact of local structure on ion complexation thermodynamics. The theory can be simply represented using a set of thermodynamic cycles involving binding site structural and compositional states as reaction intermediates. |- style="border: 1px solid darkgray;" || Susan B. Rempe and David M. Rogers; et. al. “Computational and experimental platform for understanding and optimizing water flux and salt rejection in nanoporous membranes.” [http://prod.sandia.gov/techlib/access-control.cgi/2010/106735.pdf Sandia Technical Report, SAND2010-6735, 2010.] We summarize work on designing polymer coatings for salt exclusion in water transporting nanopores. In this work, I collected available molecular dynamics results for these systems and performed a novel energy efficiency analysis able to relate atomistic and experimental scales as well as identify important design goals and chemical principles for material performance. |- style="border: 1px solid darkgray;" || David M. Rogers, [http://rave.ohiolink.edu/etdc/view?acc_num=ucin1251832030 ''''Using Bayes' Theorem for Free Energy Calculations''''], 2009. We investigated the central quantity of free energies in a Bayesian context and provide estimators for solvation free energies as well as optimal potential of mean force approximations to model polymer coarse-grained dynamics from atomistic simulations. |- style="border: 1px solid darkgray;" || Zhen Zhao, David M. Rogers and Thomas L. Beck. "Polarization and Charge Transfer in the Hydration of Chloride Ions." [http://link.aip.org/link/?JCP/132/014502/1 J. Chem. Phys., 132:014502, 2010.] Dr. Zhao's ab-initio analysis of the charge distribution in water-ion clusters highlighted the importance of many-body water-water interactions and charge transfer effects in determining cluster structural and energetic properties. These are still challenging to represent in modern polarizable forcefields and have implications for anion properties at interfaces. |- style="border: 1px solid darkgray;" || David M. Rogers and Thomas L. Beck. "Quasi-Chemical and Structural Analysis of Polarizable Anion Hydration." [http://link.aip.org/link/?JCP/132/014505/1 J. Chem. Phys., 132:014505, 2010.] The role of polarizability in forcefield-based models of ions and water was examined. Utilizing some of our recent developments on quasi-chemical theory, we have been able to quantify the tightened, asymmetric nature of the ion's local solvation waters induced by increased polarizability as well as the exact effects of polarization on the solvation free energy. The results suggest some potential problems and diagnostics for such models. |- style="border: 1px solid darkgray;" || David M. Rogers and Thomas L. Beck. [http://forcesolve.sourceforge.net/ Force Solve] (Sourceforge, Chicago IL, 2008). This force matching software implements and tests coarse-graining for general molecular systems in a mere 4000 lines of code. It is able to parametrize coarse Hamiltonians from atomic trajectory data given arbitrary definitions of coarse united-atom type models as well as carry out short Langevin Dynamics simulations on the coarse scale. The program's main drawbacks are its slow speed and high memory usage due to its simplistic design, attributable to the interpreted nature of python. |- style="border: 1px solid darkgray;" || David M. Rogers and Thomas L. Beck. "Resolution and Scale Independent Nonparametric Function Matching Using a String Energy Penalized Spline Prior." 2008. [http://arxiv.org/abs/1003.4741 arXiv:1003.4741v1] (stat.ML). Fresh insight is provided into long-standing mathematical issues surrounding computational modeling of continuous functions from a few sampled data points. The present research lays the groundwork for predicting the behavior of complicated many-body systems using advanced regression techniques. |- style="border: 1px solid darkgray;" || David M. Rogers and Thomas L. Beck. "Modeling molecular and ionic absolute solvation free energies with quasichemical theory bounds." [https://doi.org/10.1063/1.2985613 J. Chem. Phys., 129:134505, 2008.] We develop a Bayesian method for computing (with error bars) the free energy for forming a nano-bubble in an arbitrary solvent system. This forms the first step of a thermodynamic cycle for dissolving a real solute. We prove that upper and lower bounds for that solvation free energy can be obtained from two simulations (with and without the solute present). The method is excellent for dissolving gas in water, while the upper/lower bounds are larger for dissolving water or ions. |} == Manuscripts in Preparation/Submitted == * [https://arxiv.org/abs/1712.09427 Fluctuation Theory of Ionic Solvation Potentials] * [https://arxiv.org/abs/1503.01232 Thermodynamics of Maximum Transition Entropy for Quantum Assemblies] * [https://arxiv.org/abs/1701.01466 Maximum Entropy Closure for Flows in Transiently Driven Nonequilibrium Systems] 8c320537ec41d6aa1739385504ea7f72e6ede131 725 715 2019-03-18T22:28:48Z David M. Rogers 2 wikitext text/x-wiki {| cellpadding="4" style="border: 1px solid darkgray;" |- style="border: 1px solid darkgray;" || David M. Rogers, "Range separation: The divide between local structures and field theories." [https://arxiv.org/abs/1902.03289 in press, 2019]. This work presents parallel histories of the development of two modern theories of condensed matter: the theory of electron structure in quantum mechanics, and the theory of liquid structure in statistical mechanics. Key developments provide some guidance on important directions for future advancements in theory and practice. |- style="border: 1px solid darkgray;" || David M. Rogers, "Dual Characterization of the Ornstein-Zernike Equation in Moment Space." [https://arxiv.org/abs/1807.05963 submitted, 2019]. I re-write Ornstein-Zernike theory in a convenient matrix basis so that future computational implementations can be made robust and that numerical and fitting error can be tightly controlled. It is hoped that the framework can be used in the near future to compute molecular solvation free energies and to realize its enormous potential economic and environmental benefits for formulating industrial fluids and consumer products. |- style="border: 1px solid darkgray;" || Phillip S. Hudson, Stefan Boresch, David M. Rogers, and H. Lee Woodcock., "Accelerating QM/MM Free Energy Computations via Intramolecular Force Matching" [https://dx.doi.org/10.1021/acs.jctc.8b00517 J. Chem. Theory Comput., 14 (12):6327–35, 2018]. My co-authors apply [https://github.com/frobnitzem/chemparam my algorithm and software implementation of Bayesian generalized linear model regression with linear inequality constraints] to estimate molecular modeling parameters from quantum their mechanical calculations. They find the method gives robust results that greatly increase efficiency of additional simulations. |- style="border: 1px solid darkgray;" || David M. Rogers, "Extension of Kirkwood-Buff theory to the canonical ensemble." [https://aip.scitation.org/doi/full/10.1063/1.5011696 J. Chem. Phys., 148:054102, 2018]. We present a way to utilize Essmann et. al.'s smooth particle mesh Ewald algorithm ([https://github.com/frobnitzem/EwaldCorrel implemented here]) to get the low-angle direct correlation function from canonical ensemble simulation data. The result avoids well-documented issues with long wavelength (small-angle scattering) modes that appear when using real-space methods. This result is combined with new estimates of finite-size effects and grand-canonical ensemble corrections to provide definitive results on the problem of extrapolating Kirkwood-Buff integrals. |- style="border: 1px solid darkgray;" || Juan M. Vanegas, Frank Heinrich, David M.Rogers, Bryan D. Carson, Sadie La Bauve, Briana C. Vernon, Bulent Akgun, Sushil Satija, Aihua Zheng, Margaret Kielian, Susan B. Rempe, and Michael S. Kent, "Insertion of Dengue E into lipid bilayers studied by neutron reflectivity and molecular dynamics simulations." [https://authors.elsevier.com/c/1WcOv1ClS9Jvp BBA 1860(5):1216-1230, 2018]. We compare neutron reflectivity experiments to molecular dynamics calculations on the orientation and binding position of the Dengue envelope protein responsible for viral escape from the host cell's endosome. In addition to the hydrophobic fusion tip, we find important roles for three positively-charged residues in the viral protein that contribute to host membrane binding. These could potentially be targeted by new anti-viral medicines. |- style="border: 1px solid darkgray;" || David M. Rogers, "An information theory model for dissipation in open quantum systems." [http://iopscience.iop.org/article/10.1088/1742-6596/880/1/012039 J. Phys., Conference Series 880(1):012039, 2017]. This paper presents a new, simple ansatz for adding dissipation to arbitrary stochastic forcing of a quantum dynamical system. For Gaussian random forces, it predicts a Lindblad equation identical to the Caldeira-Leggett model up to order <math>\beta^2</math>, where the same term is present with a different prefactor. The system-centric, phase space picture here shows that the <math>\beta^2</math> term represents a quantum confinement effect. |- style="border: 1px solid darkgray;" || David M. Rogers, "Einstein-Podolsky-Rosen paradox implies a minimum achievable temperature." [http://journals.aps.org/pre/abstract/10.1103/PhysRevE.95.012149 Phys. Rev. E 95, 012149, 2017.] This paper provides measurement-based definitions of heat and work that can be realized in current laboratory setups. The first and second laws are proved despite the fact that temperature is treated completely as as a property of the interacting reservoir. Measurements of the work are subject to the famous EPR paradox because the work exchanged between two quantum systems is not defined until a measurement is performed. Based on this, we show that even an environment at absolute zero cannot lower a system's temperature below a minimum characteristic of the way the environment is coupled to the system. |- style="border: 1px solid darkgray;" || Guy W. Dayhoff II and David M. Rogers, "Driving forces in MD simulations of transition and ‘Free’ flows." [http://dx.doi.org/10.1080/08927022.2016.1273524 Mol. Sim. 43(5-6), pp. 467-477, 2017.] (special issue on Surface Chemistry) We set out to test the Joule-Thomson analysis of thermodynamics of porous flow for gasses through a nanopore and found that while local equilibrium is established in the steady-state, finite-size effects cause heat flow opposite the flow direction that violates the assumption of an adiabatic porous plug. |- style="border: 1px solid darkgray;" || David M. Rogers, "Efficient Primitives for Standard Tensor Linear Algebra." [https://doi.org/10.1145/2949550.2949580 Proc. XSEDE16 Conference on Diversity, Big Data, and Science at Scale, no. 14, 2016.] This paper introduces 3 basic functions that generalize BLAS to tensors and presents a code generation strategy for their [https://github.com/frobnitzem/slack efficient execution on GPUs] that achieves peak performance on the same order of magnitude as for traditional, vendor-optimized matrix-multiplications. |- style="border: 1px solid darkgray;" || David M. Rogers, "Overcoming the Minimum Image Constraint Using the Closest Point Search." [http://dx.doi.org/10.1016/j.jmgm.2016.07.004 J. Mol. Graph. Model 68, pp. 197–205, 2016.] An elegant solution to the problem of finding periodic images in non-rectangular lattices is provided based on the closest vector problem. Related code is here: [https://github.com/frobnitzem/pbctools] |- style="border: 1px solid darkgray;" || Elisa La Bauve, Briana C. Vernon, Dongmei Ye, David M. Rogers, Cathryn M. Siegrist, Bryan Carson. Susan L. Rempe, Aihua Zheng, Margaret C. Kielian, Andrew P. Shreve, and Michael S. Kent. "Method for measuring the unbinding energy of strongly-bound membrane-associated proteins." [http://dx.doi.org/10.1016/j.bbamem.2016.07.004 BBA Biomembranes 1858(11): 2753–62, 2016.] This paper gives multiple experimental measurements of binding energy between the Dengue virus envelope protein and host membranes that largely confirm our computational predictions from 2015. I contributed all the theory for terminal velocity during sedimentation, along with a novel kinetic analysis providing the free energy and enthalpy of the dissociation barrier (all the details are at the end of the appendix). |- style="border: 1px solid darkgray;" || David M. Rogers. "Thermodynamics of Maximum Transition Entropy for Quantum Assemblies." [http://arxiv.org/abs/1503.01232 arXiv:1503.01232 submitted, 2016]. The work presents a new, general, theoretical foundation for the dynamics of open quantum systems modeled on the maximum entropy derivation of equilibrium statistical mechanics. Computational results are presented for three detailed systems to validate and reinforce the theory. It represents a significant advancement for the field, as it lucidly connects the dynamics of a single wavefunction plus environmental noise to the Caldeira-Leggett model for density matrices. |- style="border: 1px solid darkgray;" || Andriy Anishkin, Juan M. Vanegas, David M. Rogers, Philip L. Lorenzi, Wai Kin Chan, Preeti Purwaha, John N. Weinstein, Sergei Sukharev, and Susan B. Rempe. "Catalytic Role of the Substrate Defines Specificity of Therapeutic L-Asparaginase." [http://dx.doi.org/10.1016/j.jmb.2015.06.017 J. Mol. Biol. 427:2867-2885, 2015]. We present an explanation for the (until now controversial) catalytic mechanism of type 2 bacterial L-asparaginase enzymes. By using the carboxylic acid of the substrate (asparagine) as the proton acceptor, this enzyme is able to preferentially carry out deamidation on asparagine more quickly than for the competing substrate, glutamine. The hypothesis, re-discovered from our MD simulations, was first put forward years ago in contested experimental studies, and now finds additional support from our MD and QM calculations. |- style="border: 1px solid darkgray;" || David M. Rogers. "Towards a Direct, By-Need Evaluator for Dependently Typed Languages." [http://arxiv.org/abs/1509.07036 arXiv:1509.07036 submitted, 2015]. This paper describes the implementation of a new interpreted language for distributed parallel computing. It achieves its goal by maintaining pure functional semantics, allowing all terms in the language to be partially evaluated and serialized to network storage at any point during computation. |- style="border: 1px solid darkgray;" || Marielle Soniat, David M. Rogers, and Susan Rempe. "Dispersion- and Exchange-Corrected Density Functional Theory for Sodium Ion Hydration." [http://pubs.acs.org/doi/abs/10.1021/acs.jctc.5b00357 J. Chem. Theory. Comput. 142:074101, 2015]. We studied the influence of dispersion energy corrections on the free energy of formation for sodium-water clusters computed with DFT and wound up discovering that dispersion and split-range exchange functionals can somewhat counter-balance each other. The charged sodium ion pulls on the water's electrons, clearly showing which density functionals over-polarize compared to CCSD. Split-range exchange can reduce this over-polarization, but results in reduced electrostatic interaction. Dispersion can lower the binding energy again to counter-balance. So, functionals fit to experimental formation energies need both effects to avoid lowering energies by over-polarizing. |- style="border: 1px solid darkgray;" || David M. Rogers. "Real-space quadrature: a convenient, efficient representation for multipole expansions." [http://dx.doi.org/10.1063/1.4907404 J. Chem. Phys. 142:074101, 2015]. ([http://predictivestatmech.org/papers/real-poles.pdf Presentation]) I introduce sets of point charges that are able to simultaneously reproduce all multipole (spherical harmonic) expansions up to arbitrary order. The number of points is space-optimal. Translations are described from the usual harmonics and from Cartesian moments (dipole, quadrupole, etc.) on supersymmetric tensors to directional moments using the point weight distribution. Many applications are possible, including trivial implementation of multipoles in molecular mechanics and representing probability distributions over rotation space. |- style="border: 1px solid darkgray;" || David M. Rogers, Michael S. Kent, and Susan B. Rempe, "Molecular basis of endosomal-membrane association for the dengue virus envelope protein." [http://dx.doi.org/10.1016/j.bbamem.2014.12.018 BBA Biomembranes 1848(4):1041-52, 2015.] A fully atomistic potential of mean force for association of the viral envelope protein from Dengue virus was compared to a Poisson-Boltzmann electrostatic plus dispersion model. The results are consistent, showing hope for this type of combined scale simulation. |- style="border: 1px solid darkgray;" || Yaqin Fu, Binsong Li, Ying-Bing Jiang, Darren R. Dunphy, Andy Tsai, Siu-Yue Tam, Hongyou Fan, Hongxia Zhan, David Rogers, Susan Rempe, Plamen Atanassov, Joseph L. Cecchi, and C. Jeffrey Brinker "Atomic Layer Deposition of L-Alanine Polypeptide." [http://pubs.acs.org/doi/abs/10.1021/ja5043403 JACS 136(45):15821–4, 2014.] This paper with our experimental collaborators carried out blocked peptide synthesis by vapor-depositing Boc-L-alanine to create a uniform thin film of polypeptides grown on a silica substrate activated by aminopropyltrimethoxysilane. |- style="border: 1px solid darkgray;" || David M. Rogers. "Silmaril, A Functional Language for Distributed Parallel Evaluation." [http://predictivestatmech.org/sil/papers/sil.pdf Submitted version] |- style="border: 1px solid darkgray;" || Mathias B. Andersen, David M. Rogers, Junyu Mai, Benjamin Schudel, Anson V. Hatch, Susan B. Rempe and Ali Mani. "Spatiotemporal pH dynamics in concentration polarization near ion-selective membranes." [http://dx.doi.org/10.1021/la5014297 Langmuir, 30(26):7902–7912, 2014] |- style="border: 1px solid darkgray;" || W. K. Chan, P. L. Lorenzi, A. Anishkin, P. Purwaha, D. M. Rogers, S. Sukharev, S.B. Rempe, and J. N. Weinstein. "The glutaminase activity of l-asparaginase is not required for anticancer activity against ASNS-negative cells." [http://dx.doi.org/10.1182/blood-2013-10-535112 Blood. 123(23):3596-606, 2014]. |- style="border: 1px solid darkgray;" || David M. Rogers, Dian Jiao, Lawrence Pratt, and Susan B. Rempe. "Structural Models and Molecular Thermodynamics of Hydration of Ions and Small Molecules" [http://dx.doi.org/10.1016/B978-0-444-59440-2.00004-1 Annu. Rep. Comp. Chem. 8:71–127, 2012.] |- style="border: 1px solid darkgray;" || David M. Rogers and Susan B. Rempe. "Irreversible Thermodynamics." [http://dx.doi.org/10.1088/1742-6596/402/1/012014 J. Phys.: Conf. Ser. 402:012014, 2012]. |- style="border: 1px solid darkgray;" || David M. Rogers, Thomas L. Beck, and Susan B. Rempe. [[Media:Dmroge_InfoNonequ2011.pdf|"An Information Theory Approach to Nonlinear, Nonequilibrium Thermodynamics."]] [http://dx.doi.org/10.1007/s10955-011-0358-9 J. Stat. Phys. 145(2):385-409, 2011] We show how the interpretation of thermodynamic states as representing system information leads naturally to thermodynamic cycles and the first and second laws of thermodynamics as well as similar formulations for nontrivial nonequilibrium problems. The logical development of the theory also leads naturally to correct indistinguishability factors in the partition function. |- style="border: 1px solid darkgray;" || Sameer Varma, David M. Rogers, Lawrence R. Pratt, and Susan B. Rempe. "Perspectives on Ion Selectivity: Design Principles for K+ Selectivity in Membrane Transport." [http://jgp.rupress.org/content/137/6/479.full J. Gen. Physiol., 137(6):479-488, 2011.] We review the development of models for understanding the physical basis of selectivity for K+ ions over Na+, its sibling only one row behind, in membrane channels and transporters. Although the problem is subtle because of the morass of competing effects, we emphasize work analyzing the systematic influence of the environment on tipping local binding site structure toward selective configurations. |- style="border: 1px solid darkgray;" || David M. Rogers and Susan B. Rempe. [http://www.ncbi.nlm.nih.gov/pmc/articles/PMC3443978/ “Probing the Thermodynamics of Competitive Ion Binding Using Minimum Energy Structures.”] [http://dx.doi.org/10.1021/jp2012864 J. Phys. Chem. B, 115(29):9116-29, 2011]. We presented an extension of the Quasi-Chemical theory for quantifying the impact of local structure on ion complexation thermodynamics. The theory can be simply represented using a set of thermodynamic cycles involving binding site structural and compositional states as reaction intermediates. |- style="border: 1px solid darkgray;" || Susan B. Rempe and David M. Rogers; et. al. “Computational and experimental platform for understanding and optimizing water flux and salt rejection in nanoporous membranes.” [http://prod.sandia.gov/techlib/access-control.cgi/2010/106735.pdf Sandia Technical Report, SAND2010-6735, 2010.] We summarize work on designing polymer coatings for salt exclusion in water transporting nanopores. In this work, I collected available molecular dynamics results for these systems and performed a novel energy efficiency analysis able to relate atomistic and experimental scales as well as identify important design goals and chemical principles for material performance. |- style="border: 1px solid darkgray;" || David M. Rogers, [http://rave.ohiolink.edu/etdc/view?acc_num=ucin1251832030 ''''Using Bayes' Theorem for Free Energy Calculations''''], 2009. We investigated the central quantity of free energies in a Bayesian context and provide estimators for solvation free energies as well as optimal potential of mean force approximations to model polymer coarse-grained dynamics from atomistic simulations. |- style="border: 1px solid darkgray;" || Zhen Zhao, David M. Rogers and Thomas L. Beck. "Polarization and Charge Transfer in the Hydration of Chloride Ions." [http://link.aip.org/link/?JCP/132/014502/1 J. Chem. Phys., 132:014502, 2010.] Dr. Zhao's ab-initio analysis of the charge distribution in water-ion clusters highlighted the importance of many-body water-water interactions and charge transfer effects in determining cluster structural and energetic properties. These are still challenging to represent in modern polarizable forcefields and have implications for anion properties at interfaces. |- style="border: 1px solid darkgray;" || David M. Rogers and Thomas L. Beck. "Quasi-Chemical and Structural Analysis of Polarizable Anion Hydration." [http://link.aip.org/link/?JCP/132/014505/1 J. Chem. Phys., 132:014505, 2010.] The role of polarizability in forcefield-based models of ions and water was examined. Utilizing some of our recent developments on quasi-chemical theory, we have been able to quantify the tightened, asymmetric nature of the ion's local solvation waters induced by increased polarizability as well as the exact effects of polarization on the solvation free energy. The results suggest some potential problems and diagnostics for such models. |- style="border: 1px solid darkgray;" || David M. Rogers and Thomas L. Beck. [http://forcesolve.sourceforge.net/ Force Solve] (Sourceforge, Chicago IL, 2008). This force matching software implements and tests coarse-graining for general molecular systems in a mere 4000 lines of code. It is able to parametrize coarse Hamiltonians from atomic trajectory data given arbitrary definitions of coarse united-atom type models as well as carry out short Langevin Dynamics simulations on the coarse scale. The program's main drawbacks are its slow speed and high memory usage due to its simplistic design, attributable to the interpreted nature of python. |- style="border: 1px solid darkgray;" || David M. Rogers and Thomas L. Beck. "Resolution and Scale Independent Nonparametric Function Matching Using a String Energy Penalized Spline Prior." 2008. [http://arxiv.org/abs/1003.4741 arXiv:1003.4741v1] (stat.ML). Fresh insight is provided into long-standing mathematical issues surrounding computational modeling of continuous functions from a few sampled data points. The present research lays the groundwork for predicting the behavior of complicated many-body systems using advanced regression techniques. |- style="border: 1px solid darkgray;" || David M. Rogers and Thomas L. Beck. "Modeling molecular and ionic absolute solvation free energies with quasichemical theory bounds." [https://doi.org/10.1063/1.2985613 J. Chem. Phys., 129:134505, 2008.] We develop a Bayesian method for computing (with error bars) the free energy for forming a nano-bubble in an arbitrary solvent system. This forms the first step of a thermodynamic cycle for dissolving a real solute. We prove that upper and lower bounds for that solvation free energy can be obtained from two simulations (with and without the solute present). The method is excellent for dissolving gas in water, while the upper/lower bounds are larger for dissolving water or ions. |} == Manuscripts in Preparation/Submitted == * [https://arxiv.org/abs/1712.09427 Fluctuation Theory of Ionic Solvation Potentials] * [https://arxiv.org/abs/1503.01232 Thermodynamics of Maximum Transition Entropy for Quantum Assemblies] * [https://arxiv.org/abs/1701.01466 Maximum Entropy Closure for Flows in Transiently Driven Nonequilibrium Systems] b1d4b1bcdfb8bc65810f1f9d39792fd34d5cdd87 749 725 2019-05-30T21:12:21Z David M. Rogers 2 wikitext text/x-wiki {| cellpadding="4" style="border: 1px solid darkgray;" |- style="border: 1px solid darkgray;" || Guy W. Dayhoff II and David M. Rogers, "Hydration and Dispersion Forces in Hydroxypropylcellulose Phase Behavior." [https://dx.doi.org/10.1021/acs.jpcb.9b01049 J. Phys. Chem B in press, 2019]. We extend four forcefields to model hydroxypropylcellulose and find that none of them can reproduce experimentally measured hydration forces from 2001. Long-range solvent-mediated forces remain challenging targets for predictive simulation because of a breakdown in science funding priorities. |- style="border: 1px solid darkgray;" || David M. Rogers, "Range separation: The divide between local structures and field theories." [https://dx.doi.org/10.13128/Substantia-208 Substantia 3(1), 2019]. This work presents parallel histories of the development of two modern theories of condensed matter: the theory of electron structure in quantum mechanics, and the theory of liquid structure in statistical mechanics. Key developments provide some guidance on important directions for future advancements in theory and practice. |- style="border: 1px solid darkgray;" || David M. Rogers, "Dual Characterization of the Ornstein-Zernike Equation in Moment Space." [https://arxiv.org/abs/1807.05963 submitted, 2019]. I re-write Ornstein-Zernike theory in a convenient matrix basis so that future computational implementations can be made robust and that numerical and fitting error can be tightly controlled. It is hoped that the framework can be used in the near future to compute molecular solvation free energies and to realize its enormous potential economic and environmental benefits for formulating industrial fluids and consumer products. |- style="border: 1px solid darkgray;" || Phillip S. Hudson, Stefan Boresch, David M. Rogers, and H. Lee Woodcock., "Accelerating QM/MM Free Energy Computations via Intramolecular Force Matching" [https://dx.doi.org/10.1021/acs.jctc.8b00517 J. Chem. Theory Comput., 14 (12):6327–35, 2018]. My co-authors apply [https://github.com/frobnitzem/chemparam my algorithm and software implementation of Bayesian generalized linear model regression with linear inequality constraints] to estimate molecular modeling parameters from quantum their mechanical calculations. They find the method gives robust results that greatly increase efficiency of additional simulations. |- style="border: 1px solid darkgray;" || David M. Rogers, "Extension of Kirkwood-Buff theory to the canonical ensemble." [https://aip.scitation.org/doi/full/10.1063/1.5011696 J. Chem. Phys., 148:054102, 2018]. We present a way to utilize Essmann et. al.'s smooth particle mesh Ewald algorithm ([https://github.com/frobnitzem/EwaldCorrel implemented here]) to get the low-angle direct correlation function from canonical ensemble simulation data. The result avoids well-documented issues with long wavelength (small-angle scattering) modes that appear when using real-space methods. This result is combined with new estimates of finite-size effects and grand-canonical ensemble corrections to provide definitive results on the problem of extrapolating Kirkwood-Buff integrals. |- style="border: 1px solid darkgray;" || Juan M. Vanegas, Frank Heinrich, David M.Rogers, Bryan D. Carson, Sadie La Bauve, Briana C. Vernon, Bulent Akgun, Sushil Satija, Aihua Zheng, Margaret Kielian, Susan B. Rempe, and Michael S. Kent, "Insertion of Dengue E into lipid bilayers studied by neutron reflectivity and molecular dynamics simulations." [https://authors.elsevier.com/c/1WcOv1ClS9Jvp BBA 1860(5):1216-1230, 2018]. We compare neutron reflectivity experiments to molecular dynamics calculations on the orientation and binding position of the Dengue envelope protein responsible for viral escape from the host cell's endosome. In addition to the hydrophobic fusion tip, we find important roles for three positively-charged residues in the viral protein that contribute to host membrane binding. These could potentially be targeted by new anti-viral medicines. |- style="border: 1px solid darkgray;" || David M. Rogers, "An information theory model for dissipation in open quantum systems." [http://iopscience.iop.org/article/10.1088/1742-6596/880/1/012039 J. Phys., Conference Series 880(1):012039, 2017]. This paper presents a new, simple ansatz for adding dissipation to arbitrary stochastic forcing of a quantum dynamical system. For Gaussian random forces, it predicts a Lindblad equation identical to the Caldeira-Leggett model up to order <math>\beta^2</math>, where the same term is present with a different prefactor. The system-centric, phase space picture here shows that the <math>\beta^2</math> term represents a quantum confinement effect. |- style="border: 1px solid darkgray;" || David M. Rogers, "Einstein-Podolsky-Rosen paradox implies a minimum achievable temperature." [http://journals.aps.org/pre/abstract/10.1103/PhysRevE.95.012149 Phys. Rev. E 95, 012149, 2017.] This paper provides measurement-based definitions of heat and work that can be realized in current laboratory setups. The first and second laws are proved despite the fact that temperature is treated completely as as a property of the interacting reservoir. Measurements of the work are subject to the famous EPR paradox because the work exchanged between two quantum systems is not defined until a measurement is performed. Based on this, we show that even an environment at absolute zero cannot lower a system's temperature below a minimum characteristic of the way the environment is coupled to the system. |- style="border: 1px solid darkgray;" || Guy W. Dayhoff II and David M. Rogers, "Driving forces in MD simulations of transition and ‘Free’ flows." [http://dx.doi.org/10.1080/08927022.2016.1273524 Mol. Sim. 43(5-6), pp. 467-477, 2017.] (special issue on Surface Chemistry) We set out to test the Joule-Thomson analysis of thermodynamics of porous flow for gasses through a nanopore and found that while local equilibrium is established in the steady-state, finite-size effects cause heat flow opposite the flow direction that violates the assumption of an adiabatic porous plug. |- style="border: 1px solid darkgray;" || David M. Rogers, "Efficient Primitives for Standard Tensor Linear Algebra." [https://doi.org/10.1145/2949550.2949580 Proc. XSEDE16 Conference on Diversity, Big Data, and Science at Scale, no. 14, 2016.] This paper introduces 3 basic functions that generalize BLAS to tensors and presents a code generation strategy for their [https://github.com/frobnitzem/slack efficient execution on GPUs] that achieves peak performance on the same order of magnitude as for traditional, vendor-optimized matrix-multiplications. |- style="border: 1px solid darkgray;" || David M. Rogers, "Overcoming the Minimum Image Constraint Using the Closest Point Search." [http://dx.doi.org/10.1016/j.jmgm.2016.07.004 J. Mol. Graph. Model 68, pp. 197–205, 2016.] An elegant solution to the problem of finding periodic images in non-rectangular lattices is provided based on the closest vector problem. Related code is here: [https://github.com/frobnitzem/pbctools] |- style="border: 1px solid darkgray;" || Elisa La Bauve, Briana C. Vernon, Dongmei Ye, David M. Rogers, Cathryn M. Siegrist, Bryan Carson. Susan L. Rempe, Aihua Zheng, Margaret C. Kielian, Andrew P. Shreve, and Michael S. Kent. "Method for measuring the unbinding energy of strongly-bound membrane-associated proteins." [http://dx.doi.org/10.1016/j.bbamem.2016.07.004 BBA Biomembranes 1858(11): 2753–62, 2016.] This paper gives multiple experimental measurements of binding energy between the Dengue virus envelope protein and host membranes that largely confirm our computational predictions from 2015. I contributed all the theory for terminal velocity during sedimentation, along with a novel kinetic analysis providing the free energy and enthalpy of the dissociation barrier (all the details are at the end of the appendix). |- style="border: 1px solid darkgray;" || David M. Rogers. "Thermodynamics of Maximum Transition Entropy for Quantum Assemblies." [http://arxiv.org/abs/1503.01232 arXiv:1503.01232 submitted, 2016]. The work presents a new, general, theoretical foundation for the dynamics of open quantum systems modeled on the maximum entropy derivation of equilibrium statistical mechanics. Computational results are presented for three detailed systems to validate and reinforce the theory. It represents a significant advancement for the field, as it lucidly connects the dynamics of a single wavefunction plus environmental noise to the Caldeira-Leggett model for density matrices. |- style="border: 1px solid darkgray;" || Andriy Anishkin, Juan M. Vanegas, David M. Rogers, Philip L. Lorenzi, Wai Kin Chan, Preeti Purwaha, John N. Weinstein, Sergei Sukharev, and Susan B. Rempe. "Catalytic Role of the Substrate Defines Specificity of Therapeutic L-Asparaginase." [http://dx.doi.org/10.1016/j.jmb.2015.06.017 J. Mol. Biol. 427:2867-2885, 2015]. We present an explanation for the (until now controversial) catalytic mechanism of type 2 bacterial L-asparaginase enzymes. By using the carboxylic acid of the substrate (asparagine) as the proton acceptor, this enzyme is able to preferentially carry out deamidation on asparagine more quickly than for the competing substrate, glutamine. The hypothesis, re-discovered from our MD simulations, was first put forward years ago in contested experimental studies, and now finds additional support from our MD and QM calculations. |- style="border: 1px solid darkgray;" || David M. Rogers. "Towards a Direct, By-Need Evaluator for Dependently Typed Languages." [http://arxiv.org/abs/1509.07036 arXiv:1509.07036 submitted, 2015]. This paper describes the implementation of a new interpreted language for distributed parallel computing. It achieves its goal by maintaining pure functional semantics, allowing all terms in the language to be partially evaluated and serialized to network storage at any point during computation. |- style="border: 1px solid darkgray;" || Marielle Soniat, David M. Rogers, and Susan Rempe. "Dispersion- and Exchange-Corrected Density Functional Theory for Sodium Ion Hydration." [http://pubs.acs.org/doi/abs/10.1021/acs.jctc.5b00357 J. Chem. Theory. Comput. 142:074101, 2015]. We studied the influence of dispersion energy corrections on the free energy of formation for sodium-water clusters computed with DFT and wound up discovering that dispersion and split-range exchange functionals can somewhat counter-balance each other. The charged sodium ion pulls on the water's electrons, clearly showing which density functionals over-polarize compared to CCSD. Split-range exchange can reduce this over-polarization, but results in reduced electrostatic interaction. Dispersion can lower the binding energy again to counter-balance. So, functionals fit to experimental formation energies need both effects to avoid lowering energies by over-polarizing. |- style="border: 1px solid darkgray;" || David M. Rogers. "Real-space quadrature: a convenient, efficient representation for multipole expansions." [http://dx.doi.org/10.1063/1.4907404 J. Chem. Phys. 142:074101, 2015]. ([http://predictivestatmech.org/papers/real-poles.pdf Presentation]) I introduce sets of point charges that are able to simultaneously reproduce all multipole (spherical harmonic) expansions up to arbitrary order. The number of points is space-optimal. Translations are described from the usual harmonics and from Cartesian moments (dipole, quadrupole, etc.) on supersymmetric tensors to directional moments using the point weight distribution. Many applications are possible, including trivial implementation of multipoles in molecular mechanics and representing probability distributions over rotation space. |- style="border: 1px solid darkgray;" || David M. Rogers, Michael S. Kent, and Susan B. Rempe, "Molecular basis of endosomal-membrane association for the dengue virus envelope protein." [http://dx.doi.org/10.1016/j.bbamem.2014.12.018 BBA Biomembranes 1848(4):1041-52, 2015.] A fully atomistic potential of mean force for association of the viral envelope protein from Dengue virus was compared to a Poisson-Boltzmann electrostatic plus dispersion model. The results are consistent, showing hope for this type of combined scale simulation. |- style="border: 1px solid darkgray;" || Yaqin Fu, Binsong Li, Ying-Bing Jiang, Darren R. Dunphy, Andy Tsai, Siu-Yue Tam, Hongyou Fan, Hongxia Zhan, David Rogers, Susan Rempe, Plamen Atanassov, Joseph L. Cecchi, and C. Jeffrey Brinker "Atomic Layer Deposition of L-Alanine Polypeptide." [http://pubs.acs.org/doi/abs/10.1021/ja5043403 JACS 136(45):15821–4, 2014.] This paper with our experimental collaborators carried out blocked peptide synthesis by vapor-depositing Boc-L-alanine to create a uniform thin film of polypeptides grown on a silica substrate activated by aminopropyltrimethoxysilane. |- style="border: 1px solid darkgray;" || David M. Rogers. "Silmaril, A Functional Language for Distributed Parallel Evaluation." [http://predictivestatmech.org/sil/papers/sil.pdf Submitted version] |- style="border: 1px solid darkgray;" || Mathias B. Andersen, David M. Rogers, Junyu Mai, Benjamin Schudel, Anson V. Hatch, Susan B. Rempe and Ali Mani. "Spatiotemporal pH dynamics in concentration polarization near ion-selective membranes." [http://dx.doi.org/10.1021/la5014297 Langmuir, 30(26):7902–7912, 2014] |- style="border: 1px solid darkgray;" || W. K. Chan, P. L. Lorenzi, A. Anishkin, P. Purwaha, D. M. Rogers, S. Sukharev, S.B. Rempe, and J. N. Weinstein. "The glutaminase activity of l-asparaginase is not required for anticancer activity against ASNS-negative cells." [http://dx.doi.org/10.1182/blood-2013-10-535112 Blood. 123(23):3596-606, 2014]. |- style="border: 1px solid darkgray;" || David M. Rogers, Dian Jiao, Lawrence Pratt, and Susan B. Rempe. "Structural Models and Molecular Thermodynamics of Hydration of Ions and Small Molecules" [http://dx.doi.org/10.1016/B978-0-444-59440-2.00004-1 Annu. Rep. Comp. Chem. 8:71–127, 2012.] |- style="border: 1px solid darkgray;" || David M. Rogers and Susan B. Rempe. "Irreversible Thermodynamics." [http://dx.doi.org/10.1088/1742-6596/402/1/012014 J. Phys.: Conf. Ser. 402:012014, 2012]. |- style="border: 1px solid darkgray;" || David M. Rogers, Thomas L. Beck, and Susan B. Rempe. [[Media:Dmroge_InfoNonequ2011.pdf|"An Information Theory Approach to Nonlinear, Nonequilibrium Thermodynamics."]] [http://dx.doi.org/10.1007/s10955-011-0358-9 J. Stat. Phys. 145(2):385-409, 2011] We show how the interpretation of thermodynamic states as representing system information leads naturally to thermodynamic cycles and the first and second laws of thermodynamics as well as similar formulations for nontrivial nonequilibrium problems. The logical development of the theory also leads naturally to correct indistinguishability factors in the partition function. |- style="border: 1px solid darkgray;" || Sameer Varma, David M. Rogers, Lawrence R. Pratt, and Susan B. Rempe. "Perspectives on Ion Selectivity: Design Principles for K+ Selectivity in Membrane Transport." [http://jgp.rupress.org/content/137/6/479.full J. Gen. Physiol., 137(6):479-488, 2011.] We review the development of models for understanding the physical basis of selectivity for K+ ions over Na+, its sibling only one row behind, in membrane channels and transporters. Although the problem is subtle because of the morass of competing effects, we emphasize work analyzing the systematic influence of the environment on tipping local binding site structure toward selective configurations. |- style="border: 1px solid darkgray;" || David M. Rogers and Susan B. Rempe. [http://www.ncbi.nlm.nih.gov/pmc/articles/PMC3443978/ “Probing the Thermodynamics of Competitive Ion Binding Using Minimum Energy Structures.”] [http://dx.doi.org/10.1021/jp2012864 J. Phys. Chem. B, 115(29):9116-29, 2011]. We presented an extension of the Quasi-Chemical theory for quantifying the impact of local structure on ion complexation thermodynamics. The theory can be simply represented using a set of thermodynamic cycles involving binding site structural and compositional states as reaction intermediates. |- style="border: 1px solid darkgray;" || Susan B. Rempe and David M. Rogers; et. al. “Computational and experimental platform for understanding and optimizing water flux and salt rejection in nanoporous membranes.” [http://prod.sandia.gov/techlib/access-control.cgi/2010/106735.pdf Sandia Technical Report, SAND2010-6735, 2010.] We summarize work on designing polymer coatings for salt exclusion in water transporting nanopores. In this work, I collected available molecular dynamics results for these systems and performed a novel energy efficiency analysis able to relate atomistic and experimental scales as well as identify important design goals and chemical principles for material performance. |- style="border: 1px solid darkgray;" || David M. Rogers, [http://rave.ohiolink.edu/etdc/view?acc_num=ucin1251832030 ''''Using Bayes' Theorem for Free Energy Calculations''''], 2009. We investigated the central quantity of free energies in a Bayesian context and provide estimators for solvation free energies as well as optimal potential of mean force approximations to model polymer coarse-grained dynamics from atomistic simulations. |- style="border: 1px solid darkgray;" || Zhen Zhao, David M. Rogers and Thomas L. Beck. "Polarization and Charge Transfer in the Hydration of Chloride Ions." [http://link.aip.org/link/?JCP/132/014502/1 J. Chem. Phys., 132:014502, 2010.] Dr. Zhao's ab-initio analysis of the charge distribution in water-ion clusters highlighted the importance of many-body water-water interactions and charge transfer effects in determining cluster structural and energetic properties. These are still challenging to represent in modern polarizable forcefields and have implications for anion properties at interfaces. |- style="border: 1px solid darkgray;" || David M. Rogers and Thomas L. Beck. "Quasi-Chemical and Structural Analysis of Polarizable Anion Hydration." [http://link.aip.org/link/?JCP/132/014505/1 J. Chem. Phys., 132:014505, 2010.] The role of polarizability in forcefield-based models of ions and water was examined. Utilizing some of our recent developments on quasi-chemical theory, we have been able to quantify the tightened, asymmetric nature of the ion's local solvation waters induced by increased polarizability as well as the exact effects of polarization on the solvation free energy. The results suggest some potential problems and diagnostics for such models. |- style="border: 1px solid darkgray;" || David M. Rogers and Thomas L. Beck. [http://forcesolve.sourceforge.net/ Force Solve] (Sourceforge, Chicago IL, 2008). This force matching software implements and tests coarse-graining for general molecular systems in a mere 4000 lines of code. It is able to parametrize coarse Hamiltonians from atomic trajectory data given arbitrary definitions of coarse united-atom type models as well as carry out short Langevin Dynamics simulations on the coarse scale. The program's main drawbacks are its slow speed and high memory usage due to its simplistic design, attributable to the interpreted nature of python. |- style="border: 1px solid darkgray;" || David M. Rogers and Thomas L. Beck. "Resolution and Scale Independent Nonparametric Function Matching Using a String Energy Penalized Spline Prior." 2008. [http://arxiv.org/abs/1003.4741 arXiv:1003.4741v1] (stat.ML). Fresh insight is provided into long-standing mathematical issues surrounding computational modeling of continuous functions from a few sampled data points. The present research lays the groundwork for predicting the behavior of complicated many-body systems using advanced regression techniques. |- style="border: 1px solid darkgray;" || David M. Rogers and Thomas L. Beck. "Modeling molecular and ionic absolute solvation free energies with quasichemical theory bounds." [https://doi.org/10.1063/1.2985613 J. Chem. Phys., 129:134505, 2008.] We develop a Bayesian method for computing (with error bars) the free energy for forming a nano-bubble in an arbitrary solvent system. This forms the first step of a thermodynamic cycle for dissolving a real solute. We prove that upper and lower bounds for that solvation free energy can be obtained from two simulations (with and without the solute present). The method is excellent for dissolving gas in water, while the upper/lower bounds are larger for dissolving water or ions. |} == Manuscripts in Preparation/Submitted == * [https://arxiv.org/abs/1712.09427 Fluctuation Theory of Ionic Solvation Potentials] * [https://arxiv.org/abs/1503.01232 Thermodynamics of Maximum Transition Entropy for Quantum Assemblies] * [https://arxiv.org/abs/1701.01466 Maximum Entropy Closure for Flows in Transiently Driven Nonequilibrium Systems] af54493f4264c23a16dd7e8f68a30c00b5b3ab00 750 749 2019-08-19T12:52:05Z David M. Rogers 2 wikitext text/x-wiki {| cellpadding="4" style="border: 1px solid darkgray;" |- style="border: 1px solid darkgray;" || David M. Rogers, "Unifying theories for nonequilibrium statistical mechanics." [https://dx.doi.org/10.1088/1742-5468/ab3193 J. Stat. Mech. 084010, 2019]. One of my longest-running projects is finally published. Large deviation functions calculated from "experimental" simulations of two model systems illustrate the key ideas of maximum transition entropy - a refinement of Jaynes' maximum caliber that preserves causality. |- style="border: 1px solid darkgray;" || Guy W. Dayhoff II and David M. Rogers, "Hydration and Dispersion Forces in Hydroxypropylcellulose Phase Behavior." [https://dx.doi.org/10.1021/acs.jpcb.9b01049 J. Phys. Chem B in press, 2019]. We extend four forcefields to model hydroxypropylcellulose and find that none of them can reproduce experimentally measured hydration forces from 2001. Long-range solvent-mediated forces remain challenging targets for predictive simulation because of a breakdown in science funding priorities. |- style="border: 1px solid darkgray;" || David M. Rogers, "Range separation: The divide between local structures and field theories." [https://dx.doi.org/10.13128/Substantia-208 Substantia 3(1), 2019]. This work presents parallel histories of the development of two modern theories of condensed matter: the theory of electron structure in quantum mechanics, and the theory of liquid structure in statistical mechanics. Key developments provide some guidance on important directions for future advancements in theory and practice. |- style="border: 1px solid darkgray;" || David M. Rogers, "Dual Characterization of the Ornstein-Zernike Equation in Moment Space." [https://arxiv.org/abs/1807.05963 submitted, 2019]. I re-write Ornstein-Zernike theory in a convenient matrix basis so that future computational implementations can be made robust and that numerical and fitting error can be tightly controlled. It is hoped that the framework can be used in the near future to compute molecular solvation free energies and to realize its enormous potential economic and environmental benefits for formulating industrial fluids and consumer products. |- style="border: 1px solid darkgray;" || Phillip S. Hudson, Stefan Boresch, David M. Rogers, and H. Lee Woodcock., "Accelerating QM/MM Free Energy Computations via Intramolecular Force Matching" [https://dx.doi.org/10.1021/acs.jctc.8b00517 J. Chem. Theory Comput., 14 (12):6327–35, 2018]. My co-authors apply [https://github.com/frobnitzem/chemparam my algorithm and software implementation of Bayesian generalized linear model regression with linear inequality constraints] to estimate molecular modeling parameters from quantum their mechanical calculations. They find the method gives robust results that greatly increase efficiency of additional simulations. |- style="border: 1px solid darkgray;" || David M. Rogers, "Extension of Kirkwood-Buff theory to the canonical ensemble." [https://aip.scitation.org/doi/full/10.1063/1.5011696 J. Chem. Phys., 148:054102, 2018]. We present a way to utilize Essmann et. al.'s smooth particle mesh Ewald algorithm ([https://github.com/frobnitzem/EwaldCorrel implemented here]) to get the low-angle direct correlation function from canonical ensemble simulation data. The result avoids well-documented issues with long wavelength (small-angle scattering) modes that appear when using real-space methods. This result is combined with new estimates of finite-size effects and grand-canonical ensemble corrections to provide definitive results on the problem of extrapolating Kirkwood-Buff integrals. |- style="border: 1px solid darkgray;" || Juan M. Vanegas, Frank Heinrich, David M.Rogers, Bryan D. Carson, Sadie La Bauve, Briana C. Vernon, Bulent Akgun, Sushil Satija, Aihua Zheng, Margaret Kielian, Susan B. Rempe, and Michael S. Kent, "Insertion of Dengue E into lipid bilayers studied by neutron reflectivity and molecular dynamics simulations." [https://authors.elsevier.com/c/1WcOv1ClS9Jvp BBA 1860(5):1216-1230, 2018]. We compare neutron reflectivity experiments to molecular dynamics calculations on the orientation and binding position of the Dengue envelope protein responsible for viral escape from the host cell's endosome. In addition to the hydrophobic fusion tip, we find important roles for three positively-charged residues in the viral protein that contribute to host membrane binding. These could potentially be targeted by new anti-viral medicines. |- style="border: 1px solid darkgray;" || David M. Rogers, "An information theory model for dissipation in open quantum systems." [http://iopscience.iop.org/article/10.1088/1742-6596/880/1/012039 J. Phys., Conference Series 880(1):012039, 2017]. This paper presents a new, simple ansatz for adding dissipation to arbitrary stochastic forcing of a quantum dynamical system. For Gaussian random forces, it predicts a Lindblad equation identical to the Caldeira-Leggett model up to order <math>\beta^2</math>, where the same term is present with a different prefactor. The system-centric, phase space picture here shows that the <math>\beta^2</math> term represents a quantum confinement effect. |- style="border: 1px solid darkgray;" || David M. Rogers, "Einstein-Podolsky-Rosen paradox implies a minimum achievable temperature." [http://journals.aps.org/pre/abstract/10.1103/PhysRevE.95.012149 Phys. Rev. E 95, 012149, 2017.] This paper provides measurement-based definitions of heat and work that can be realized in current laboratory setups. The first and second laws are proved despite the fact that temperature is treated completely as as a property of the interacting reservoir. Measurements of the work are subject to the famous EPR paradox because the work exchanged between two quantum systems is not defined until a measurement is performed. Based on this, we show that even an environment at absolute zero cannot lower a system's temperature below a minimum characteristic of the way the environment is coupled to the system. |- style="border: 1px solid darkgray;" || Guy W. Dayhoff II and David M. Rogers, "Driving forces in MD simulations of transition and ‘Free’ flows." [http://dx.doi.org/10.1080/08927022.2016.1273524 Mol. Sim. 43(5-6), pp. 467-477, 2017.] (special issue on Surface Chemistry) We set out to test the Joule-Thomson analysis of thermodynamics of porous flow for gasses through a nanopore and found that while local equilibrium is established in the steady-state, finite-size effects cause heat flow opposite the flow direction that violates the assumption of an adiabatic porous plug. |- style="border: 1px solid darkgray;" || David M. Rogers, "Efficient Primitives for Standard Tensor Linear Algebra." [https://doi.org/10.1145/2949550.2949580 Proc. XSEDE16 Conference on Diversity, Big Data, and Science at Scale, no. 14, 2016.] This paper introduces 3 basic functions that generalize BLAS to tensors and presents a code generation strategy for their [https://github.com/frobnitzem/slack efficient execution on GPUs] that achieves peak performance on the same order of magnitude as for traditional, vendor-optimized matrix-multiplications. |- style="border: 1px solid darkgray;" || David M. Rogers, "Overcoming the Minimum Image Constraint Using the Closest Point Search." [http://dx.doi.org/10.1016/j.jmgm.2016.07.004 J. Mol. Graph. Model 68, pp. 197–205, 2016.] An elegant solution to the problem of finding periodic images in non-rectangular lattices is provided based on the closest vector problem. Related code is here: [https://github.com/frobnitzem/pbctools] |- style="border: 1px solid darkgray;" || Elisa La Bauve, Briana C. Vernon, Dongmei Ye, David M. Rogers, Cathryn M. Siegrist, Bryan Carson. Susan L. Rempe, Aihua Zheng, Margaret C. Kielian, Andrew P. Shreve, and Michael S. Kent. "Method for measuring the unbinding energy of strongly-bound membrane-associated proteins." [http://dx.doi.org/10.1016/j.bbamem.2016.07.004 BBA Biomembranes 1858(11): 2753–62, 2016.] This paper gives multiple experimental measurements of binding energy between the Dengue virus envelope protein and host membranes that largely confirm our computational predictions from 2015. I contributed all the theory for terminal velocity during sedimentation, along with a novel kinetic analysis providing the free energy and enthalpy of the dissociation barrier (all the details are at the end of the appendix). |- style="border: 1px solid darkgray;" || David M. Rogers. "Thermodynamics of Maximum Transition Entropy for Quantum Assemblies." [http://arxiv.org/abs/1503.01232 arXiv:1503.01232 submitted, 2016]. The work presents a new, general, theoretical foundation for the dynamics of open quantum systems modeled on the maximum entropy derivation of equilibrium statistical mechanics. Computational results are presented for three detailed systems to validate and reinforce the theory. It represents a significant advancement for the field, as it lucidly connects the dynamics of a single wavefunction plus environmental noise to the Caldeira-Leggett model for density matrices. |- style="border: 1px solid darkgray;" || Andriy Anishkin, Juan M. Vanegas, David M. Rogers, Philip L. Lorenzi, Wai Kin Chan, Preeti Purwaha, John N. Weinstein, Sergei Sukharev, and Susan B. Rempe. "Catalytic Role of the Substrate Defines Specificity of Therapeutic L-Asparaginase." [http://dx.doi.org/10.1016/j.jmb.2015.06.017 J. Mol. Biol. 427:2867-2885, 2015]. We present an explanation for the (until now controversial) catalytic mechanism of type 2 bacterial L-asparaginase enzymes. By using the carboxylic acid of the substrate (asparagine) as the proton acceptor, this enzyme is able to preferentially carry out deamidation on asparagine more quickly than for the competing substrate, glutamine. The hypothesis, re-discovered from our MD simulations, was first put forward years ago in contested experimental studies, and now finds additional support from our MD and QM calculations. |- style="border: 1px solid darkgray;" || David M. Rogers. "Towards a Direct, By-Need Evaluator for Dependently Typed Languages." [http://arxiv.org/abs/1509.07036 arXiv:1509.07036 submitted, 2015]. This paper describes the implementation of a new interpreted language for distributed parallel computing. It achieves its goal by maintaining pure functional semantics, allowing all terms in the language to be partially evaluated and serialized to network storage at any point during computation. |- style="border: 1px solid darkgray;" || Marielle Soniat, David M. Rogers, and Susan Rempe. "Dispersion- and Exchange-Corrected Density Functional Theory for Sodium Ion Hydration." [http://pubs.acs.org/doi/abs/10.1021/acs.jctc.5b00357 J. Chem. Theory. Comput. 142:074101, 2015]. We studied the influence of dispersion energy corrections on the free energy of formation for sodium-water clusters computed with DFT and wound up discovering that dispersion and split-range exchange functionals can somewhat counter-balance each other. The charged sodium ion pulls on the water's electrons, clearly showing which density functionals over-polarize compared to CCSD. Split-range exchange can reduce this over-polarization, but results in reduced electrostatic interaction. Dispersion can lower the binding energy again to counter-balance. So, functionals fit to experimental formation energies need both effects to avoid lowering energies by over-polarizing. |- style="border: 1px solid darkgray;" || David M. Rogers. "Real-space quadrature: a convenient, efficient representation for multipole expansions." [http://dx.doi.org/10.1063/1.4907404 J. Chem. Phys. 142:074101, 2015]. ([http://predictivestatmech.org/papers/real-poles.pdf Presentation]) I introduce sets of point charges that are able to simultaneously reproduce all multipole (spherical harmonic) expansions up to arbitrary order. The number of points is space-optimal. Translations are described from the usual harmonics and from Cartesian moments (dipole, quadrupole, etc.) on supersymmetric tensors to directional moments using the point weight distribution. Many applications are possible, including trivial implementation of multipoles in molecular mechanics and representing probability distributions over rotation space. |- style="border: 1px solid darkgray;" || David M. Rogers, Michael S. Kent, and Susan B. Rempe, "Molecular basis of endosomal-membrane association for the dengue virus envelope protein." [http://dx.doi.org/10.1016/j.bbamem.2014.12.018 BBA Biomembranes 1848(4):1041-52, 2015.] A fully atomistic potential of mean force for association of the viral envelope protein from Dengue virus was compared to a Poisson-Boltzmann electrostatic plus dispersion model. The results are consistent, showing hope for this type of combined scale simulation. |- style="border: 1px solid darkgray;" || Yaqin Fu, Binsong Li, Ying-Bing Jiang, Darren R. Dunphy, Andy Tsai, Siu-Yue Tam, Hongyou Fan, Hongxia Zhan, David Rogers, Susan Rempe, Plamen Atanassov, Joseph L. Cecchi, and C. Jeffrey Brinker "Atomic Layer Deposition of L-Alanine Polypeptide." [http://pubs.acs.org/doi/abs/10.1021/ja5043403 JACS 136(45):15821–4, 2014.] This paper with our experimental collaborators carried out blocked peptide synthesis by vapor-depositing Boc-L-alanine to create a uniform thin film of polypeptides grown on a silica substrate activated by aminopropyltrimethoxysilane. |- style="border: 1px solid darkgray;" || David M. Rogers. "Silmaril, A Functional Language for Distributed Parallel Evaluation." [http://predictivestatmech.org/sil/papers/sil.pdf Submitted version] |- style="border: 1px solid darkgray;" || Mathias B. Andersen, David M. Rogers, Junyu Mai, Benjamin Schudel, Anson V. Hatch, Susan B. Rempe and Ali Mani. "Spatiotemporal pH dynamics in concentration polarization near ion-selective membranes." [http://dx.doi.org/10.1021/la5014297 Langmuir, 30(26):7902–7912, 2014] |- style="border: 1px solid darkgray;" || W. K. Chan, P. L. Lorenzi, A. Anishkin, P. Purwaha, D. M. Rogers, S. Sukharev, S.B. Rempe, and J. N. Weinstein. "The glutaminase activity of l-asparaginase is not required for anticancer activity against ASNS-negative cells." [http://dx.doi.org/10.1182/blood-2013-10-535112 Blood. 123(23):3596-606, 2014]. |- style="border: 1px solid darkgray;" || David M. Rogers, Dian Jiao, Lawrence Pratt, and Susan B. Rempe. "Structural Models and Molecular Thermodynamics of Hydration of Ions and Small Molecules" [http://dx.doi.org/10.1016/B978-0-444-59440-2.00004-1 Annu. Rep. Comp. Chem. 8:71–127, 2012.] |- style="border: 1px solid darkgray;" || David M. Rogers and Susan B. Rempe. "Irreversible Thermodynamics." [http://dx.doi.org/10.1088/1742-6596/402/1/012014 J. Phys.: Conf. Ser. 402:012014, 2012]. |- style="border: 1px solid darkgray;" || David M. Rogers, Thomas L. Beck, and Susan B. Rempe. [[Media:Dmroge_InfoNonequ2011.pdf|"An Information Theory Approach to Nonlinear, Nonequilibrium Thermodynamics."]] [http://dx.doi.org/10.1007/s10955-011-0358-9 J. Stat. Phys. 145(2):385-409, 2011] We show how the interpretation of thermodynamic states as representing system information leads naturally to thermodynamic cycles and the first and second laws of thermodynamics as well as similar formulations for nontrivial nonequilibrium problems. The logical development of the theory also leads naturally to correct indistinguishability factors in the partition function. |- style="border: 1px solid darkgray;" || Sameer Varma, David M. Rogers, Lawrence R. Pratt, and Susan B. Rempe. "Perspectives on Ion Selectivity: Design Principles for K+ Selectivity in Membrane Transport." [http://jgp.rupress.org/content/137/6/479.full J. Gen. Physiol., 137(6):479-488, 2011.] We review the development of models for understanding the physical basis of selectivity for K+ ions over Na+, its sibling only one row behind, in membrane channels and transporters. Although the problem is subtle because of the morass of competing effects, we emphasize work analyzing the systematic influence of the environment on tipping local binding site structure toward selective configurations. |- style="border: 1px solid darkgray;" || David M. Rogers and Susan B. Rempe. [http://www.ncbi.nlm.nih.gov/pmc/articles/PMC3443978/ “Probing the Thermodynamics of Competitive Ion Binding Using Minimum Energy Structures.”] [http://dx.doi.org/10.1021/jp2012864 J. Phys. Chem. B, 115(29):9116-29, 2011]. We presented an extension of the Quasi-Chemical theory for quantifying the impact of local structure on ion complexation thermodynamics. The theory can be simply represented using a set of thermodynamic cycles involving binding site structural and compositional states as reaction intermediates. |- style="border: 1px solid darkgray;" || Susan B. Rempe and David M. Rogers; et. al. “Computational and experimental platform for understanding and optimizing water flux and salt rejection in nanoporous membranes.” [http://prod.sandia.gov/techlib/access-control.cgi/2010/106735.pdf Sandia Technical Report, SAND2010-6735, 2010.] We summarize work on designing polymer coatings for salt exclusion in water transporting nanopores. In this work, I collected available molecular dynamics results for these systems and performed a novel energy efficiency analysis able to relate atomistic and experimental scales as well as identify important design goals and chemical principles for material performance. |- style="border: 1px solid darkgray;" || David M. Rogers, [http://rave.ohiolink.edu/etdc/view?acc_num=ucin1251832030 ''''Using Bayes' Theorem for Free Energy Calculations''''], 2009. We investigated the central quantity of free energies in a Bayesian context and provide estimators for solvation free energies as well as optimal potential of mean force approximations to model polymer coarse-grained dynamics from atomistic simulations. |- style="border: 1px solid darkgray;" || Zhen Zhao, David M. Rogers and Thomas L. Beck. "Polarization and Charge Transfer in the Hydration of Chloride Ions." [http://link.aip.org/link/?JCP/132/014502/1 J. Chem. Phys., 132:014502, 2010.] Dr. Zhao's ab-initio analysis of the charge distribution in water-ion clusters highlighted the importance of many-body water-water interactions and charge transfer effects in determining cluster structural and energetic properties. These are still challenging to represent in modern polarizable forcefields and have implications for anion properties at interfaces. |- style="border: 1px solid darkgray;" || David M. Rogers and Thomas L. Beck. "Quasi-Chemical and Structural Analysis of Polarizable Anion Hydration." [http://link.aip.org/link/?JCP/132/014505/1 J. Chem. Phys., 132:014505, 2010.] The role of polarizability in forcefield-based models of ions and water was examined. Utilizing some of our recent developments on quasi-chemical theory, we have been able to quantify the tightened, asymmetric nature of the ion's local solvation waters induced by increased polarizability as well as the exact effects of polarization on the solvation free energy. The results suggest some potential problems and diagnostics for such models. |- style="border: 1px solid darkgray;" || David M. Rogers and Thomas L. Beck. [http://forcesolve.sourceforge.net/ Force Solve] (Sourceforge, Chicago IL, 2008). This force matching software implements and tests coarse-graining for general molecular systems in a mere 4000 lines of code. It is able to parametrize coarse Hamiltonians from atomic trajectory data given arbitrary definitions of coarse united-atom type models as well as carry out short Langevin Dynamics simulations on the coarse scale. The program's main drawbacks are its slow speed and high memory usage due to its simplistic design, attributable to the interpreted nature of python. |- style="border: 1px solid darkgray;" || David M. Rogers and Thomas L. Beck. "Resolution and Scale Independent Nonparametric Function Matching Using a String Energy Penalized Spline Prior." 2008. [http://arxiv.org/abs/1003.4741 arXiv:1003.4741v1] (stat.ML). Fresh insight is provided into long-standing mathematical issues surrounding computational modeling of continuous functions from a few sampled data points. The present research lays the groundwork for predicting the behavior of complicated many-body systems using advanced regression techniques. |- style="border: 1px solid darkgray;" || David M. Rogers and Thomas L. Beck. "Modeling molecular and ionic absolute solvation free energies with quasichemical theory bounds." [https://doi.org/10.1063/1.2985613 J. Chem. Phys., 129:134505, 2008.] We develop a Bayesian method for computing (with error bars) the free energy for forming a nano-bubble in an arbitrary solvent system. This forms the first step of a thermodynamic cycle for dissolving a real solute. We prove that upper and lower bounds for that solvation free energy can be obtained from two simulations (with and without the solute present). The method is excellent for dissolving gas in water, while the upper/lower bounds are larger for dissolving water or ions. |} == Manuscripts in Preparation/Submitted == * [https://arxiv.org/abs/1712.09427 Fluctuation Theory of Ionic Solvation Potentials] * [https://arxiv.org/abs/1503.01232 Thermodynamics of Maximum Transition Entropy for Quantum Assemblies] * [https://arxiv.org/abs/1701.01466 Maximum Entropy Closure for Flows in Transiently Driven Nonequilibrium Systems] 90607263d58531580dd1d5e28f2c122f30a14db5 Courses 0 16 716 696 2019-02-25T21:48:52Z David M. Rogers 2 wikitext text/x-wiki Here's a list of courses with useful online materials: == Courses == * [[Courses/PChemSpring2019 | USF Physical Chemistry II (2019)]] * [[PChemFall2018| USF Physical Chemistry I (2018)]] * [[PChemFall2017| USF Physical Chemistry I (2017)]] * [[PChemFall2016| USF Physical Chemistry I (2016)]] * [[GradQuantumFall2013| USF Graduate Quantum Mechanics I]] * [[GradQuantumSpring2014| USF Graduate Quantum Mechanics II]] * [[CompSciSpring2018|Introduction to Scientific Computing (2018)]] * [[CompSciSpring2017|Introduction to Scientific Computing (2017)]] * [[CompSciSpring2016|Introduction to Scientific Computing (2016)]] * [[CompSciFall2014|Introduction to Scientific Computing (2014)]] * [http://lambda-the-ultimate.org/classic/Courses.html Functional Programming] == Lecture Series == * [http://www.esqc.org/lectures European Summer School in Quantum Chemistry] == Tutorials == * [[HowTo:Fourier|Fourier transforms]] * [http://www.mathematica-journal.com/2012/02/evaluation-of-gaussian-molecular-integrals Evaluating Matrix Elements] * [http://www.haskell.org/tutorial/ Haskell] * [http://monads.haskell.cz/html/index.html Monads] * [http://www.yosefk.com/blog/my-history-with-forth-stack-machines.html The Forth Language] == Reference Material == * [http://dft.sandia.gov/Quest/DFT_codes.html List of DFT Codes] * [http://docs.python.org/3/tutorial/ Python Tutorial] * [http://www.nwchem-sw.org/index.php/Release62:NWChem_Documentation NWChem Documentation] * [http://www.ebi.ac.uk/pdbe-srv/pdbechem/ PDB Ligand Structures] fea745c1c0c262890eaf9db23bc78f57f81fcfc6 754 716 2019-09-10T17:55:46Z David M. Rogers 2 add Fall 2019 link wikitext text/x-wiki Here's a list of courses with useful online materials: == Courses == * [[PChemFall2019| USF Physical Chemistry I (2019)]] * [[Courses/PChemSpring2019 | USF Physical Chemistry II (2019)]] * [[PChemFall2018| USF Physical Chemistry I (2018)]] * [[PChemFall2017| USF Physical Chemistry I (2017)]] * [[PChemFall2016| USF Physical Chemistry I (2016)]] * [[GradQuantumFall2013| USF Graduate Quantum Mechanics I]] * [[GradQuantumSpring2014| USF Graduate Quantum Mechanics II]] * [[CompSciSpring2018|Introduction to Scientific Computing (2018)]] * [[CompSciSpring2017|Introduction to Scientific Computing (2017)]] * [[CompSciSpring2016|Introduction to Scientific Computing (2016)]] * [[CompSciFall2014|Introduction to Scientific Computing (2014)]] * [http://lambda-the-ultimate.org/classic/Courses.html Functional Programming] == Lecture Series == * [http://www.esqc.org/lectures European Summer School in Quantum Chemistry] == Tutorials == * [[HowTo:Fourier|Fourier transforms]] * [http://www.mathematica-journal.com/2012/02/evaluation-of-gaussian-molecular-integrals Evaluating Matrix Elements] * [http://www.haskell.org/tutorial/ Haskell] * [http://monads.haskell.cz/html/index.html Monads] * [http://www.yosefk.com/blog/my-history-with-forth-stack-machines.html The Forth Language] == Reference Material == * [http://dft.sandia.gov/Quest/DFT_codes.html List of DFT Codes] * [http://docs.python.org/3/tutorial/ Python Tutorial] * [http://www.nwchem-sw.org/index.php/Release62:NWChem_Documentation NWChem Documentation] * [http://www.ebi.ac.uk/pdbe-srv/pdbechem/ PDB Ligand Structures] 0eb77b066ffa904eaf041a05a0d09d267228c993 File:HW6.pdf 6 161 719 2019-02-26T17:41:44Z David M. Rogers 2 wikitext text/x-wiki da39a3ee5e6b4b0d3255bfef95601890afd80709 File:MeasProb1.jpg 6 162 730 2019-03-19T19:31:39Z David M. Rogers 2 wikitext text/x-wiki da39a3ee5e6b4b0d3255bfef95601890afd80709 File:MeasProb2.jpg 6 163 731 2019-03-19T19:32:07Z David M. Rogers 2 wikitext text/x-wiki da39a3ee5e6b4b0d3255bfef95601890afd80709 File:MeasProb3.jpg 6 164 732 2019-03-19T19:32:31Z David M. Rogers 2 wikitext text/x-wiki da39a3ee5e6b4b0d3255bfef95601890afd80709 File:MeasProb4.jpg 6 165 733 2019-03-19T19:32:52Z David M. Rogers 2 wikitext text/x-wiki da39a3ee5e6b4b0d3255bfef95601890afd80709 File:MeasProb5.jpg 6 166 734 2019-03-19T19:33:25Z David M. Rogers 2 wikitext text/x-wiki da39a3ee5e6b4b0d3255bfef95601890afd80709 File:BellIBM.png 6 167 737 2019-03-21T21:10:43Z David M. Rogers 2 Symmetric antiparallel Bell state created on IBM Q-experience. wikitext text/x-wiki Symmetric antiparallel Bell state created on IBM Q-experience. efe49e7915cbb74b59cccb3a23d8d40aa71614de Template:Note 10 168 740 2019-03-23T22:52:24Z David M. Rogers 2 Created page with "<div style="background-color: #ddf5eb; border-style: dotted;"> {{{1}}} </div>" wikitext text/x-wiki <div style="background-color: #ddf5eb; border-style: dotted;"> {{{1}}} </div> 4cf77ea3eced10a5810aa574e5c1777ecd267c48 File:Definitions7.jpg 6 169 745 2019-04-08T19:34:58Z David M. Rogers 2 wikitext text/x-wiki da39a3ee5e6b4b0d3255bfef95601890afd80709 PChemFall2019 0 170 751 2019-08-19T17:27:24Z David M. Rogers 2 Created page with "'''<BIG>Physical Chemistry I</BIG>''' Course Info * Course Numbers CHM 4410-001 * Credit Hours: 4 * Meeting Dates: Aug. 27 - Nov. 26, 2018 * Meeting Times: Tues. and Thurs.,..." wikitext text/x-wiki '''<BIG>Physical Chemistry I</BIG>''' Course Info * Course Numbers CHM 4410-001 * Credit Hours: 4 * Meeting Dates: Aug. 27 - Nov. 26, 2018 * Meeting Times: Tues. and Thurs., 3:30-4:45 pm in CIS 3064 ** Regular quizzes on Tuesdays ** Problem Sessions: Fri., 2-2:50 pm in CIS 3064 ** Office Hours: by request and TBA * Grading: ** Quiz (25%) *** To succeed in the quiz, complete the homework and study the topics covered in the previous week! ** Exam 1 (25%) Thurs., Sept. 26 3:30-4:45 pm (CIS 3064) ** Exam 2 (25%) Thurs., Oct. 24 3:30-4:45 pm (CIS 3064) ** Final (25%) due Tues., Nov. 26 3:30 pm (Canvas or CIS 3064) == Overview == This is the first part of a 2-semester course in thermodynamics. This course will cover the mathematical theory of chemical equilibrium, heat, and work. These are the driving forces behind the operation of Le Châtelier's principle, and are routinely used to understand and control chemical reactions, states of matter, and amount and efficiency of energy production. == Textbooks == * McQuarrie and Simon, Physical Chemistry: A Molecular Approach, University Science Books, 1997. ISBN: 0935702997. == Resources == * [http://hyperphysics.phy-astr.gsu.edu/hbase/kinetic/ktcon.html Kinetic Theory] at HyperPhysics * [http://hyperphysics.phy-astr.gsu.edu/hbase/heacon.html Heat Concepts] at HyperPhysics ** Note: McQuarrie says dU = dQ + dW, while Nave says dU = dQ - dW. There is no contradiction, since McQuarrie's dW = -P dV (work done on the system), while Nave's dW = P dV (work done by the system). I prefer the first definition. * News from the frontlines of exploring entropy: [http://scitation.aip.org/content/aip/magazine/physicstoday/article/68/9/10.1063/PT.3.2912 Information: From Maxwell’s demon to Landauer’s eraser] * [[Media:Transforms.pdf|Notes]] on transformations of variables. * [[PChemFall2017 | Course Page from 2017]] * [[PChemFall2016 | Course Page from 2016]] * [[PChemFall2015 | Course Page from 2015]] -- contains previous quizzes and keys. * [https://predictivestatmech.org/papers/quiz0.pdf Pretest key] * [https://predictivestatmech.org/papers/quiz1_2018.pdf Quiz 1 Key] -- for more information and practice problems, see The Vallance Chemistry Group, U. Oxford (http://vallance.chem.ox.ac.uk under Teaching -> Units and Dimensions). * Gas Thermodynamics Videos: ** P-V work demonstrated by a [https://youtu.be/j0TQxYemrgg?t=75 Steel Drum Implosion] ** Adiabatic Compression in a [https://youtu.be/4qe1Ueifekg?t=144 Fire Piston] ** Complete thermodynamic cycle [https://youtu.be/EtF3-YmHp_0?t=29 Stirling Engine] ** Pressure (concentration gradient) driven chemical work [https://youtu.be/3y1dO4nNaKY?t=95 ATP Synthetase] == Topics == # Moving Freely in P-V-T space (Chapter H, with examples from Ch. 16-[2,3,5,6,7], 17-[4,5], and 19-1) #* Isobaric, isothermal, and isochoric processes #* State functions #* Implicit, partial, and total derivatives #* Integration along a path #* Relations between partial derivatives #** Transformations using substitution #** Transformations using the chain rule #* Visualizing isosurfaces #* Using P(V,T) / V(P,T) / T(P,V) # First Law of Thermodynamics – conserved quantities (Ch. 19-[2 to 9]) #* Mechanisms of energy flow: work, heat, mass/chemical #* Integrating work and heat for common processes #* Energy of a molecule vs. a collection – translation, rotation, intermolecular, etc. #* Extensive and intensive quantities #* Using energy balance for fun and profit. # Standard States and Energies (Ch. 19-[10,11,12], Ch 26-[3,6,7,8,9]) #* Connecting to analytical chemistry. #* Spontaneous, irreversible, processes vs. quasistatic processes. #* Experimentally measuring reaction constants and heats. (Ch. 21-5) # The Second Law of Thermodynamics: Energy, Enthalpy, Entropy, and Free Energy (Ch. 20) #* The absolute temperature scale. (Ch. 16-1) #* Inequalities followed by each path type. (Ch. 22-[1,2]) #* Heat, measurement, information, Maxwell’s demon and Landauer’s principle. # Basic Probability #* Simple counting (Ch. J) #* Velocity distribution function (Ch 27-[1,2,3,4]) #* Boltzmann distributions (Ch. 17-[1,2,3,6 to 8]) # Applications: #* Quantitative Prediction of Reaction Equilibria (Ch. 26) #* Liquid solutions: osmotic pressure, vapor pressure, Henry’s and Raoult’s Laws (Ch. 24) #* Phase Equilibria and Basic Phase Diagrams (Ch. 23) #* Thermodynamic Cycles, Examples with Refrigeration and Galvanic Cell (Ch. 20-7) == Assigned Homework Problems == # Moving Freely in P-V-T space #* H: 1-5,7,10-14 #* 16:1-21,25,26(1st part),29,35-42,44-45,52-56,58-59,33(optional) #** sketch a plot for 16.4 and 16.5 #* 17: 9-17 # First Law (sec. 19-1 through 19-9) #* 19:1-31 #* You can skip 19-27 and 28 (we'll do in class) # Standard States and Energies (sec. 19-10 through 19-12, 21-5 and 26-3 through 26-9) #* 19:34-49 #* 21: 1-7, 10-26, 29, 48, 42-43, 45-47 #* 26: 2,6,8-11,13,16-17,21 #* 26: 61 -- only integrate dG = V dP at constant V=1/rho. # Entropy, Free Energy and the Second Law (all of Ch. 20, sections 16:1, 22:1-2) #* 20: 2-4, 6-16, 18-19, 24-25, 27-30, 32-33 #* 22: 1-5 (for 4 and 5 use 1st law and Gibbs relation from A) #* 16: 4,6-11 # Basic Probability (Ch. J, 17 and 27) #* J: 1-7 #* 17: 1, 3, 4, 7-8 [for 7, use a 3-state system with E(0) = 0, E(-1) = -1, E(1) = 1] #* 27:1-9 # Applications: ## Reaction Equilibria (Ch. 26) ##* 26: 3-7, 12, 14-15, 33, 59, 61, 62-65 ## Phase Equilibria and Basic Phase Diagrams (Ch. 23) ## Liquid Solutions: Osmotic Pressure, Henry's and Raoult's Law (Ch. 24) == Online Tutorials == There are some excellent introductory videos on Khan Academy that are useful if you need a refresher or extra practice with some of the topics in the course. # Moving Freely in P-V-T space #* Isobars & Work [https://www.khanacademy.org/test-prep/mcat/chemical-processes/thermodynamics-mcat/v/pv-diagrams-part-1-work-and-isobaric-processes] #* Isotherms, Isochors, Adiabats [https://www.khanacademy.org/test-prep/mcat/chemical-processes/thermodynamics-mcat/v/pv-diagrams-part-2-isothermal-isometric-adiabatic-processes] #* Implicit Derivatives (explained with practice problems) [https://www.khanacademy.org/math/ap-calculus-ab/ab-derivatives-advanced/ab-implicit-diff/v/implicit-differentiation-1] #* Partial Derivatives (explained with practice problems) [https://www.khanacademy.org/math/multivariable-calculus/multivariable-derivatives/partial-derivatives/v/partial-derivatives-introduction] #* State Functions (Macrostates vs Microstates) [https://www.khanacademy.org/science/chemistry/thermodynamics-chemistry/internal-energy-sal/v/macrostates-and-microstates] #* Quasistatic and Reversible Processes [https://www.khanacademy.org/science/chemistry/thermodynamics-chemistry/internal-energy-sal/v/quasistatic-and-reversible-processes] #* Integration along a path (using PV-diagrams and expansion/compression Work) [https://www.khanacademy.org/science/chemistry/thermodynamics-chemistry/internal-energy-sal/v/pv-diagrams-and-expansion-work] # First Law of Thermodynamics – conserved quantities (Ch. 19-[2 to 9]) #* PV work [https://www.khanacademy.org/science/chemistry/thermodynamics-chemistry/internal-energy-sal/a/pressure-volume-work] e1680731b7ff580134d4a1788d9cfe84fcb892c3 752 751 2019-08-19T17:28:24Z David M. Rogers 2 wikitext text/x-wiki '''<BIG>Physical Chemistry I</BIG>''' Course Info * Course Numbers CHM 4410-001 * Credit Hours: 4 * Meeting Dates: Aug. 27 - Nov. 26, 2019 * Meeting Times: Tues. and Thurs., 3:30-4:45 pm in CIS 3064 ** Regular quizzes on Tuesdays ** Problem Sessions: Fri., 2-2:50 pm in CIS 3064 ** Office Hours: by request and TBA * Grading: ** Quiz (25%) *** To succeed in the quiz, complete the homework and study the topics covered in the previous week! ** Exam 1 (25%) Thurs., Sept. 26 3:30-4:45 pm (CIS 3064) ** Exam 2 (25%) Thurs., Oct. 24 3:30-4:45 pm (CIS 3064) ** Final (25%) due Tues., Nov. 26 3:30 pm (Canvas or CIS 3064) == Overview == This is the first part of a 2-semester course in thermodynamics. This course will cover the mathematical theory of chemical equilibrium, heat, and work. These are the driving forces behind the operation of Le Châtelier's principle, and are routinely used to understand and control chemical reactions, states of matter, and amount and efficiency of energy production. == Textbooks == * McQuarrie and Simon, Physical Chemistry: A Molecular Approach, University Science Books, 1997. ISBN: 0935702997. == Resources == * [http://hyperphysics.phy-astr.gsu.edu/hbase/kinetic/ktcon.html Kinetic Theory] at HyperPhysics * [http://hyperphysics.phy-astr.gsu.edu/hbase/heacon.html Heat Concepts] at HyperPhysics ** Note: McQuarrie says dU = dQ + dW, while Nave says dU = dQ - dW. There is no contradiction, since McQuarrie's dW = -P dV (work done on the system), while Nave's dW = P dV (work done by the system). I prefer the first definition. * News from the frontlines of exploring entropy: [http://scitation.aip.org/content/aip/magazine/physicstoday/article/68/9/10.1063/PT.3.2912 Information: From Maxwell’s demon to Landauer’s eraser] * [[Media:Transforms.pdf|Notes]] on transformations of variables. * [[PChemFall2018 | Course Page from 2018]] * [[PChemFall2017 | Course Page from 2017]] * [[PChemFall2016 | Course Page from 2016]] * [[PChemFall2015 | Course Page from 2015]] -- contains previous quizzes and keys. * [https://predictivestatmech.org/papers/quiz0.pdf Pretest key] * [https://predictivestatmech.org/papers/quiz1_2018.pdf Quiz 1 Key] -- for more information and practice problems, see The Vallance Chemistry Group, U. Oxford (http://vallance.chem.ox.ac.uk under Teaching -> Units and Dimensions). * Gas Thermodynamics Videos: ** P-V work demonstrated by a [https://youtu.be/j0TQxYemrgg?t=75 Steel Drum Implosion] ** Adiabatic Compression in a [https://youtu.be/4qe1Ueifekg?t=144 Fire Piston] ** Complete thermodynamic cycle [https://youtu.be/EtF3-YmHp_0?t=29 Stirling Engine] ** Pressure (concentration gradient) driven chemical work [https://youtu.be/3y1dO4nNaKY?t=95 ATP Synthetase] == Topics == # Moving Freely in P-V-T space (Chapter H, with examples from Ch. 16-[2,3,5,6,7], 17-[4,5], and 19-1) #* Isobaric, isothermal, and isochoric processes #* State functions #* Implicit, partial, and total derivatives #* Integration along a path #* Relations between partial derivatives #** Transformations using substitution #** Transformations using the chain rule #* Visualizing isosurfaces #* Using P(V,T) / V(P,T) / T(P,V) # First Law of Thermodynamics – conserved quantities (Ch. 19-[2 to 9]) #* Mechanisms of energy flow: work, heat, mass/chemical #* Integrating work and heat for common processes #* Energy of a molecule vs. a collection – translation, rotation, intermolecular, etc. #* Extensive and intensive quantities #* Using energy balance for fun and profit. # Standard States and Energies (Ch. 19-[10,11,12], Ch 26-[3,6,7,8,9]) #* Connecting to analytical chemistry. #* Spontaneous, irreversible, processes vs. quasistatic processes. #* Experimentally measuring reaction constants and heats. (Ch. 21-5) # The Second Law of Thermodynamics: Energy, Enthalpy, Entropy, and Free Energy (Ch. 20) #* The absolute temperature scale. (Ch. 16-1) #* Inequalities followed by each path type. (Ch. 22-[1,2]) #* Heat, measurement, information, Maxwell’s demon and Landauer’s principle. # Basic Probability #* Simple counting (Ch. J) #* Velocity distribution function (Ch 27-[1,2,3,4]) #* Boltzmann distributions (Ch. 17-[1,2,3,6 to 8]) # Applications: #* Quantitative Prediction of Reaction Equilibria (Ch. 26) #* Liquid solutions: osmotic pressure, vapor pressure, Henry’s and Raoult’s Laws (Ch. 24) #* Phase Equilibria and Basic Phase Diagrams (Ch. 23) #* Thermodynamic Cycles, Examples with Refrigeration and Galvanic Cell (Ch. 20-7) == Assigned Homework Problems == # Moving Freely in P-V-T space #* H: 1-5,7,10-14 #* 16:1-21,25,26(1st part),29,35-42,44-45,52-56,58-59,33(optional) #** sketch a plot for 16.4 and 16.5 #* 17: 9-17 # First Law (sec. 19-1 through 19-9) #* 19:1-31 #* You can skip 19-27 and 28 (we'll do in class) # Standard States and Energies (sec. 19-10 through 19-12, 21-5 and 26-3 through 26-9) #* 19:34-49 #* 21: 1-7, 10-26, 29, 48, 42-43, 45-47 #* 26: 2,6,8-11,13,16-17,21 #* 26: 61 -- only integrate dG = V dP at constant V=1/rho. # Entropy, Free Energy and the Second Law (all of Ch. 20, sections 16:1, 22:1-2) #* 20: 2-4, 6-16, 18-19, 24-25, 27-30, 32-33 #* 22: 1-5 (for 4 and 5 use 1st law and Gibbs relation from A) #* 16: 4,6-11 # Basic Probability (Ch. J, 17 and 27) #* J: 1-7 #* 17: 1, 3, 4, 7-8 [for 7, use a 3-state system with E(0) = 0, E(-1) = -1, E(1) = 1] #* 27:1-9 # Applications: ## Reaction Equilibria (Ch. 26) ##* 26: 3-7, 12, 14-15, 33, 59, 61, 62-65 ## Phase Equilibria and Basic Phase Diagrams (Ch. 23) ## Liquid Solutions: Osmotic Pressure, Henry's and Raoult's Law (Ch. 24) == Online Tutorials == There are some excellent introductory videos on Khan Academy that are useful if you need a refresher or extra practice with some of the topics in the course. # Moving Freely in P-V-T space #* Isobars & Work [https://www.khanacademy.org/test-prep/mcat/chemical-processes/thermodynamics-mcat/v/pv-diagrams-part-1-work-and-isobaric-processes] #* Isotherms, Isochors, Adiabats [https://www.khanacademy.org/test-prep/mcat/chemical-processes/thermodynamics-mcat/v/pv-diagrams-part-2-isothermal-isometric-adiabatic-processes] #* Implicit Derivatives (explained with practice problems) [https://www.khanacademy.org/math/ap-calculus-ab/ab-derivatives-advanced/ab-implicit-diff/v/implicit-differentiation-1] #* Partial Derivatives (explained with practice problems) [https://www.khanacademy.org/math/multivariable-calculus/multivariable-derivatives/partial-derivatives/v/partial-derivatives-introduction] #* State Functions (Macrostates vs Microstates) [https://www.khanacademy.org/science/chemistry/thermodynamics-chemistry/internal-energy-sal/v/macrostates-and-microstates] #* Quasistatic and Reversible Processes [https://www.khanacademy.org/science/chemistry/thermodynamics-chemistry/internal-energy-sal/v/quasistatic-and-reversible-processes] #* Integration along a path (using PV-diagrams and expansion/compression Work) [https://www.khanacademy.org/science/chemistry/thermodynamics-chemistry/internal-energy-sal/v/pv-diagrams-and-expansion-work] # First Law of Thermodynamics – conserved quantities (Ch. 19-[2 to 9]) #* PV work [https://www.khanacademy.org/science/chemistry/thermodynamics-chemistry/internal-energy-sal/a/pressure-volume-work] 8c26bc4656f4ac4761d61ae6158cb5637befcf22 755 752 2019-10-17T18:33:48Z David M. Rogers 2 wikitext text/x-wiki '''<BIG>Physical Chemistry I</BIG>''' Course Info * Course Numbers CHM 4410-001 * Credit Hours: 4 * Meeting Dates: Aug. 27 - Nov. 26, 2019 * Meeting Times: Tues. and Thurs., 3:30-4:45 pm in CIS 3064 ** Regular quizzes on Tuesdays ** Problem Sessions: Fri., 2-2:50 pm in CIS 3064 ** Office Hours: by request and TBA * Grading: ** Quiz (25%) *** To succeed in the quiz, complete the homework and study the topics covered in the previous week! ** Exam 1 (25%) Thurs., Sept. 26 3:30-4:45 pm (CIS 3064) ** Exam 2 (25%) Thurs., Oct. 24 3:30-4:45 pm (CIS 3064) ** [[#Final Project]] (25%) due Tues., Nov. 26 3:30 pm (Canvas or CIS 3064) == Overview == This is the first part of a 2-semester course in thermodynamics. This course will cover the mathematical theory of chemical equilibrium, heat, and work. These are the driving forces behind the operation of Le Châtelier's principle, and are routinely used to understand and control chemical reactions, states of matter, and amount and efficiency of energy production. == Textbooks == * McQuarrie and Simon, Physical Chemistry: A Molecular Approach, University Science Books, 1997. ISBN: 0935702997. == Resources == * [http://hyperphysics.phy-astr.gsu.edu/hbase/kinetic/ktcon.html Kinetic Theory] at HyperPhysics * [http://hyperphysics.phy-astr.gsu.edu/hbase/heacon.html Heat Concepts] at HyperPhysics ** Note: McQuarrie says dU = dQ + dW, while Nave says dU = dQ - dW. There is no contradiction, since McQuarrie's dW = -P dV (work done on the system), while Nave's dW = P dV (work done by the system). I prefer the first definition. * News from the frontlines of exploring entropy: [http://scitation.aip.org/content/aip/magazine/physicstoday/article/68/9/10.1063/PT.3.2912 Information: From Maxwell’s demon to Landauer’s eraser] * [[Media:Transforms.pdf|Notes]] on transformations of variables. * [[PChemFall2018 | Course Page from 2018]] * [[PChemFall2017 | Course Page from 2017]] * [[PChemFall2016 | Course Page from 2016]] * [[PChemFall2015 | Course Page from 2015]] -- contains previous quizzes and keys. * [https://predictivestatmech.org/papers/quiz0.pdf Pretest key] * [https://predictivestatmech.org/papers/quiz1_2018.pdf Quiz 1 Key] -- for more information and practice problems, see The Vallance Chemistry Group, U. Oxford (http://vallance.chem.ox.ac.uk under Teaching -> Units and Dimensions). * Gas Thermodynamics Videos: ** P-V work demonstrated by a [https://youtu.be/j0TQxYemrgg?t=75 Steel Drum Implosion] ** Adiabatic Compression in a [https://youtu.be/4qe1Ueifekg?t=144 Fire Piston] ** Complete thermodynamic cycle [https://youtu.be/EtF3-YmHp_0?t=29 Stirling Engine] ** Pressure (concentration gradient) driven chemical work [https://youtu.be/3y1dO4nNaKY?t=95 ATP Synthetase] == Topics == # Moving Freely in P-V-T space (Chapter H, with examples from Ch. 16-[2,3,5,6,7], 17-[4,5], and 19-1) #* Isobaric, isothermal, and isochoric processes #* State functions #* Implicit, partial, and total derivatives #* Integration along a path #* Relations between partial derivatives #** Transformations using substitution #** Transformations using the chain rule #* Visualizing isosurfaces #* Using P(V,T) / V(P,T) / T(P,V) # First Law of Thermodynamics – conserved quantities (Ch. 19-[2 to 9]) #* Mechanisms of energy flow: work, heat, mass/chemical #* Integrating work and heat for common processes #* Energy of a molecule vs. a collection – translation, rotation, intermolecular, etc. #* Extensive and intensive quantities #* Using energy balance for fun and profit. # Standard States and Energies (Ch. 19-[10,11,12], Ch 26-[3,6,7,8,9]) #* Connecting to analytical chemistry. #* Spontaneous, irreversible, processes vs. quasistatic processes. #* Experimentally measuring reaction constants and heats. (Ch. 21-5) # The Second Law of Thermodynamics: Energy, Enthalpy, Entropy, and Free Energy (Ch. 20) #* The absolute temperature scale. (Ch. 16-1) #* Inequalities followed by each path type. (Ch. 22-[1,2]) #* Heat, measurement, information, Maxwell’s demon and Landauer’s principle. # Basic Probability #* Simple counting (Ch. J) #* Velocity distribution function (Ch 27-[1,2,3,4]) #* Boltzmann distributions (Ch. 17-[1,2,3,6 to 8]) # Applications: #* Quantitative Prediction of Reaction Equilibria (Ch. 26) #* Liquid solutions: osmotic pressure, vapor pressure, Henry’s and Raoult’s Laws (Ch. 24) #* Phase Equilibria and Basic Phase Diagrams (Ch. 23) #* Thermodynamic Cycles, Examples with Refrigeration and Galvanic Cell (Ch. 20-7) == Assigned Homework Problems == # Moving Freely in P-V-T space #* H: 1-5,7,10-14 #* 16:1-21,25,26(1st part),29,35-42,44-45,52-56,58-59,33(optional) #** sketch a plot for 16.4 and 16.5 #* 17: 9-17 # First Law (sec. 19-1 through 19-9) #* 19:1-31 #* You can skip 19-27 and 28 (we'll do in class) # Standard States and Energies (sec. 19-10 through 19-12, 21-5 and 26-3 through 26-9) #* 19:34-49 #* 21: 1-7, 10-26, 29, 48, 42-43, 45-47 #* 26: 2,6,8-11,13,16-17,21 #* 26: 61 -- only integrate dG = V dP at constant V=1/rho. # Entropy, Free Energy and the Second Law (all of Ch. 20, sections 16:1, 22:1-2) #* 20: 2-4, 6-16, 18-19, 24-25, 27-30, 32-33 #* 22: 1-5 (for 4 and 5 use 1st law and Gibbs relation from A) #* 16: 4,6-11 # Basic Probability (Ch. J, 17 and 27) #* J: 1-7 #* 17: 1, 3, 4, 7-8 [for 7, use a 3-state system with E(0) = 0, E(-1) = -1, E(1) = 1] #* 27:1-9 # Applications: ## Reaction Equilibria (Ch. 26) ##* 26: 3-7, 12, 14-15, 33, 59, 61, 62-65 ## Phase Equilibria and Basic Phase Diagrams (Ch. 23) ## Liquid Solutions: Osmotic Pressure, Henry's and Raoult's Law (Ch. 24) == Final Project == [https://{{SERVERNAME}}/papers/final_project.pdf A description of the final project is here]. == Online Tutorials == There are some excellent introductory videos on Khan Academy that are useful if you need a refresher or extra practice with some of the topics in the course. # Moving Freely in P-V-T space #* Isobars & Work [https://www.khanacademy.org/test-prep/mcat/chemical-processes/thermodynamics-mcat/v/pv-diagrams-part-1-work-and-isobaric-processes] #* Isotherms, Isochors, Adiabats [https://www.khanacademy.org/test-prep/mcat/chemical-processes/thermodynamics-mcat/v/pv-diagrams-part-2-isothermal-isometric-adiabatic-processes] #* Implicit Derivatives (explained with practice problems) [https://www.khanacademy.org/math/ap-calculus-ab/ab-derivatives-advanced/ab-implicit-diff/v/implicit-differentiation-1] #* Partial Derivatives (explained with practice problems) [https://www.khanacademy.org/math/multivariable-calculus/multivariable-derivatives/partial-derivatives/v/partial-derivatives-introduction] #* State Functions (Macrostates vs Microstates) [https://www.khanacademy.org/science/chemistry/thermodynamics-chemistry/internal-energy-sal/v/macrostates-and-microstates] #* Quasistatic and Reversible Processes [https://www.khanacademy.org/science/chemistry/thermodynamics-chemistry/internal-energy-sal/v/quasistatic-and-reversible-processes] #* Integration along a path (using PV-diagrams and expansion/compression Work) [https://www.khanacademy.org/science/chemistry/thermodynamics-chemistry/internal-energy-sal/v/pv-diagrams-and-expansion-work] # First Law of Thermodynamics – conserved quantities (Ch. 19-[2 to 9]) #* PV work [https://www.khanacademy.org/science/chemistry/thermodynamics-chemistry/internal-energy-sal/a/pressure-volume-work] 242dffba5c8d1a27319c7cba9cf11dd0bb4c132f 756 755 2019-10-31T21:10:01Z David M. Rogers 2 /* Topics */ wikitext text/x-wiki '''<BIG>Physical Chemistry I</BIG>''' Course Info * Course Numbers CHM 4410-001 * Credit Hours: 4 * Meeting Dates: Aug. 27 - Nov. 26, 2019 * Meeting Times: Tues. and Thurs., 3:30-4:45 pm in CIS 3064 ** Regular quizzes on Tuesdays ** Problem Sessions: Fri., 2-2:50 pm in CIS 3064 ** Office Hours: by request and TBA * Grading: ** Quiz (25%) *** To succeed in the quiz, complete the homework and study the topics covered in the previous week! ** Exam 1 (25%) Thurs., Sept. 26 3:30-4:45 pm (CIS 3064) ** Exam 2 (25%) Thurs., Oct. 24 3:30-4:45 pm (CIS 3064) ** [[#Final Project]] (25%) due Tues., Nov. 26 3:30 pm (Canvas or CIS 3064) == Overview == This is the first part of a 2-semester course in thermodynamics. This course will cover the mathematical theory of chemical equilibrium, heat, and work. These are the driving forces behind the operation of Le Châtelier's principle, and are routinely used to understand and control chemical reactions, states of matter, and amount and efficiency of energy production. == Textbooks == * McQuarrie and Simon, Physical Chemistry: A Molecular Approach, University Science Books, 1997. ISBN: 0935702997. == Resources == * [http://hyperphysics.phy-astr.gsu.edu/hbase/kinetic/ktcon.html Kinetic Theory] at HyperPhysics * [http://hyperphysics.phy-astr.gsu.edu/hbase/heacon.html Heat Concepts] at HyperPhysics ** Note: McQuarrie says dU = dQ + dW, while Nave says dU = dQ - dW. There is no contradiction, since McQuarrie's dW = -P dV (work done on the system), while Nave's dW = P dV (work done by the system). I prefer the first definition. * News from the frontlines of exploring entropy: [http://scitation.aip.org/content/aip/magazine/physicstoday/article/68/9/10.1063/PT.3.2912 Information: From Maxwell’s demon to Landauer’s eraser] * [[Media:Transforms.pdf|Notes]] on transformations of variables. * [[PChemFall2018 | Course Page from 2018]] * [[PChemFall2017 | Course Page from 2017]] * [[PChemFall2016 | Course Page from 2016]] * [[PChemFall2015 | Course Page from 2015]] -- contains previous quizzes and keys. * [https://predictivestatmech.org/papers/quiz0.pdf Pretest key] * [https://predictivestatmech.org/papers/quiz1_2018.pdf Quiz 1 Key] -- for more information and practice problems, see The Vallance Chemistry Group, U. Oxford (http://vallance.chem.ox.ac.uk under Teaching -> Units and Dimensions). * Gas Thermodynamics Videos: ** P-V work demonstrated by a [https://youtu.be/j0TQxYemrgg?t=75 Steel Drum Implosion] ** Adiabatic Compression in a [https://youtu.be/4qe1Ueifekg?t=144 Fire Piston] ** Complete thermodynamic cycle [https://youtu.be/EtF3-YmHp_0?t=29 Stirling Engine] ** Pressure (concentration gradient) driven chemical work [https://youtu.be/3y1dO4nNaKY?t=95 ATP Synthetase] == Topics == # Moving Freely in P-V-T space (Chapter H, with examples from Ch. 16-[2,3,5,6,7], 17-[4,5], and 19-1) #* Isobaric, isothermal, and isochoric processes #* State functions #* Implicit, partial, and total derivatives #* Integration along a path #* Relations between partial derivatives #** Transformations using substitution #** Transformations using the chain rule #* Visualizing isosurfaces #* Using P(V,T) / V(P,T) / T(P,V) # First Law of Thermodynamics – conserved quantities (Ch. 19-[2 to 9]) #* Mechanisms of energy flow: work, heat, mass/chemical #* Integrating work and heat for common processes #* Energy of a molecule vs. a collection – translation, rotation, intermolecular, etc. #* Extensive and intensive quantities #* Using energy balance for fun and profit. # Standard States and Energies (Ch. 19-[10,11,12], Ch 26-[3,6,7,8,9]) #* Connecting to analytical chemistry. #* Spontaneous, irreversible, processes vs. quasistatic processes. #* Experimentally measuring reaction constants and heats. (Ch. 21-5) # The Second Law of Thermodynamics: Energy, Enthalpy, Entropy, and Free Energy (Ch. 20) #* The absolute temperature scale. (Ch. 16-1) #* Inequalities followed by each path type. (Ch. 22-[1,2]) #* Heat, measurement, information, Maxwell’s demon and Landauer’s principle. # Basic Probability #* Simple counting (Ch. J) #* Velocity distribution function (Ch 27-[1,2,3,4]) #* Boltzmann distributions (Ch. 17-[1,2,3,6 to 8]) # Applications: #* Quantitative Prediction of Reaction Equilibria (Ch. 26) #* Liquid solutions: osmotic pressure, vapor pressure, Henry’s and Raoult’s Laws (Ch. 24) #* Phase Equilibria and Basic Phase Diagrams (Ch. 23) #* Thermodynamic Cycles, Examples with Refrigeration and Galvanic Cell (Ch. 20-7) #* [https://{{SERVERNAME}}/papers/chempot.pdf Standard expressions for the chemical potential] == Assigned Homework Problems == # Moving Freely in P-V-T space #* H: 1-5,7,10-14 #* 16:1-21,25,26(1st part),29,35-42,44-45,52-56,58-59,33(optional) #** sketch a plot for 16.4 and 16.5 #* 17: 9-17 # First Law (sec. 19-1 through 19-9) #* 19:1-31 #* You can skip 19-27 and 28 (we'll do in class) # Standard States and Energies (sec. 19-10 through 19-12, 21-5 and 26-3 through 26-9) #* 19:34-49 #* 21: 1-7, 10-26, 29, 48, 42-43, 45-47 #* 26: 2,6,8-11,13,16-17,21 #* 26: 61 -- only integrate dG = V dP at constant V=1/rho. # Entropy, Free Energy and the Second Law (all of Ch. 20, sections 16:1, 22:1-2) #* 20: 2-4, 6-16, 18-19, 24-25, 27-30, 32-33 #* 22: 1-5 (for 4 and 5 use 1st law and Gibbs relation from A) #* 16: 4,6-11 # Basic Probability (Ch. J, 17 and 27) #* J: 1-7 #* 17: 1, 3, 4, 7-8 [for 7, use a 3-state system with E(0) = 0, E(-1) = -1, E(1) = 1] #* 27:1-9 # Applications: ## Reaction Equilibria (Ch. 26) ##* 26: 3-7, 12, 14-15, 33, 59, 61, 62-65 ## Phase Equilibria and Basic Phase Diagrams (Ch. 23) ## Liquid Solutions: Osmotic Pressure, Henry's and Raoult's Law (Ch. 24) == Final Project == [https://{{SERVERNAME}}/papers/final_project.pdf A description of the final project is here]. == Online Tutorials == There are some excellent introductory videos on Khan Academy that are useful if you need a refresher or extra practice with some of the topics in the course. # Moving Freely in P-V-T space #* Isobars & Work [https://www.khanacademy.org/test-prep/mcat/chemical-processes/thermodynamics-mcat/v/pv-diagrams-part-1-work-and-isobaric-processes] #* Isotherms, Isochors, Adiabats [https://www.khanacademy.org/test-prep/mcat/chemical-processes/thermodynamics-mcat/v/pv-diagrams-part-2-isothermal-isometric-adiabatic-processes] #* Implicit Derivatives (explained with practice problems) [https://www.khanacademy.org/math/ap-calculus-ab/ab-derivatives-advanced/ab-implicit-diff/v/implicit-differentiation-1] #* Partial Derivatives (explained with practice problems) [https://www.khanacademy.org/math/multivariable-calculus/multivariable-derivatives/partial-derivatives/v/partial-derivatives-introduction] #* State Functions (Macrostates vs Microstates) [https://www.khanacademy.org/science/chemistry/thermodynamics-chemistry/internal-energy-sal/v/macrostates-and-microstates] #* Quasistatic and Reversible Processes [https://www.khanacademy.org/science/chemistry/thermodynamics-chemistry/internal-energy-sal/v/quasistatic-and-reversible-processes] #* Integration along a path (using PV-diagrams and expansion/compression Work) [https://www.khanacademy.org/science/chemistry/thermodynamics-chemistry/internal-energy-sal/v/pv-diagrams-and-expansion-work] # First Law of Thermodynamics – conserved quantities (Ch. 19-[2 to 9]) #* PV work [https://www.khanacademy.org/science/chemistry/thermodynamics-chemistry/internal-energy-sal/a/pressure-volume-work] 307f180b43e98f21b27b8fc0def1fa167eb154a3 Main Page 0 9 753 682 2019-09-10T17:55:10Z David M. Rogers 2 wikitext text/x-wiki Welcome to the David M. Rogers' research group in Multiscale Chemical Physics at the University of South Florida. We develop predictive models for new physics and chemistry that appear when moving up from the atomic to the nano and micro-scale. To support this goal, we are developing the thermodynamics of far-from equilibrium systems, building functional data structures for supercomputing and applying Bayesian inference to mine simulation data. Work in these topics builds on recent advances in fundamental computer science, applied statistics, and nonequilibrium physics and chemistry. Together, new developments in these fields will allow unprecedented access to electron through device-level simulations and analysis for materials design grounded in fundamental physics. Two research areas collectively have the potential to greatly reduce the time and effort building, running, and analyzing molecular and continuum simulations for modern high-performance computing platforms. The first expands the theory and techniques of statistical mechanics for probabilistic simulation of energy conversion devices. The second applies advances in domain-specific languages to eliminate the lag between defining a physical, Hamiltonian model and carrying out dynamics and other computations on its potential energy landscape. For more details, see the [[Research]], [[Publications]], and [[Predictive_Chemistry:Current_events|Current events]] links. de7ad35525ef23db50a23fb4c24f43164eb7f316 757 753 2020-01-17T15:11:03Z David M. Rogers 2 wikitext text/x-wiki Predictivestatmech.org shows off predictive models for new physics and chemistry that appear when moving up from the atomic to the nano and micro-scale. To support this goal, we are developing the thermodynamics of far-from equilibrium systems, building functional data structures for supercomputing and applying Bayesian inference to mine simulation data. Work in these topics builds on recent advances in fundamental computer science, applied statistics, and nonequilibrium physics and chemistry. Together, new developments in these fields will allow unprecedented access to electron through device-level simulations and analysis for materials design grounded in fundamental physics. Two research areas collectively have the potential to greatly reduce the time and effort building, running, and analyzing molecular and continuum simulations for modern high-performance computing platforms. The first expands the theory and techniques of statistical mechanics for probabilistic simulation of energy conversion devices. The second applies advances in domain-specific languages to eliminate the lag between defining a physical, Hamiltonian model and carrying out dynamics and other computations on its potential energy landscape. For more details, see the [[Research]], [[Publications]], and [[Predictive_Chemistry:Current_events|Current events]] links. e9035f62ebffdb8632206956d724b33048bdab17